From 5a5f1cfc5b9faded92a80439f5e1b45696562a5c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 2 Nov 2023 15:41:20 +0100 Subject: [PATCH] mesh works again for PETSc >= 3.19 needs also bugfix in PETSc: https://gitlab.com/petsc/petsc/-/merge_requests/6986 --- src/mesh/FEM_utilities.f90 | 5 +++-- src/mesh/mesh_mech_FEM.f90 | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesh/FEM_utilities.f90 b/src/mesh/FEM_utilities.f90 index 4480e412d..3af7b77ea 100644 --- a/src/mesh/FEM_utilities.f90 +++ b/src/mesh/FEM_utilities.f90 @@ -122,19 +122,20 @@ subroutine FEM_utilities_init(num_mesh) flush(IO_STDOUT) call PetscOptionsClear(PETSC_NULL_OPTIONS,err_PETSc) CHKERRQ(err_PETSc) - CHKERRQ(err_PETSc) petsc_options = misc_prefixOptions('-snes_type newtonls & &-snes_linesearch_type cp -snes_ksp_ew & &-snes_ksp_ew_rtol0 0.01 -snes_ksp_ew_rtolmax 0.01 & &-ksp_type fgmres -ksp_max_it 25 ' // & num_mech%get_asStr('PETSc_options',defaultVal=''), 'mechanical_') - write(petsc_optionsOrder,'(a,i0)') '-mechFE_petscspace_degree ', p_s petsc_options = petsc_options // ' ' // petsc_optionsOrder call PetscOptionsInsertString(PETSC_NULL_OPTIONS,petsc_options,err_PETSc) CHKERRQ(err_PETSc) + call PetscOptionsSetValue(PETSC_NULL_OPTIONS,'-petscds_force_quad','0',err_PETSc) + CHKERRQ(err_PETSc) + wgt = real(mesh_maxNips*mesh_NcpElemsGlobal,pREAL)**(-1) end subroutine FEM_utilities_init diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index 67b7859ba..2d5556e63 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -155,6 +155,8 @@ subroutine FEM_mechanical_init(fieldBC,num_mesh) CHKERRQ(err_PETSc) call DMGetDimension(mechanical_mesh,dimPlex,err_PETSc) CHKERRQ(err_PETSc) + call DMSetFromOptions(mechanical_mesh,err_PETSc) + CHKERRQ(err_PETSc) !-------------------------------------------------------------------------------------------------- ! Setup FEM mech discretization