1- export PC, PCCreate, KSPGetPC, KSPSetPC, PCSetType, PCGetType, PCFactorSetUseInPlace, PCFactorGetUseInPlace, PCSetReusePreconditioner, PCGetReusePreconditioner, PCFactorSetAllowDiagonalFill, PCFactorGetAllowDiagonalFill, PCFactorSetLevels, PCFactorGetLevels, PCSetReusePreconditioner, PCGetReusePreconditioner, PCBJacobiGetSubKSP, PCFactorSetFill, PCJacobiSetType, PCJacobiGetType
1+ export PC, PCCreate, PCSetFromOptions, KSPGetPC, KSPSetPC, PCSetType, PCGetType, PCFactorSetUseInPlace, PCFactorGetUseInPlace, PCSetReusePreconditioner, PCGetReusePreconditioner, PCFactorSetAllowDiagonalFill, PCFactorGetAllowDiagonalFill, PCFactorSetLevels, PCFactorGetLevels, PCSetReusePreconditioner, PCGetReusePreconditioner, PCBJacobiGetSubKSP, PCFactorSetFill, PCJacobiSetType, PCJacobiGetType
22
33# Shell PC
4- export PCShellSetApply, PCShellSetSetUp, PCShellSetContext, PCShellGetContext
4+ export PCShellSetApply, PCShellSetApplyTranspose, PCShellSetSetUp,
5+ PCShellSetContext, PCShellGetContext
56
67# developer PC interface
7- export PCApply, PCApplyTranspose, PCApplyTransposeExists
8+ export PCApply, PCSetUp, PCApplyTranspose, PCApplyTransposeExists
89
910# preconditioner contex
1011# the KSP object creates the PC contex, so we don't provide a constructor
@@ -16,11 +17,23 @@ global const PC_NULL = PC(C_NULL)
1617
1718function PCCreate (comm:: MPI.Comm )
1819 arg2 = Ref {Ptr{Void}} ()
19- ccall ((:PCCreate ,petsc),PetscErrorCode,(comjm_type ,Ptr{PC }),comm,arg2)
20+ ccall ((:PCCreate ,petsc),PetscErrorCode,(comm_type ,Ptr{Ptr{Void} }),comm,arg2)
2021
2122 return PC (arg2[])
2223end
2324
25+ function PetscDestroy (arg1:: PC )
26+ if arg1. pobj != C_NULL
27+ ccall ((:PCDestroy ,petsc),PetscErrorCode,(Ptr{Ptr{Void}},),& arg1. pobj)
28+ end
29+ end
30+
31+
32+ function PCSetFromOptions (arg1:: PC )
33+ ccall ((:PCSetFromOptions ,petsc),PetscErrorCode,(Ptr{Void},),arg1. pobj)
34+ end
35+
36+
2437function KSPGetPC (ksp:: KSP )
2538 arr = Array (Ptr{Void}, 1 )
2639 ccall ((:KSPGetPC ,petsc),PetscErrorCode,(Ptr{Void},Ptr{Void}),ksp. pobj, arr)
@@ -47,6 +60,11 @@ function PCShellSetApply(arg1::PC,arg2::Ptr{Void})
4760 ccall ((:PCShellSetApply ,petsc),PetscErrorCode,(Ptr{Void},Ptr{Void}),arg1. pobj,arg2)
4861end
4962
63+ function PCShellSetApplyTranspose (arg1:: PC ,arg2:: Ptr{Void} )
64+ ccall ((:PCShellSetApplyTranspose ,petsc),PetscErrorCode,(Ptr{Void},Ptr{Void}),arg1. pobj,arg2)
65+ end
66+
67+
5068function PCShellSetSetUp (arg1:: PC ,arg2:: Ptr{Void} )
5169 ccall ((:PCShellSetSetUp ,petsc),PetscErrorCode,(Ptr{Void},Ptr{Void}),arg1. pobj,arg2)
5270end
@@ -151,6 +169,7 @@ function PCJacobiGetType(pc::PC)
151169end
152170
153171function PCApply (arg1:: PC ,arg2:: PetscVec ,arg3:: PetscVec )
172+ println (" pc.pobj = " , arg1. pobj)
154173 ccall ((:PCApply ,petsc),PetscErrorCode,(Ptr{Void},Ptr{Void},Ptr{Void}),arg1. pobj ,arg2. pobj, arg3. pobj)
155174end
156175
@@ -165,5 +184,8 @@ function PCApplyTransposeExists(arg1::PC)
165184 return arg2[] == 1
166185end
167186
187+ function PCSetUp (arg1:: PC )
188+ ccall ((:PCSetUp ,petsc),PetscErrorCode,(Ptr{Void},),arg1. pobj)
189+ end
168190
169191
0 commit comments