Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions petsctools/cpetsc.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ from petsc4py.PETSc cimport (
)


cdef extern from "petsc.h":
# fundamental types
cdef extern from "petscsystypes.h":
ctypedef long PetscInt
ctypedef double PetscReal
ctypedef double PetscScalar
Expand All @@ -37,24 +36,33 @@ cdef extern from "petsc.h":
PETSC_OWN_POINTER
PETSC_USE_POINTER

# memory management
cdef extern from "petscsys.h":
PetscErrorCode PetscCalloc1(size_t,void*)
PetscErrorCode PetscMalloc1(size_t,void*)
PetscErrorCode PetscFree(void*)

# Mat
# Mat
cdef extern from "petscmat.h":
PetscErrorCode MatSetValue(Mat,PetscInt,PetscInt,const PetscScalar,InsertMode)
PetscErrorCode MatSetValuesBlockedLocal(Mat,PetscInt,const PetscInt[],PetscInt,const PetscInt[],const PetscScalar[],InsertMode)

# PetscSF
# PetscSF
cdef extern from "petscsf.h":
ctypedef struct PetscSFNode:
PetscInt rank
PetscInt index

PetscErrorCode PetscSFGetGraph(PetscSF,PetscInt*,PetscInt*,const PetscInt**,const PetscSFNode**)
PetscErrorCode PetscSFSetGraph(PetscSF,PetscInt,PetscInt,PetscInt*,PetscCopyMode,PetscSFNode*,PetscCopyMode)

# PetscSection
# PetscSection
cdef extern from "petscsection.h":
PetscErrorCode PetscSectionGetDof(PetscSection,PetscInt,PetscInt*)
PetscErrorCode PetscSectionSetDof(PetscSection,PetscInt,PetscInt)
PetscErrorCode PetscSectionGetOffset(PetscSection,PetscInt,PetscInt*)
PetscErrorCode PetscSectionSetOffset(PetscSection,PetscInt,PetscInt)
PetscErrorCode PetscSectionGetConstraintDof(PetscSection,PetscInt,PetscInt*)
PetscErrorCode PetscSectionSetConstraintDof(PetscSection,PetscInt,PetscInt)
PetscErrorCode PetscSectionGetConstraintIndices(PetscSection,PetscInt,const PetscInt*[])
PetscErrorCode PetscSectionSetConstraintIndices(PetscSection,PetscInt,const PetscInt[])
PetscErrorCode PetscSectionGetMaxDof(PetscSection,PetscInt*)
Loading