/* Generated by Cython 0.24 */

#ifndef __PYX_HAVE_API__petsc4py__PETSc
#define __PYX_HAVE_API__petsc4py__PETSc
#include "Python.h"
#include "petsc4py.PETSc.h"

static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Comm = 0;
#define PyPetscComm_Type (*__pyx_ptype_8petsc4py_5PETSc_Comm)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Object = 0;
#define PyPetscObject_Type (*__pyx_ptype_8petsc4py_5PETSc_Object)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Viewer = 0;
#define PyPetscViewer_Type (*__pyx_ptype_8petsc4py_5PETSc_Viewer)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Random = 0;
#define PyPetscRandom_Type (*__pyx_ptype_8petsc4py_5PETSc_Random)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_IS = 0;
#define PyPetscIS_Type (*__pyx_ptype_8petsc4py_5PETSc_IS)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LGMap = 0;
#define PyPetscLGMap_Type (*__pyx_ptype_8petsc4py_5PETSc_LGMap)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SF = 0;
#define PyPetscSF_Type (*__pyx_ptype_8petsc4py_5PETSc_SF)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Vec = 0;
#define PyPetscVec_Type (*__pyx_ptype_8petsc4py_5PETSc_Vec)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Scatter = 0;
#define PyPetscScatter_Type (*__pyx_ptype_8petsc4py_5PETSc_Scatter)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Section = 0;
#define PyPetscSection_Type (*__pyx_ptype_8petsc4py_5PETSc_Section)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Mat = 0;
#define PyPetscMat_Type (*__pyx_ptype_8petsc4py_5PETSc_Mat)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_NullSpace = 0;
#define PyPetscNullSpace_Type (*__pyx_ptype_8petsc4py_5PETSc_NullSpace)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_PC = 0;
#define PyPetscPC_Type (*__pyx_ptype_8petsc4py_5PETSc_PC)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_KSP = 0;
#define PyPetscKSP_Type (*__pyx_ptype_8petsc4py_5PETSc_KSP)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SNES = 0;
#define PyPetscSNES_Type (*__pyx_ptype_8petsc4py_5PETSc_SNES)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TS = 0;
#define PyPetscTS_Type (*__pyx_ptype_8petsc4py_5PETSc_TS)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAO = 0;
#define PyPetscTAO_Type (*__pyx_ptype_8petsc4py_5PETSc_TAO)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_AO = 0;
#define PyPetscAO_Type (*__pyx_ptype_8petsc4py_5PETSc_AO)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DM = 0;
#define PyPetscDM_Type (*__pyx_ptype_8petsc4py_5PETSc_DM)
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Partitioner = 0;
#define PyPetscPartitioner_Type (*__pyx_ptype_8petsc4py_5PETSc_Partitioner)

