Skip to content

Commit 9a20267

Browse files
committed
mesh solver adjustments for PETSc 3.22.x
1 parent 55dd0cd commit 9a20267

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/mesh/discretization_mesh.f90

+10
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,25 @@ subroutine discretization_mesh_init()
179179
#else
180180
call PetscDTSimplexQuadrature(dimplex, p_i, -1, quadrature, err_PETSc)
181181
CHKERRQ(err_PETSc)
182+
#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>=22)
183+
call PetscQuadratureGetData(quadrature,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
184+
mesh_maxNips,qPointsP,PETSC_NULL_REAL_PTR,err_PETSc)
185+
#else
182186
call PetscQuadratureGetData(quadrature,PETSC_NULL_INTEGER(1),PETSC_NULL_INTEGER(1), &
183187
mesh_maxNips,qPointsP,PETSC_NULL_REAL_PTR,err_PETSc)
188+
#endif
184189
CHKERRQ(err_PETSc)
185190

186191
call mesh_FEM_build_ipCoordinates(dimPlex,qPointsP)
187192
call mesh_FEM_build_ipVolumes(dimPlex)
188193

194+
#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>=22)
195+
call PetscQuadratureRestoreData(quadrature,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
196+
PETSC_NULL_INTEGER,qPointsP,PETSC_NULL_REAL_PTR,err_PETSc)
197+
#else
189198
call PetscQuadratureRestoreData(quadrature,PETSC_NULL_INTEGER(1),PETSC_NULL_INTEGER(1), &
190199
PETSC_NULL_INTEGER(1),qPointsP,PETSC_NULL_REAL_PTR,err_PETSc)
200+
#endif
191201
CHKERRQ(err_PETSc)
192202
call PetscQuadratureDestroy(quadrature, err_PETSc)
193203
CHKERRQ(err_PETSc)

src/mesh/mesh_mech_FEM.f90

+10
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,23 @@ subroutine FEM_mechanical_init(mechBC,num_mesh)
179179
#else
180180
call PetscDTSimplexQuadrature(dimplex,num%p_i,-1,mechQuad,err_PETSc)
181181
CHKERRQ(err_PETSc)
182+
#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>=22)
183+
call PetscQuadratureGetData(mechQuad,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
184+
nQuadrature,PETSC_NULL_REAL_PTR,qWeightsP,err_PETSc)
185+
CHKERRQ(err_PETSc)
186+
qWeights = qWeightsP
187+
call PetscQuadratureRestoreData(mechQuad,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
188+
PETSC_NULL_INTEGER,PETSC_NULL_REAL_PTR,qWeightsP, &
189+
err_PETSc)
190+
#else
182191
call PetscQuadratureGetData(mechQuad,PETSC_NULL_INTEGER(1),PETSC_NULL_INTEGER(1), &
183192
nQuadrature,PETSC_NULL_REAL_PTR,qWeightsP,err_PETSc)
184193
CHKERRQ(err_PETSc)
185194
qWeights = qWeightsP
186195
call PetscQuadratureRestoreData(mechQuad,PETSC_NULL_INTEGER(1),PETSC_NULL_INTEGER(1), &
187196
PETSC_NULL_INTEGER(1),PETSC_NULL_REAL_PTR,qWeightsP, &
188197
err_PETSc)
198+
#endif
189199
CHKERRQ(err_PETSc)
190200
nc = dimPlex
191201
#endif

0 commit comments

Comments
 (0)