# PetSC issue when running the coseismic slip generated from fault dislocation

**URL:** <https://community.geodynamics.org/t/petsc-issue-when-running-the-coseismic-slip-generated-from-fault-dislocation/3435>\
**Category:** PyLith\
**Created:** [May 4, 2024, 9:26am UTC](https://community.geodynamics.org/t/petsc-issue-when-running-the-coseismic-slip-generated-from-fault-dislocation/3435 "2024-05-04T09:26:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjmarfito](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@bjmarfito](https://community.geodynamics.org/u/bjmarfito)\
**Post date:** [May 4, 2024, 9:26am UTC](https://community.geodynamics.org/t/petsc-issue-when-running-the-coseismic-slip-generated-from-fault-dislocation/3435/1 "2024-05-04T09:26:48Z")

</div>

I’m running into an PetSC issue when running the coseismic slip problem generated from fault dislocation.

Attached herewith is the zip file containing the files I used to run the problem.

I used the following command: pylith coseismic\_slip.cfg  
[fault-3d.zip](https://community.geodynamics.org/uploads/short-url/74y3a44SKovoVAsprC2g5YvEULO.zip) (86.0 KB)

---

<div class="post-metadata">

**Author:** ![bjmarfito](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@bjmarfito](https://community.geodynamics.org/u/bjmarfito)\
**Post date:** [May 6, 2024, 2:11am UTC](https://community.geodynamics.org/t/petsc-issue-when-running-the-coseismic-slip-generated-from-fault-dislocation/3435/2 "2024-05-06T02:11:23Z")

</div>

Attaching here is error log file.  
[process.log](https://community.geodynamics.org/uploads/short-url/avMzDOTF61VwCCxsFRjWF7AmnlV.log) (21.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:** [May 6, 2024, 2:15pm UTC](https://community.geodynamics.org/t/petsc-issue-when-running-the-coseismic-slip-generated-from-fault-dislocation/3435/3 "2024-05-06T14:15:41Z")

</div>

The zero pivot error means that the Jacobian of the linear system of equations has a null space. In other words, the system of equations allows rigid body translation or rotation. In your case, you do not have any constraints on the z degree of freedom. I recommend adding a boundary condition on the bottom of your domain to constrain the z degree of freedom (DOF=2).

---

<div class="post-metadata">

**Author:** ![bjmarfito](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@bjmarfito](https://community.geodynamics.org/u/bjmarfito)\
**Post date:** [May 7, 2024, 2:20am UTC](https://community.geodynamics.org/t/petsc-issue-when-running-the-coseismic-slip-generated-from-fault-dislocation/3435/4 "2024-05-07T02:20:47Z")

</div>

Hi @baagaard, thank you for your suggestion. I added a bottom boundary condition of zero based on your suggestion. However, the error still exists.

Attaching the modified cfg and log files for your reference, please.  
[process\_2.log](https://community.geodynamics.org/uploads/short-url/ehtM1HXIgMAtcVKw7GcEuy3c5YA.log) (22.0 KB)  
[pylithapp.cfg](https://community.geodynamics.org/uploads/short-url/iCavZzZ33MQxjMs1sXD5d3UuMNT.cfg) (6.1 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:** [May 9, 2024, 3:32pm UTC](https://community.geodynamics.org/t/petsc-issue-when-running-the-coseismic-slip-generated-from-fault-dislocation/3435/5 "2024-05-09T15:32:26Z")

</div>

The other source of the zero pivot error is if the mesh contains a vertex that is not actually in a cell. We are working on adding a check for this into PETSc. In the meantime, I recommend reviewing your Python script that generates the mesh to look for any places where you are adding entities and making sure they all get attached to higher dimension objects. For example, perhaps you add a vertex that never gets used by a curve or a curve that never gets used by a surface.

---

<div class="post-metadata">

**Author:** ![bjmarfito](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@bjmarfito](https://community.geodynamics.org/u/bjmarfito)\
**Post date:** [May 10, 2024, 9:29am UTC](https://community.geodynamics.org/t/petsc-issue-when-running-the-coseismic-slip-generated-from-fault-dislocation/3435/6 "2024-05-10T09:29:16Z")

</div>

Thank you @baagaard. I will look into it next week and will update you.
