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
191 stars 147 forks source link

Example fluid_solid/fluid_solid_external_mesh broken #190

Closed luet closed 9 years ago

luet commented 9 years ago

See nightly build 24. I just reran it and the second column (I assume they are the displacements) in the *.semd files are basically 0. It looks like it's one of the commits: 38bc26f9f99e6 or 7c31a4342116 from @EtienneBachmann broke it.

This problem brought up another issue that we need to explore: the correlation test didn't detect the difference (min(corr)=9.99999e-01), the least square one did (max(err)=4.74344e+04). So there is a problem with the correlation test in CompareSeismo that needs to be fixed. I'll look into it but I'd appreciate input.

Thanks, David

komatits commented 9 years ago

Hi Etienne,

when you have time could you have a look at that example to see where the small problem is? (it could be the variables declared locally that you fixed in other routines or something like that I guess; if so, probably easy to fix).

To all: Etienne has done a great and very useful job cleaning the structure of the 2D code and making it much closer to that of the 3D code (using modules instead of long parameter lists and so on). We'll see a few side effects such as this one for a few days but then once these small problems are fixed we will have a much cleaner and much more flexible code!

Thanks a lot, Best wishes,

Dimitri.

On 01/22/2015 04:19 PM, David Luet wrote:

See nightly build 24 http://specfem2d-buildbot.princeton.edu/builders/specfem2d_nightly/builds/24/steps/fluid_solid_external_mesh/logs/stdio. I just reran it and the second column (I assume they are the displacements) in the *.semd files are basically 0. It looks like it's one of the commits: 38bc26f https://github.com/geodynamics/specfem2d/commit/38bc26f9f99e606ce505a1d3f0031022f483e363 or 7c31a43 https://github.com/geodynamics/specfem2d/commit/7c31a43421168245c948c8e084d11e5a2b4b09d2 from @EtienneBachmann https://github.com/EtienneBachmann broke it.

This problem brought up another issue that we need to explore: the correlation test didn't detect the difference (min(corr)=9.99999e-01), the least square one did (max(err)=4.74344e+04). So there is a problem with the correlation test in CompareSeismo https://github.com/luet/CompareSeismo that needs to be fixed. I'll look into it but I'd appreciate input.

Thanks, David

— Reply to this email directly or view it on GitHub https://github.com/geodynamics/specfem2d/issues/190.

Dimitri Komatitsch CNRS Research Director (DR CNRS), Laboratory of Mechanics and Acoustics, UPR 7051, Marseille, France http://komatitsch.free.fr

QuLogic commented 9 years ago

@luet CompareSeismo uses np.corrcoef which calculates the correlation coefficient matrix. Maybe you wanted np.correlate for cross-correlations? Though I would expect the minimum to be always nearly zero there, so maybe not?

EtienneBachmann commented 9 years ago

I took a look at the seismograms, they are not 0 but they are close (around 1e-11). This is due to the fact we change the way we set the acoustic pressure source, dividing them by kappa of the fluid, that is usually around 1e9 or 1e10. This results in dividing the absolute amplitude in the seismogram by the same quantity. Notice that the current source of the problem is 1e4 pascals, it seems good that a displacment recorded kilometers away becomes really weak.

komatits commented 9 years ago

You are right! good point.

This is the first example we get in which it is then the reference seismograms that are not OK any more (since we fixed the problem in the amplitude of the acoustic source) and the new seismograms are OK.

Let me thus change the reference seismograms manually, I will do that later today.

Thanks! Dimitri.

On 01/22/2015 07:36 PM, EtienneBachmann wrote:

I took a look at the seismograms, they are not 0 but they are close (around 1e-11). This is due to the fact we change the way we set the acoustic pressure source, dividing them by kappa of the fluid, that is usually around 1e9 or 1e10. This results in dividing the absolute amplitude in the seismogram by the same quantity. Notice that the current source of the problem is 1e4 pascals, it seems good that a displacment recorded kilometers away becomes really weak.

— Reply to this email directly or view it on GitHub https://github.com/geodynamics/specfem2d/issues/190#issuecomment-71072851.

Dimitri Komatitsch CNRS Research Director (DR CNRS), Laboratory of Mechanics and Acoustics, UPR 7051, Marseille, France http://komatitsch.free.fr

