# SNESSolve has not converged

**URL:** <https://community.geodynamics.org/t/snessolve-has-not-converged/969>\
**Category:** PyLith\
**Created:** [December 16, 2019, 8:54am UTC](https://community.geodynamics.org/t/snessolve-has-not-converged/969 "2019-12-16T08:54:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangj](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zhangj](https://community.geodynamics.org/u/zhangj)\
**Post date:** [December 16, 2019, 8:54am UTC](https://community.geodynamics.org/t/snessolve-has-not-converged/969/1 "2019-12-16T08:54:25Z")

</div>

Dear everyone,

Recently,I am trying to simulate spontaneous rupture by RateStateAgeing,using my own 3D geometry model,but a PETSC error " SNESSolve has not converged" is always reported, so I read the _pylith-2.2.1\_manual_ for several times and test some parameters about PETSC Solver, for example, KSP absolute tolerance, zero\_tolerance and zero\_tolerance\_normal etc, but I still don’t solve the problem. My cfg file and error message are attached below.

How can I solve the problem? Thank you.[aseismic.cfg](https://community.geodynamics.org/uploads/short-url/1l9I6Ccip7fC7GRRO5Hi0vVZm2V.cfg) (7.8 KB) [pylith\_error.txt](https://community.geodynamics.org/uploads/short-url/A5cyAo6rmok5MjOpR1P3iDDHzDx.txt) (2.9 KB) [pylithapp.cfg](https://community.geodynamics.org/uploads/short-url/p2FzVigduCOzskNQ00ejno8ex5b.cfg) (6.7 KB)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [December 16, 2019, 4:35pm UTC](https://community.geodynamics.org/t/snessolve-has-not-converged/969/2 "2019-12-16T16:35:21Z")

</div>

Your solver tolerances are not setup to work for spontaneous rupture.

See the slides and video for the “2-D Subduction Zone: Fault Friction” tutorial from the [2017 Crustal Deformation Modeling Tutorial](https://wiki.geodynamics.org/software:pylith:cdm2017).

The important solver settings are

```auto
[pylithapp.problem.interfaces.fault]
# Iterative solver is not exact, so need threshold to detect nucleation of slip
zero_tolerance = 1.0e-9
# Suppress fault opening for near zero values
zero_tolerance_normal = 1.0e-9

[pylithapp . petsc]
# Linear solver tolerances
# Set rtol to very small value to force absolute convergence
ksp_rtol = 1.0e-20
# Must be smaller than the fault zero_tolerance
ksp_atol = 1.0e-10

# Nonlinear solver tolerances
# Set to very small value to force absolute convergence
snes_rtol = 1.0e-20
# Must be larger than fault zero_tolerance
snes_atol = 1.0e-8

friction_pc_type = asm
friction_sub_pc_factor_shift_type = nonzero

```

If you have a simulation with more than about 10k cells, then you will probably want to use better preconditioning, such as those given in `share/settings/solver_fault_fieldsplit.cfg`.

---

<div class="post-metadata">

**Author:** ![zhangj](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zhangj](https://community.geodynamics.org/u/zhangj)\
**Post date:** [December 17, 2019, 7:35am UTC](https://community.geodynamics.org/t/snessolve-has-not-converged/969/3 "2019-12-17T07:35:33Z")

</div>

Thank you, Brad,  
I have added solver tolerances to work for spontaneous rupture according to your accommendation, Actually I get my cfg files by modifying the 2D subduction example,using my own geometry model. What’s more,just as you said, my simulation is more than about 10k cells, so I have taken your advice and run the simulation as " pylith aseismic.cfg solver\_fault\_fieldsplit.cfg",but the error “SNESSolve has not converged” still exist.

Thank you for your help,  
Zhang Jian

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [December 18, 2019, 6:10pm UTC](https://community.geodynamics.org/t/snessolve-has-not-converged/969/4 "2019-12-18T18:10:09Z")

</div>

I suggest simplifying things one feature at a time to isolate what the problem is. Does the problem run (nonlinear solve converge with the desired solution) when you replace the spontaneous rupture (FaultCohesiveDyn) with prescibed slip (FaultCohesiveKin)? If so, what about with a simple static friction model?

The general workflow for debugging these problems is to start with something that works and add one simulation feature at a time until something doesn’t work and then figure out what is wrong with the settings for the additional feature of the simulation.

---

<div class="post-metadata">

**Author:** ![zhangj](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zhangj](https://community.geodynamics.org/u/zhangj)\
**Post date:** [December 20, 2019, 11:46am UTC](https://community.geodynamics.org/t/snessolve-has-not-converged/969/5 "2019-12-20T11:46:04Z")

</div>

Dear Brad,  
I ran the problem with prescibed slip and got appropriate outcome some time ago. Yesterday I tried the simulation with static friction model, but same error was reported. In addition, I know the spontaneous rupture problem in 3D subduction example step05 is not yet complete, so I modify some parameters about tolerance solver several times and then run, and get the same error that I mentioned earlier(using my own model). May I ask if you have finished 3D sunduction spontaneous rupture example that you can provide to me?

Thank you!

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [December 21, 2019, 12:25am UTC](https://community.geodynamics.org/t/snessolve-has-not-converged/969/6 "2019-12-21T00:25:46Z")

</div>

We have been focusing on finishing the release of PyLith v3.0.0. I doubt we will get around to adding the spontaneous rupture simulation to the 3-D subduction zone example until v3.1 when we add a new spontaneous rupture formulation.

If you provide more information about your problem setup (description of the problem you are trying to solve along with a diagram showing the general geometry) along with the complete log and input files, we might be able to help you diagnose the problem.

---

<div class="post-metadata">

**Author:** ![zhangj](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zhangj](https://community.geodynamics.org/u/zhangj)\
**Post date:** [December 21, 2019, 9:35am UTC](https://community.geodynamics.org/t/snessolve-has-not-converged/969/7 "2019-12-21T09:35:43Z")

</div>

Hoping to simulate the post-seismic process of a big earthquake(more than Mw 7.0), we build the simplest geometry model by Trelis , and the simulation of coseismic and prescibed slip have been completed. Now we plan to simulate afterslip about it, but the error keeps holding us back. Here are our updated files about the simulation(.exo geometry file, .cfg files and material file).Our simulation is very similar with the spontaneous rupture simulation(step06) to the 2-D subduction zone example,  
only something that are related with geometry model are modified.  
[Allfiles.zip](https://community.geodynamics.org/uploads/short-url/xIRbN9VjsNeZZsk6WA4YFjx0t45.zip) (617.5 KB)

Thank you!
