Skip to content

Commit

Permalink
Merge branch 'fix-mesh-for-new-PETSc' into 'development'
Browse files Browse the repository at this point in the history
mesh works again for PETSc >= 3.19

Closes #320

See merge request damask/DAMASK!843
  • Loading branch information
dmentock committed Nov 6, 2023
2 parents 51526b6 + bb23493 commit 8ff6e28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/mesh/FEM_quadrature.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ module FEM_quadrature
-1.0_pREAL, 1.0_pREAL, -1.0_pREAL, &
-1.0_pREAL, -1.0_pREAL, 1.0_pREAL], shape=[3,4])

type :: group_real !< variable length datatype
type :: group_real !< variable length datatype
real(pREAL), dimension(:), allocatable :: p
end type group_real

integer, dimension(2:3,maxOrder), public, protected :: &
integer, dimension(2:3,maxOrder), public, protected :: &
FEM_nQuadrature !< number of quadrature points for spatial dimension(2-3) and interpolation order (1-maxOrder)
type(group_real), dimension(2:3,maxOrder), public, protected :: &
type(group_real), dimension(2:3,maxOrder), public, protected :: &
FEM_quadrature_weights, & !< quadrature weights for each quadrature rule
FEM_quadrature_points !< quadrature point coordinates (in simplical system) for each quadrature rule

Expand Down
5 changes: 3 additions & 2 deletions src/mesh/FEM_utilities.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/mesh/mesh_mech_FEM.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ff6e28

Please sign in to comment.