static int (*__pyx_api_f_8petsc4py_5PETSc_PyPetscError_Set)(int) = 0;
#define PyPetscError_Set __pyx_api_f_8petsc4py_5PETSc_PyPetscError_Set
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_New)(MPI_Comm) = 0;
#define PyPetscComm_New __pyx_api_f_8petsc4py_5PETSc_PyPetscComm_New
static MPI_Comm (*__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_Get)(PyObject *) = 0;
#define PyPetscComm_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscComm_Get
static MPI_Comm *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_GetPtr)(PyObject *) = 0;
#define PyPetscComm_GetPtr __pyx_api_f_8petsc4py_5PETSc_PyPetscComm_GetPtr
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_New)(PetscObject) = 0;
#define PyPetscObject_New __pyx_api_f_8petsc4py_5PETSc_PyPetscObject_New
static PetscObject (*__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_Get)(PyObject *) = 0;
#define PyPetscObject_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscObject_Get
static PetscObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_GetPtr)(PyObject *) = 0;
#define PyPetscObject_GetPtr __pyx_api_f_8petsc4py_5PETSc_PyPetscObject_GetPtr
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_New)(PetscViewer) = 0;
#define PyPetscViewer_New __pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_New
static PetscViewer (*__pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_Get)(PyObject *) = 0;
#define PyPetscViewer_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_New)(PetscRandom) = 0;
#define PyPetscRandom_New __pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_New
static PetscRandom (*__pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_Get)(PyObject *) = 0;
#define PyPetscRandom_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscIS_New)(IS) = 0;
#define PyPetscIS_New __pyx_api_f_8petsc4py_5PETSc_PyPetscIS_New
static IS (*__pyx_api_f_8petsc4py_5PETSc_PyPetscIS_Get)(PyObject *) = 0;
#define PyPetscIS_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscIS_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_New)(ISLocalToGlobalMapping) = 0;
#define PyPetscLGMap_New __pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_New
static ISLocalToGlobalMapping (*__pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_Get)(PyObject *) = 0;
#define PyPetscLGMap_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscSF_New)(PetscSF) = 0;
#define PyPetscSF_New __pyx_api_f_8petsc4py_5PETSc_PyPetscSF_New
static PetscSF (*__pyx_api_f_8petsc4py_5PETSc_PyPetscSF_Get)(PyObject *) = 0;
#define PyPetscSF_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscSF_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscVec_New)(Vec) = 0;
#define PyPetscVec_New __pyx_api_f_8petsc4py_5PETSc_PyPetscVec_New
static Vec (*__pyx_api_f_8petsc4py_5PETSc_PyPetscVec_Get)(PyObject *) = 0;
#define PyPetscVec_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscVec_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_New)(VecScatter) = 0;
#define PyPetscScatter_New __pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_New
static VecScatter (*__pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_Get)(PyObject *) = 0;
#define PyPetscScatter_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscSection_New)(PetscSection) = 0;
#define PyPetscSection_New __pyx_api_f_8petsc4py_5PETSc_PyPetscSection_New
static PetscSection (*__pyx_api_f_8petsc4py_5PETSc_PyPetscSection_Get)(PyObject *) = 0;
#define PyPetscSection_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscSection_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscMat_New)(Mat) = 0;
#define PyPetscMat_New __pyx_api_f_8petsc4py_5PETSc_PyPetscMat_New
static Mat (*__pyx_api_f_8petsc4py_5PETSc_PyPetscMat_Get)(PyObject *) = 0;
#define PyPetscMat_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscMat_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscPC_New)(PC) = 0;
#define PyPetscPC_New __pyx_api_f_8petsc4py_5PETSc_PyPetscPC_New
static PC (*__pyx_api_f_8petsc4py_5PETSc_PyPetscPC_Get)(PyObject *) = 0;
#define PyPetscPC_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscPC_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_New)(KSP) = 0;
#define PyPetscKSP_New __pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_New
static KSP (*__pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_Get)(PyObject *) = 0;
#define PyPetscKSP_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_New)(SNES) = 0;
#define PyPetscSNES_New __pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_New
static SNES (*__pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_Get)(PyObject *) = 0;
#define PyPetscSNES_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscTS_New)(TS) = 0;
#define PyPetscTS_New __pyx_api_f_8petsc4py_5PETSc_PyPetscTS_New
static TS (*__pyx_api_f_8petsc4py_5PETSc_PyPetscTS_Get)(PyObject *) = 0;
#define PyPetscTS_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscTS_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_New)(Tao) = 0;
#define PyPetscTAO_New __pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_New
static Tao (*__pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_Get)(PyObject *) = 0;
#define PyPetscTAO_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscAO_New)(AO) = 0;
#define PyPetscAO_New __pyx_api_f_8petsc4py_5PETSc_PyPetscAO_New
static AO (*__pyx_api_f_8petsc4py_5PETSc_PyPetscAO_Get)(PyObject *) = 0;
#define PyPetscAO_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscAO_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscDM_New)(DM) = 0;
#define PyPetscDM_New __pyx_api_f_8petsc4py_5PETSc_PyPetscDM_New
static DM (*__pyx_api_f_8petsc4py_5PETSc_PyPetscDM_Get)(PyObject *) = 0;
#define PyPetscDM_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscDM_Get
static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_New)(PetscPartitioner) = 0;
#define PyPetscPartitioner_New __pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_New
static PetscPartitioner (*__pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_Get)(PyObject *) = 0;
#define PyPetscPartitioner_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_Get
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif


