SPECFEM / specfem3d

SPECFEM3D_Cartesian simulates acoustic (fluid), elastic (solid), coupled acoustic/elastic, poroelastic or seismic wave propagation in any type of conforming mesh of hexahedra (structured or not).
GNU General Public License v3.0
390 stars 223 forks source link

🐛 [BUG] - meshfem3D fails when using tomographic files #1627

Closed eyalshimony closed 7 months ago

eyalshimony commented 11 months ago

Description

meshfem3D fails (floating points exception) when the materials section in Mesh_Par_file contain only tomographic materials. As far as I understand, it is caused by VP_MAX being 0 in line 549 in check_mesh_quality.f90. This is caused by lines 150-159 in create_meshfem_mesh.f90, in which VP_MAX is set by inspecting the Vp value in regular materials only, and not in tomographic materials. Therefore, if no regular materials are set, Vp remains 0.

Affected SPECFEM3D version

Current

Your software and hardware environment

CentOS 7 server, gcc version 4.8.5, MPI Library for Linux* OS, Version 2021.1

Reproduction steps

1. In the materials section of Mesh_Par_file, write the only material as a tomographic one, for example:
-1 tomography elastic tomography_model.xyz 0 2
2. Run meshfem3D
3. The resulting error is "Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.", which I believe is caused by division by 0 as explained in the description part.

Screenshots

No response

Logs

No response

OS

Linux

danielpeter commented 7 months ago

this seems to be fixed since commit c2f639a - can you try again with the most recent devel version?

eyalshimony commented 7 months ago

It works with the latest devel version, thanks!