drop support for old PETSc versions
This commit is contained in:
parent
b6d00e2fb8
commit
189597dbff
|
@ -10,7 +10,7 @@
|
||||||
!> and working directory.
|
!> and working directory.
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
#define PETSC_MAJOR 3
|
#define PETSC_MAJOR 3
|
||||||
#define PETSC_MINOR_MIN 10
|
#define PETSC_MINOR_MIN 12
|
||||||
#define PETSC_MINOR_MAX 14
|
#define PETSC_MINOR_MAX 14
|
||||||
|
|
||||||
module DAMASK_interface
|
module DAMASK_interface
|
||||||
|
|
|
@ -147,14 +147,9 @@ subroutine FEM_mech_init(fieldBC)
|
||||||
call PetscFESetQuadrature(mechFE,mechQuad,ierr); CHKERRQ(ierr)
|
call PetscFESetQuadrature(mechFE,mechQuad,ierr); CHKERRQ(ierr)
|
||||||
call PetscFEGetDimension(mechFE,nBasis,ierr); CHKERRQ(ierr)
|
call PetscFEGetDimension(mechFE,nBasis,ierr); CHKERRQ(ierr)
|
||||||
nBasis = nBasis/nc
|
nBasis = nBasis/nc
|
||||||
#if (PETSC_VERSION_MINOR > 10)
|
|
||||||
call DMAddField(mech_mesh,PETSC_NULL_DMLABEL,mechFE,ierr); CHKERRQ(ierr)
|
call DMAddField(mech_mesh,PETSC_NULL_DMLABEL,mechFE,ierr); CHKERRQ(ierr)
|
||||||
call DMCreateDS(mech_mesh,ierr); CHKERRQ(ierr)
|
call DMCreateDS(mech_mesh,ierr); CHKERRQ(ierr)
|
||||||
#endif
|
|
||||||
call DMGetDS(mech_mesh,mechDS,ierr); CHKERRQ(ierr)
|
call DMGetDS(mech_mesh,mechDS,ierr); CHKERRQ(ierr)
|
||||||
#if (PETSC_VERSION_MINOR < 11)
|
|
||||||
call PetscDSAddDiscretization(mechDS,mechFE,ierr); CHKERRQ(ierr)
|
|
||||||
#endif
|
|
||||||
call PetscDSGetTotalDimension(mechDS,cellDof,ierr); CHKERRQ(ierr)
|
call PetscDSGetTotalDimension(mechDS,cellDof,ierr); CHKERRQ(ierr)
|
||||||
call PetscFEDestroy(mechFE,ierr); CHKERRQ(ierr)
|
call PetscFEDestroy(mechFE,ierr); CHKERRQ(ierr)
|
||||||
call PetscQuadratureDestroy(mechQuad,ierr); CHKERRQ(ierr)
|
call PetscQuadratureDestroy(mechQuad,ierr); CHKERRQ(ierr)
|
||||||
|
@ -163,11 +158,7 @@ subroutine FEM_mech_init(fieldBC)
|
||||||
! Setup FEM mech boundary conditions
|
! Setup FEM mech boundary conditions
|
||||||
call DMGetLabel(mech_mesh,'Face Sets',BCLabel,ierr); CHKERRQ(ierr)
|
call DMGetLabel(mech_mesh,'Face Sets',BCLabel,ierr); CHKERRQ(ierr)
|
||||||
call DMPlexLabelComplete(mech_mesh,BCLabel,ierr); CHKERRQ(ierr)
|
call DMPlexLabelComplete(mech_mesh,BCLabel,ierr); CHKERRQ(ierr)
|
||||||
#if (PETSC_VERSION_MINOR < 12)
|
|
||||||
call DMGetSection(mech_mesh,section,ierr); CHKERRQ(ierr)
|
|
||||||
#else
|
|
||||||
call DMGetLocalSection(mech_mesh,section,ierr); CHKERRQ(ierr)
|
call DMGetLocalSection(mech_mesh,section,ierr); CHKERRQ(ierr)
|
||||||
#endif
|
|
||||||
allocate(pnumComp(1), source=dimPlex)
|
allocate(pnumComp(1), source=dimPlex)
|
||||||
allocate(pnumDof(0:dimPlex), source = 0)
|
allocate(pnumDof(0:dimPlex), source = 0)
|
||||||
do topologDim = 0, dimPlex
|
do topologDim = 0, dimPlex
|
||||||
|
@ -205,14 +196,8 @@ subroutine FEM_mech_init(fieldBC)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
enddo; enddo
|
enddo; enddo
|
||||||
#if (PETSC_VERSION_MINOR < 11)
|
|
||||||
call DMPlexCreateSection(mech_mesh,dimPlex,1,pNumComp,pNumDof, &
|
|
||||||
numBC,pBcField,pBcComps,pBcPoints,PETSC_NULL_IS,section,ierr)
|
|
||||||
#else
|
|
||||||
call DMPlexCreateSection(mech_mesh,nolabel,pNumComp,pNumDof, &
|
call DMPlexCreateSection(mech_mesh,nolabel,pNumComp,pNumDof, &
|
||||||
numBC,pBcField,pBcComps,pBcPoints,PETSC_NULL_IS,section,ierr)
|
numBC,pBcField,pBcComps,pBcPoints,PETSC_NULL_IS,section,ierr)
|
||||||
|
|
||||||
#endif
|
|
||||||
CHKERRQ(ierr)
|
CHKERRQ(ierr)
|
||||||
call DMSetSection(mech_mesh,section,ierr); CHKERRQ(ierr)
|
call DMSetSection(mech_mesh,section,ierr); CHKERRQ(ierr)
|
||||||
do faceSet = 1, numBC
|
do faceSet = 1, numBC
|
||||||
|
@ -267,11 +252,7 @@ subroutine FEM_mech_init(fieldBC)
|
||||||
x_scal(basis+1:basis+dimPlex) = pV0 + matmul(transpose(cellJMat),nodalPointsP + 1.0_pReal)
|
x_scal(basis+1:basis+dimPlex) = pV0 + matmul(transpose(cellJMat),nodalPointsP + 1.0_pReal)
|
||||||
enddo
|
enddo
|
||||||
px_scal => x_scal
|
px_scal => x_scal
|
||||||
#if (PETSC_VERSION_MINOR < 11)
|
call DMPlexVecSetClosure(mech_mesh,section,solution_local,cell,px_scal,5,ierr)
|
||||||
call DMPlexVecSetClosure(mech_mesh,section,solution_local,cell,px_scal,INSERT_ALL_VALUES,ierr)
|
|
||||||
#else
|
|
||||||
call DMPlexVecSetClosure(mech_mesh,section,solution_local,cell,px_scal,5,ierr) ! PETSc: cbee0a90b60958e5c50c89b1e41f4451dfa6008c
|
|
||||||
#endif
|
|
||||||
CHKERRQ(ierr)
|
CHKERRQ(ierr)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
@ -355,11 +336,7 @@ subroutine FEM_mech_formResidual(dm_local,xx_local,f_local,dummy,ierr)
|
||||||
allocate(pinvcellJ(dimPlex**2))
|
allocate(pinvcellJ(dimPlex**2))
|
||||||
allocate(x_scal(cellDof))
|
allocate(x_scal(cellDof))
|
||||||
|
|
||||||
#if (PETSC_VERSION_MINOR < 12)
|
|
||||||
call DMGetSection(dm_local,section,ierr); CHKERRQ(ierr)
|
|
||||||
#else
|
|
||||||
call DMGetLocalSection(dm_local,section,ierr); CHKERRQ(ierr)
|
call DMGetLocalSection(dm_local,section,ierr); CHKERRQ(ierr)
|
||||||
#endif
|
|
||||||
call DMGetDS(dm_local,prob,ierr); CHKERRQ(ierr)
|
call DMGetDS(dm_local,prob,ierr); CHKERRQ(ierr)
|
||||||
call PetscDSGetTabulation(prob,0,basisField,basisFieldDer,ierr)
|
call PetscDSGetTabulation(prob,0,basisField,basisFieldDer,ierr)
|
||||||
CHKERRQ(ierr)
|
CHKERRQ(ierr)
|
||||||
|
@ -502,11 +479,7 @@ subroutine FEM_mech_formJacobian(dm_local,xx_local,Jac_pre,Jac,dummy,ierr)
|
||||||
call MatZeroEntries(Jac,ierr); CHKERRQ(ierr)
|
call MatZeroEntries(Jac,ierr); CHKERRQ(ierr)
|
||||||
call DMGetDS(dm_local,prob,ierr); CHKERRQ(ierr)
|
call DMGetDS(dm_local,prob,ierr); CHKERRQ(ierr)
|
||||||
call PetscDSGetTabulation(prob,0,basisField,basisFieldDer,ierr)
|
call PetscDSGetTabulation(prob,0,basisField,basisFieldDer,ierr)
|
||||||
#if (PETSC_VERSION_MINOR < 12)
|
|
||||||
call DMGetSection(dm_local,section,ierr); CHKERRQ(ierr)
|
|
||||||
#else
|
|
||||||
call DMGetLocalSection(dm_local,section,ierr); CHKERRQ(ierr)
|
call DMGetLocalSection(dm_local,section,ierr); CHKERRQ(ierr)
|
||||||
#endif
|
|
||||||
call DMGetGlobalSection(dm_local,gSection,ierr); CHKERRQ(ierr)
|
call DMGetGlobalSection(dm_local,gSection,ierr); CHKERRQ(ierr)
|
||||||
|
|
||||||
call DMGetLocalVector(dm_local,x_local,ierr); CHKERRQ(ierr)
|
call DMGetLocalVector(dm_local,x_local,ierr); CHKERRQ(ierr)
|
||||||
|
|
Loading…
Reference in New Issue