# Error with PETSC, stopping at reading finite element mesh - PyLith 3.0.3

**URL:** <https://community.geodynamics.org/t/error-with-petsc-stopping-at-reading-finite-element-mesh-pylith-3-0-3/3198>\
**Category:** PyLith\
**Tags:** mesh\
**Created:** [December 6, 2023, 9:48pm UTC](https://community.geodynamics.org/t/error-with-petsc-stopping-at-reading-finite-element-mesh-pylith-3-0-3/3198 "2023-12-06T21:48:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iclemus](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/iclemus/32/1752_2.png) [@iclemus](https://community.geodynamics.org/u/iclemus)\
**Post date:** [December 6, 2023, 9:48pm UTC](https://community.geodynamics.org/t/error-with-petsc-stopping-at-reading-finite-element-mesh-pylith-3-0-3/3198/1 "2023-12-06T21:48:28Z")

</div>

Hi all, I am a new user and started by adapting the 2D subduction zone example with Slab 2.0 data and imposing an intraslab fault within my slab. As I’m running my simulation .cfg file to prescribe normal faulting (left-lateral slip on my intraslab fault) pylith is breaking when reading the finite element mesh (triangular mesh). I am prescribing Dirichlet boundary conditions on 3 of my 4 boundaries (x positive, x negative, and negative). I received this long error and am unsure how to fix this, any feedback and help is greatly appreciated. Thank you for your time.

“[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------  
[0]PETSC ERROR: No support for this operation for this object type  
[0]PETSC ERROR: Could not determine Plex facet for Gmsh element 438 (Plex cell 109512)  
[0]PETSC ERROR: See [FAQ — PETSc 3.20.2 documentation](https://petsc.org/release/faq/) for trouble shooting.  
[0]PETSC ERROR: Petsc Development GIT revision: v3.18.0-56-g437e83fba6f GIT Date: 2022-10-12 17:01:26 -0400  
[0]PETSC ERROR: /Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/bin/mpinemesis on a named Isis-MacBook-Pro.local by IsisLemus Wed Dec 6 10:58:35 2023  
[0]PETSC ERROR: Configure options --prefix=/Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/dist --with-c2html=0 --with-x=0 --with-clanguage=C --with-mpicompilers=1 --with-shared-libraries=1 --with-64-bit-points=1 --with-large-file-io=1 --download-chaco=1 --download-f2cblaslapack=1 --download-ml --with-fc=0 --with-hwloc=0 --with-ssl=0 --with-x=0 --with-c2html=0 --with-lgrind=0 --with-hdf5=1 --with-zlib=1 --LIBS=-lz --with-debugging=0 --with-fc=0 CFLAGS=”-g -O2" CXXFLAGS=“-g -O2 -DMPICH\_IGNORE\_CXX\_SEEK” FCFLAGS= CPPFLAGS=“-I/Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/dist/include -I/Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/dist/include” LDFLAGS=“-L/Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/dist/lib -L/Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/dist/lib” PETSC\_DIR=/Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/build/cig/petsc-pylith PETSC\_ARCH=arch-pylith  
[0]PETSC ERROR: #1 DMPlexCreateGmsh() at /Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/build/cig/petsc-pylith/src/dm/impls/plex/plexgmsh.c:1703  
[0]PETSC ERROR: #2 DMPlexCreateGmshFromFile() at /Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/build/cig/petsc-pylith/src/dm/impls/plex/plexgmsh.c:1433  
[0]PETSC ERROR: #3 DMPlexCreateFromFile() at /Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/build/cig/petsc-pylith/src/dm/impls/plex/plexcreate.c:5163Fatal error. Calling MPI\_Abort() to abort PyLith application.  
Traceback (most recent call last):  
File “/Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/lib/python3.10/site-packages/pylith/apps/PetscApplication.py”, line 61, in onComputeNodes  
self.main(\*args, \*\*kwds)  
File “/Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/lib/python3.10/site-packages/pylith/apps/PyLithApp.py”, line 97, in main  
mesh = self.mesher.create(self.problem, interfaces)  
File “/Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/lib/python3.10/site-packages/pylith/topology/MeshImporter.py”, line 78, in create  
mesh = self.reader.read(self.debug)  
File “/Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/lib/python3.10/site-packages/pylith/meshio/MeshIOObj.py”, line 58, in read  
ModuleMeshIO.read(self, mesh)  
File “/Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/lib/python3.10/site-packages/pylith/meshio/meshio.py”, line 153, in read  
return \_meshio.MeshIO\_read(self, mesh)  
RuntimeError  
[0]PETSC ERROR: #4 DMPlexCreateFromOptions\_Internal() at /Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/build/cig/petsc-pylith/src/dm/impls/plex/plexcreate.c:3592  
[0]PETSC ERROR: #5 DMSetFromOptions\_Plex() at /Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/build/cig/petsc-pylith/src/dm/impls/plex/plexcreate.c:3863  
[0]PETSC ERROR: #6 DMSetFromOptions() at /Users/baagaard/scratch/build/clang-13.0/cig/pylith-binary/build/cig/petsc-pylith/src/dm/interface/dm.c:915  
[0]PETSC ERROR: #7 virtual void pylith::meshio::MeshIOPetsc::\_read()() at …/…/…/pylith-3.0.3/libsrc/pylith/meshio/MeshIOPetsc.cc:123  
Abort(-1) on node 0 (rank 0 in comm 0): application called MPI\_Abort(MPI\_COMM\_WORLD, -1) - process 0  
: Error detected while in PETSc function.  
/Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/bin/nemesis: mpiexec: exit 255  
/Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/bin/pylith: /Users/IsisLemus/pylith/pylith-3.0.3-macOS-10.15-x86\_64/bin/nemesis: exit 1"

---

<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 6, 2023, 10:15pm UTC](https://community.geodynamics.org/t/error-with-petsc-stopping-at-reading-finite-element-mesh-pylith-3-0-3/3198/2 "2023-12-06T22:15:23Z")

</div>

From your output it looks like this error is generated when the Gmsh information is being used to populate the PETSc mesh data structures (DMPlex). The error is probably in how you are generating the mesh. Please provide a diagram of the boundary value problem you are trying to solve and the Python script used to generate the mesh.

---

<div class="post-metadata">

**Author:** ![iclemus](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/iclemus/32/1752_2.png) [@iclemus](https://community.geodynamics.org/u/iclemus)\
**Post date:** [December 7, 2023, 9:00pm UTC](https://community.geodynamics.org/t/error-with-petsc-stopping-at-reading-finite-element-mesh-pylith-3-0-3/3198/3 "2023-12-07T21:00:50Z")

</div>

Hi Brad,

I have attached the boundary value problem below and the generating mesh code. For context, I’m modeling potential precursory deformation occurring before the Tohoku earthquake. Here I’m modeling 52cm of normal offset at depth (240-340 km). I’m focusing on what displacements these mechanisms are producing but because this is still during the interseismic period before Tohoku, should I incorporate displacement rates into my slab boundary conditions like in the subduction zone 2D example step 2 (quasistatic interseismic deformation)? The upload function here doesn’t allow me to upload .py files, [here is a link to the .py file](https://drive.google.com/file/d/1lHZanuW9FX46rx54HCUUCJjL4WW2_sz7/view?usp=share_link).  
[Boundary\_value\_problem .pdf](https://community.geodynamics.org/uploads/short-url/rI9l4QWVRiVH9S65yw4IYDcA4Mj.pdf) (615.3 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 15, 2023, 9:56pm UTC](https://community.geodynamics.org/t/error-with-petsc-stopping-at-reading-finite-element-mesh-pylith-3-0-3/3198/4 "2023-12-15T21:56:37Z")

</div>

I think I may have found the issue. If you look at a coarse mesh (minimum discretization size of 20 km), you will see the mesh does not honor the fault interface cutting the slab in two. That is, the slab is not subdivided by the fault that cuts through the slab. You need to create two separate curve loops and surfaces, one for each piece of the slab. You can still create a single material for the slab, but it needs to be composed of two surfaces.

Sorry for the delay. I have been very busy finishing a PyLith release (will come out in the next day or so).
