Poor residuals from PETSc iterative solver for 3D elasticity equation

Hello all,

I am experiencing poor residuals with my iterative solver in PETSc when solving the elasticity equation. I normally use -pc_gamg and -ksp_gmres, and I have not had issues with solving 3D meshes when my Young’s modulus was an arbitrary normalized value. Now, however, I cannot seem to achieve good residuals using realistic properties (MPa) and under an applied traction (kN) and steady state thermal load. I can only achieve good residuals when my load is much smaller (small traction and no thermal), but that does not satisfy the goal of my research. From my understanding, there is no apparent singularity in the [K] matrix, and finite element analysis should be feasible to solve given the units of the problem.

I have attached an example script with my formulation. I would appreciate any guidance on how I can solve the system of elasticity using an appropriate iterative solver in PETSc.

Thank you

Please consider:

  • using a lower -ksp_rtol, e.g., -ksp_rtol 1e-8 (default is 1e-5);
  • setting bs = 3 in your set(AFEA); command
  • switching to -ksp_pc_side right (default is left).

Does that give you a good enough solution?

Thanks, that is much better! If you don’t mind, what does adding bs=3 and switching to -ksp_pc_side right do that makes the solver perform better?

If you don’t mind, what does adding bs=3

It sets the blocksize, as strongly suggested by the https://petsc.org/release/docs/manualpages/PC/PCGAMG.html manual page “In order to obtain good performance for PCGAMG for vector valued problems you must call MatSetBlockSize() to indicate the number of degrees of freedom per grid point”.

switching to -ksp_pc_side right

Please refer to the https://petsc.org/release/docs/manualpages/PC/PCSide.html manual page.