Go to the documentation of this file. 18 #ifndef LIBMESH_PETSC_MACRO_H 19 #define LIBMESH_PETSC_MACRO_H 24 #ifdef LIBMESH_HAVE_PETSC 33 #define PETSC_VERSION_LESS_THAN(major,minor,subminor) \ 34 ((LIBMESH_DETECTED_PETSC_VERSION_MAJOR < (major) || \ 35 (LIBMESH_DETECTED_PETSC_VERSION_MAJOR == (major) && (LIBMESH_DETECTED_PETSC_VERSION_MINOR < (minor) || \ 36 (LIBMESH_DETECTED_PETSC_VERSION_MINOR == (minor) && \ 37 LIBMESH_DETECTED_PETSC_VERSION_SUBMINOR < (subminor))))) ? 1 : 0) 41 #ifdef LIBMESH_DETECTED_PETSC_VERSION_RELEASE 43 #define PETSC_RELEASE_LESS_THAN(major,minor,subminor) \ 44 (PETSC_VERSION_LESS_THAN(major,minor,subminor) && LIBMESH_DETECTED_PETSC_VERSION_RELEASE) 48 #define PETSC_RELEASE_LESS_THAN(major,minor,subminor) \ 49 (PETSC_VERSION_LESS_THAN(major,minor,subminor)) 57 #define EXTERN_C_FOR_PETSC_BEGIN 58 #define EXTERN_C_FOR_PETSC_END 66 #if PETSC_RELEASE_LESS_THAN(3,1,1) 70 #if PETSC_RELEASE_LESS_THAN(3,1,1) 71 # define LibMeshVecDestroy(x) VecDestroy(*(x)) 72 # define LibMeshVecScatterDestroy(x) VecScatterDestroy(*(x)) 73 # define LibMeshMatDestroy(x) MatDestroy(*(x)) 74 # define LibMeshISDestroy(x) ISDestroy(*(x)) 75 # define LibMeshKSPDestroy(x) KSPDestroy(*(x)) 76 # define LibMeshSNESDestroy(x) SNESDestroy(*(x)) 77 # define LibMeshPetscViewerDestroy(x) PetscViewerDestroy(*(x)) 78 # define LibMeshPCDestroy(x) PCDestroy(*(x)) 80 # define LibMeshVecDestroy(x) VecDestroy(x) 81 # define LibMeshVecScatterDestroy(x) VecScatterDestroy(x) 82 # define LibMeshMatDestroy(x) MatDestroy(x) 83 # define LibMeshISDestroy(x) ISDestroy(x) 84 # define LibMeshKSPDestroy(x) KSPDestroy(x) 85 # define LibMeshSNESDestroy(x) SNESDestroy(x) 86 # define LibMeshPetscViewerDestroy(x) PetscViewerDestroy(x) 87 # define LibMeshPCDestroy(x) PCDestroy(x) 91 #if PETSC_VERSION_LESS_THAN(3,11,0) && PETSC_VERSION_RELEASE 92 # define LibMeshVecScatterCreate(xin,ix,yin,iy,newctx) VecScatterCreate(xin,ix,yin,iy,newctx) 94 # define LibMeshVecScatterCreate(xin,ix,yin,iy,newctx) VecScatterCreateWithData(xin,ix,yin,iy,newctx) 97 #if PETSC_RELEASE_LESS_THAN(3,1,1) 99 # define ISCreateLibMesh(comm,n,idx,mode,is) \ 100 ((mode) == PETSC_USE_POINTER \ 101 ? ISCreateGeneralWithArray((comm),(n),(idx),(is)) \ 102 : ((mode) == PETSC_OWN_POINTER \ 103 ? ISCreateGeneralNC((comm),(n),(idx),(is)) \ 104 : ISCreateGeneral((comm),(n),(idx),(is)))) 106 # define ISCreateLibMesh(comm,n,idx,mode,is) ISCreateGeneral((comm),(n),(idx),(mode),(is)) 110 #if PETSC_RELEASE_LESS_THAN(3,8,0) 111 # define LibMeshCreateSubMatrix MatGetSubMatrix 113 # define LibMeshCreateSubMatrix MatCreateSubMatrix 116 #else // LIBMESH_HAVE_PETSC 118 #define PETSC_VERSION_LESS_THAN(major,minor,subminor) 1 119 #define PETSC_RELEASE_LESS_THAN(major,minor,subminor) 1 121 #endif // LIBMESH_HAVE_PETSC 123 #endif // LIBMESH_PETSC_MACRO_H