komatits commented 9 years ago

Hi all,

I think the best (or at least easiest) thing to do would be to compute the waveform misfit. Below is an old email from Jeroen with the formula to use.

Best wishes, Dimitri.

Subject: Re: SPECFEM3D in buildbot From: Jeroen Tromp Date: Mon, 14 Jul 2008 16:17:18 -0700 To: Leif Strand CC: Mike Gurnis, Dimitri Komatitsch, Vala Hjorleifsdottir, Brian Savage, Anne Sieminski, Qinya Liu, Luis Armendariz

Hi Leif:

OK, that sounds like what we need.

One good measure of failure, along the lines of what Dimitri was suggesting, would be to calculate the waveform misfit, e.g.,

sum_i int [ref_i(t) - run_i(t)]^2 dt / sum_i int [ref_i(t)]^2 dt

where i is a seismogram label, ref_i is the ith reference seismogram (1D or 3D), and run_i is the result based upon the current svn version. We could do this separately for the vertical, radial and transverse components to get a bit more information.

Jeroen

On 01/22/2015 07:34 PM, Elliott Sales de Andrade wrote:

@luet https://github.com/luet CompareSeismo uses |np.corrcoef| which calculates the correlation coefficient matrix. Maybe you wanted |np.correlate| for cross-correlations?

— Reply to this email directly or view it on GitHub https://github.com/geodynamics/specfem2d/issues/190#issuecomment-71072586.

Dimitri Komatitsch CNRS Research Director (DR CNRS), Laboratory of Mechanics and Acoustics, UPR 7051, Marseille, France http://komatitsch.free.fr

komatits commented 9 years ago

I think that's what I do in what I call "least square error": https://github.com/luet/CompareSeismo#usage Except that the denominator is (||ref|| ||syn||) instead of (||ref||^2) and I end up taking square roots, since I use norms, which I can change if it matters. I'll look into the correlation later. Best, David

On Thu, Jan 22, 2015 at 2:22 PM, Dimitri Komatitsch < komatitsch@lma.cnrs-mrs.fr> wrote:

Hi all,

I think the best (or at least easiest) thing to do would be to compute the waveform misfit. Below is an old email from Jeroen with the formula to use.

Best wishes, Dimitri.

Subject: Re: SPECFEM3D in buildbot From: Jeroen Tromp Date: Mon, 14 Jul 2008 16:17:18 -0700 To: Leif Strand CC: Mike Gurnis, Dimitri Komatitsch, Vala Hjorleifsdottir, Brian Savage, Anne Sieminski, Qinya Liu, Luis Armendariz

Hi Leif:

OK, that sounds like what we need.

One good measure of failure, along the lines of what Dimitri was suggesting, would be to calculate the waveform misfit, e.g.,

sum_i int [ref_i(t) - run_i(t)]^2 dt / sum_i int [ref_i(t)]^2 dt

where i is a seismogram label, ref_i is the ith reference seismogram (1D or 3D), and run_i is the result based upon the current svn version. We could do this separately for the vertical, radial and transverse components to get a bit more information.

Jeroen

On 01/22/2015 07:34 PM, Elliott Sales de Andrade wrote:

@luet https://github.com/luet CompareSeismo uses |np.corrcoef| which calculates the correlation coefficient matrix. Maybe you wanted |np.correlate| for cross-correlations?

— Reply to this email directly or view it on GitHub https://github.com/geodynamics/specfem2d/issues/ 190#issuecomment-71072586.

Dimitri Komatitsch CNRS Research Director (DR CNRS), Laboratory of Mechanics and Acoustics, UPR 7051, Marseille, France http://komatitsch.free.fr

David Luet Linux Administrator/Software & Programming Analyst Department of Geosciences & PICSciE Princeton University

EtienneBachmann commented 9 years ago

I plotted the old and new seismograms, there is a bug : they behave the same, except that the new seismogram stays at the same value during 100 steps ( the duration between 2 jpeg pictures). Jpeg imaging and write_seismogram both call a routine «compute_vector_field» to get the displacement in acoustic media and it must be a wrong interaction between those calls. Unfortunatly for today, I got ejected of my lab office by the last teacher and i can t fix it by now! I ll do that as soon as I can.

komatits commented 9 years ago

Fixed by @EtienneBachmann