Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
getdp
getdp
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 11
    • Issues 11
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • getdp
  • getdpgetdp
  • Wiki
  • Linear solvers

Linear solvers

Last edited by Christophe Geuzaine Mar 22, 2018
Page history

By default GetDP uses linear solvers from PETSc. (You can also compile GetDP with alternative linear solvers - see the GetDP documentation.) The choice of which particular linear solver to use for a given problem is handled directly through PETSc options, which can be specified:

  • on the command line (e.g. getdp test.pro -solve -ksp_type cg -pc_type ilu)
  • in the Resolution operations, with the SetGlobalSolverOptions[] function (e.g. SetGlobalSolverOptions["-ksp_type gmres -petsc_prealloc 400"];)
  • in a file :
    • either as default options in a .petscrc file in your home directory
    • or in an arbitrary file, specified to getdp with the -solver option (e.g. getdp test.pro -solve -solver "myoptions.txt")

Here are some useful PETSc options:

# To use GMRES+ILU(3) with a relative tolerance of 1e-12 and a restart of 300:
-ksp_rtol 1.e-12
-ksp_type gmres
-ksp_gmres_restart 300
-pc_type ilu
-pc_factor_levels 3
# To use PETSc's built-in direct LU solver
-ksp_type preonly
-pc_type lu
-pc_factor_mat_solver_package petsc
# To use the direct LU solver from UMFPACK
-ksp_type preonly
-pc_type lu
-pc_factor_mat_solver_package umfpack
# To use the direct LU solver from MUMPS
-ksp_type preonly
-pc_type lu
-pc_factor_mat_solver_package mumps
# To preallocate 300 nonzero elements per line in the matrix
-petsc_prealloc 300
# To see the residual
-ksp_monitor
# To use GMRES+Jacobi with a relative tolerance of 1e-12 and a restart of 100:
-ksp_rtol 1.e-12
-ksp_type gmres
-ksp_gmres_restart 100
-pc_type jacobi
-pc_factor_levels 3
Clone repository
  • Getdp compilation
  • Git cheat sheet
  • Integration in post processing
  • Linear solvers
  • Nonlinear solvers
  • Parser variables vs run time variables vs onelab parameters
  • Usage of tables
  • Home
More Pages
×

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.