Skip to content

Commit dce0418

Browse files
committed
Future-proof PETSc-code.hpp
[ci skip]
1 parent 19705e2 commit dce0418

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

plugin/mpi/PETSc-code.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ void dispatch(MeshBemtool *mesh, bemtool::Geometry *node, int VFBEM, Stack stack
151151
Assembly(B,ctx,ds.sparams,p1,p1,MPI_COMM_NULL,Mesh1::RdHat::d+1,ds.sym);
152152
PetscContainerCreate(PetscObjectComm((PetscObject)B->_petsc), &ptr);
153153
PetscContainerSetPointer(ptr, ctx);
154-
#if PETSC_VERSION_GE(3, 23, 0)
154+
#if PETSC_VERSION_GE(3, 24, 0)
155+
PetscContainerSetCtxDestroy(ptr, (PetscCtxDestroyFn *)DestroyHtoolCtx<P,MeshBemtool>);
156+
#elif PETSC_VERSION_GE(3, 23, 0)
155157
PetscContainerSetCtxDestroy(ptr, DestroyHtoolCtx<P,MeshBemtool>);
156158
#else
157159
PetscContainerSetUserDestroy(ptr, DestroyHtoolCtx<P,MeshBemtool>);
@@ -202,7 +204,9 @@ void dispatch(MeshBemtool *mesh, bemtool::Geometry *node, int VFBEM, Stack stack
202204
Assembly(B,ctx,ds.sparams,p1,p1,MPI_COMM_NULL,Mesh1::RdHat::d+1,ds.sym);
203205
PetscContainerCreate(PetscObjectComm((PetscObject)B->_petsc), &ptr);
204206
PetscContainerSetPointer(ptr, ctx);
205-
#if PETSC_VERSION_GE(3, 23, 0)
207+
#if PETSC_VERSION_GE(3, 24, 0)
208+
PetscContainerSetCtxDestroy(ptr, (PetscCtxDestroyFn *)DestroyHtoolCtx<P,MeshBemtool>);
209+
#elif PETSC_VERSION_GE(3, 23, 0)
206210
PetscContainerSetCtxDestroy(ptr, DestroyHtoolCtx<P,MeshBemtool>);
207211
#else
208212
PetscContainerSetUserDestroy(ptr, DestroyHtoolCtx<P,MeshBemtool>);
@@ -2992,7 +2996,11 @@ namespace PETSc {
29922996
const OneOperator* codeM = op->Find(
29932997
"(", ArrayOfaType(atype< long >( ), atype< double >( ), false));
29942998
typename LinearSolver< Type >::MonF_O* mon = new typename LinearSolver< Type >::MonF_O(stack, codeM);
2999+
#if PETSC_VERSION_GE(3, 24, 0)
3000+
KSPMonitorSet(ksp, Monitor< LinearSolver< Type > >, mon, (PetscCtxDestroyFn *)MonitorDestroy< Type >);
3001+
#else
29953002
KSPMonitorSet(ksp, Monitor< LinearSolver< Type > >, mon, MonitorDestroy< Type >);
3003+
#endif
29963004
}
29973005
}
29983006
}

0 commit comments

Comments
 (0)