# Solver Selection

**URL:** https://community.freefem.org/t/solver-selection/3251
**Category:** General Discussion
**Created:** [May 16, 2024, 10:01pm UTC](https://community.freefem.org/t/solver-selection/3251 "2024-05-16T22:01:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Walid](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/walid/32/2477_2.png) [@Walid](https://community.freefem.org/u/Walid)
#### Post date: [May 16, 2024, 10:01pm UTC](https://community.freefem.org/t/solver-selection/3251/1 "2024-05-16T22:01:16Z")

</div>

Hello All,

I have a basic question and looking forward have an answer or a guide

How to choose the correct solver for a problem ?  
or how to decide if I should use MUMPS or PETSc or other plugin  
the problem I am trying to solve consists of 4 PDE in two domain  
∇2V = −(Np − Nn − Ne)/ε0  
∂Ne/∂t+ ∇ · (Ne .We − De∇Ne) =Se  
∂Np/∂t+ ∇ · (Np .Wp− Dp∇Np) =Sp  
∂Nn/∂t+ ∇ · (Nn Wn− Dn∇Nn) =Sn

![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/3/37bd85d3a706ba07245d39b8ac69f7a4d7bd2a1a.png)

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [May 17, 2024, 5:02am UTC](https://community.freefem.org/t/solver-selection/3251/2 "2024-05-17T05:02:47Z")

</div>

Use PETSc, then you’ll be able to switch between all solvers seamlessly (exact LU or more advanced physics-based solvers or multigrid).

---

<div class="post-metadata">

### Author: ![thingway](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/thingway/32/2353_2.png) [@thingway](https://community.freefem.org/u/thingway)
#### Post date: [May 17, 2024, 6:06am UTC](https://community.freefem.org/t/solver-selection/3251/3 "2024-05-17T06:06:27Z")

</div>

Hi. I usual use the MUMPS for faster computations compare with UMFPACK, but it is empirical and i dont konw the principles under computaions. So there is a problem, how to understand “switch between all solvers seamlessly if using PETSc”? Additionally, using PETSC means we just need "load “PETSc”?

---

<div class="post-metadata">

### Author: ![Walid](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/walid/32/2477_2.png) [@Walid](https://community.freefem.org/u/Walid)
#### Post date: [May 17, 2024, 5:42pm UTC](https://community.freefem.org/t/solver-selection/3251/4 "2024-05-17T17:42:18Z")

</div>

Thank you for your reply and attention but how to decide which solver suits my problem  
or its just trails ?

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [May 17, 2024, 6:04pm UTC](https://community.freefem.org/t/solver-selection/3251/5 "2024-05-17T18:04:50Z")

</div>

> how to understand “switch between all solvers seamlessly if using PETSc”?

It means you should not have to change your code to try different solvers to find the best. E.g., if you want to use either MUMPS or UMFPACK, with PETSc, you just need the command line flag `-pc_factor_mat_solver_type mumps` (or `umfpack`), you don’t need to modify your code.
