SPECFEM / specfem2d

SPECFEM2D simulates forward and adjoint seismic wave propagation in two-dimensional acoustic, (an)elastic, poroelastic or coupled acoustic-(an)elastic-poroelastic media, with Convolution PML absorbing conditions.
GNU General Public License v3.0
195 stars 146 forks source link

Error when using tomo model #1041

Open chailihui04 opened 5 years ago

chailihui04 commented 5 years ago

Dear Developer

I got a problem when using tomo model. I had a tomo_file.xyz with x, z, rho, vp, vs, and all vs are zeros to do full acoustic simulation. Orignially I set in nbmodels 1 -1 0 A 0 0 0 0 0 0 0 0 0 0 0 The code only works if set STACEY_ABSORBING_CONDITIONS to .false. otherwise I got error Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation. It traces back to invert_mass_matrix.F90 line 737 where sqrt is taken to a negative num.

From the doc, to set a tomo model, it should be
1 -1 0 0 A 0 0 0 0 0 0 0 0 0 0 for whatever values of A that I tried, I got error Error: non acoustic material in DATA/Par_file or external mesh redefined as acoustic in define_external_model() or incorrect value of Poisson's ratio

Any suggestion?

Thanks, Lihui

chailihui04 commented 5 years ago

Maybe this is a bug. I checked the code in invert_mass_matrix.F90 and it seems to me that line 736 only useful for assign_external_model=.false., but for some reason that I don't know when assign_external_model=.true. kappal_relaxed could be a negative num, which causes the error. So I change it to if(.not. assign_external_model) then cpl = sqrt(kappal_relaxed/rhol) endif Simiar issue in compute_stacey_acoustic.f90 line 90. After these changes, it works for my simple test. I'm not sure if these make sense, and I appreciate if there are any suggestions. Thanks, Lihui

bottero commented 5 years ago

Sorry for the delay, You are right, there is an error in the doc. It should be: 1 -1 9999 9999 A 0 0 9999 9999 0 0 0 0 0 0 and not: 1 -1 0 A 0 0 0 0 0 0 0 0 0 0 0 I will commit the change Thank you

kaigaox commented 5 years ago

I think you can probably set it to 1 -1 1 1 1 0 0 ...

pasansherath commented 4 years ago

I have been trying to use an external tomographic model for my simulations. @chailihui04, Could you kindly upload your sample tomo.xyz and Par_file files?

@bottero @chailihui04 , Is there anyway to implement tomography for more than one model in the simulation? When I tried to run with multiple models retrieving their velocities and densities from an external x z Vp Vp Rho file, xmeshfem2D threw an error saying that only one model can have velocities from a tomography file.

I read in the Specfem3D manual, that this possible using a _nummaterialfile. But I can't simply understand how to implement it in Specfem2D.

If you have an example file, could you share it?

Thanks very much.