Error face midpoint problem


Dear all,

I’m trying to run a model with topology and CPML in SPECFEM3D_Cartesian.But some problems came to me when I was run database generation. The error is as follow:

error element face midpoint distance : 6.640625E-02 594.957275

error corner: 1 xyz 523625.188 3602220 1297.69434

error corner: 2 xyz 523644.656 3602220.25 1283.00208

error corner: 3 xyz 523637 3602199.50 1275.03577

error corner: 4 xyz 523617 3602199.25 1288.56860

xcoord : 523644.656 523625.188 523617.562 523637.438

ycoord : 3602220.25 3602220 3602199.25 3602199.50

zcoord : 1283.00208 1297.69434 1288.56860 1275.03577

STOP error element face midpoint.

This problem has been bothering me for a long time. Maybe the edge curve is too fluctuating? Could you please help me to figure out how to solve this problem?

I would really appreciate your help,


Zixuan Wan | Chengdu university of technology



I also have the same problem
when I mesh a very small scale mesh model,
for example 4x4km 192x192 maybe ok
but 256x256 I will receive the error like this
Does anyone know what’s this error mean?

I will be grateful for any help you can provide.




I am not an expert in the code, but have run into similar issues in the past (i.e., similar error invoking the element face midpoint distance). How I ultimately was able to get around the problem was by changing the TOL_DIST variable in specfem3d/src/shared/get_element_face.f90. This value is typically set to 1.e-4, which I found was too small for the higher resolution topography meshes I was building. Changing this value to 1.e-3 fixed the error and (seemingly) did not cause any instabilities in the code or my outputs.

So I would suggest trying to increase your TOL_DIST value, and seeing if that avoids the error.


1 Like