static int import_petsc4py__PETSc(void) {
  PyObject *module = 0;
  module = __Pyx_ImportModule("petsc4py.PETSc");
  if (!module) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscError_Set", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscError_Set, "int (int)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscComm_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_New, "PyObject *(MPI_Comm)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscComm_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_Get, "MPI_Comm (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscComm_GetPtr", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_GetPtr, "MPI_Comm *(PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscObject_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_New, "PyObject *(PetscObject)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscObject_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_Get, "PetscObject (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscObject_GetPtr", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_GetPtr, "PetscObject *(PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscViewer_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_New, "PyObject *(PetscViewer)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscViewer_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_Get, "PetscViewer (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscRandom_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_New, "PyObject *(PetscRandom)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscRandom_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_Get, "PetscRandom (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscIS_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscIS_New, "PyObject *(IS)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscIS_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscIS_Get, "IS (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscLGMap_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_New, "PyObject *(ISLocalToGlobalMapping)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscLGMap_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_Get, "ISLocalToGlobalMapping (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscSF_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSF_New, "PyObject *(PetscSF)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscSF_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSF_Get, "PetscSF (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscVec_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscVec_New, "PyObject *(Vec)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscVec_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscVec_Get, "Vec (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscScatter_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_New, "PyObject *(VecScatter)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscScatter_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_Get, "VecScatter (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscSection_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSection_New, "PyObject *(PetscSection)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscSection_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSection_Get, "PetscSection (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscMat_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscMat_New, "PyObject *(Mat)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscMat_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscMat_Get, "Mat (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscPC_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscPC_New, "PyObject *(PC)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscPC_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscPC_Get, "PC (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscKSP_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_New, "PyObject *(KSP)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscKSP_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_Get, "KSP (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscSNES_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_New, "PyObject *(SNES)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscSNES_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_Get, "SNES (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscTS_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscTS_New, "PyObject *(TS)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscTS_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscTS_Get, "TS (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscTAO_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_New, "PyObject *(Tao)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscTAO_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_Get, "Tao (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscAO_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscAO_New, "PyObject *(AO)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscAO_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscAO_Get, "AO (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscDM_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscDM_New, "PyObject *(DM)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscDM_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscDM_Get, "DM (PyObject *)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscPartitioner_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_New, "PyObject *(PetscPartitioner)") < 0) goto bad;
  if (__Pyx_ImportFunction(module, "PyPetscPartitioner_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_Get, "PetscPartitioner (PyObject *)") < 0) goto bad;
  Py_DECREF(module); module = 0;
  __pyx_ptype_8petsc4py_5PETSc_Comm = __Pyx_ImportType("petsc4py.PETSc", "Comm", sizeof(struct PyPetscCommObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Comm) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_Object = __Pyx_ImportType("petsc4py.PETSc", "Object", sizeof(struct PyPetscObjectObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Object) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_Viewer = __Pyx_ImportType("petsc4py.PETSc", "Viewer", sizeof(struct PyPetscViewerObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Viewer) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_Random = __Pyx_ImportType("petsc4py.PETSc", "Random", sizeof(struct PyPetscRandomObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Random) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_IS = __Pyx_ImportType("petsc4py.PETSc", "IS", sizeof(struct PyPetscISObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_IS) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_LGMap = __Pyx_ImportType("petsc4py.PETSc", "LGMap", sizeof(struct PyPetscLGMapObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_LGMap) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_SF = __Pyx_ImportType("petsc4py.PETSc", "SF", sizeof(struct PyPetscSFObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_SF) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_Vec = __Pyx_ImportType("petsc4py.PETSc", "Vec", sizeof(struct PyPetscVecObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Vec) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_Scatter = __Pyx_ImportType("petsc4py.PETSc", "Scatter", sizeof(struct PyPetscScatterObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Scatter) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_Section = __Pyx_ImportType("petsc4py.PETSc", "Section", sizeof(struct PyPetscSectionObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Section) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_Mat = __Pyx_ImportType("petsc4py.PETSc", "Mat", sizeof(struct PyPetscMatObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Mat) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_NullSpace = __Pyx_ImportType("petsc4py.PETSc", "NullSpace", sizeof(struct PyPetscNullSpaceObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_NullSpace) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_PC = __Pyx_ImportType("petsc4py.PETSc", "PC", sizeof(struct PyPetscPCObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_PC) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_KSP = __Pyx_ImportType("petsc4py.PETSc", "KSP", sizeof(struct PyPetscKSPObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_KSP) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_SNES = __Pyx_ImportType("petsc4py.PETSc", "SNES", sizeof(struct PyPetscSNESObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_SNES) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_TS = __Pyx_ImportType("petsc4py.PETSc", "TS", sizeof(struct PyPetscTSObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_TS) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_TAO = __Pyx_ImportType("petsc4py.PETSc", "TAO", sizeof(struct PyPetscTAOObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_TAO) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_AO = __Pyx_ImportType("petsc4py.PETSc", "AO", sizeof(struct PyPetscAOObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_AO) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_DM = __Pyx_ImportType("petsc4py.PETSc", "DM", sizeof(struct PyPetscDMObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_DM) goto bad;
  __pyx_ptype_8petsc4py_5PETSc_Partitioner = __Pyx_ImportType("petsc4py.PETSc", "Partitioner", sizeof(struct PyPetscPartitionerObject), 1); if (!__pyx_ptype_8petsc4py_5PETSc_Partitioner) goto bad;
  return 0;
  bad:
  Py_XDECREF(module);
  return -1;
}

#endif /* !__PYX_HAVE_API__petsc4py__PETSc */
