Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] - <title>Is this a bug in this Example? #1209

Closed
zhangxiaoshuotttt opened this issue Mar 24, 2024 · 10 comments
Closed

🐛 [BUG] - <title>Is this a bug in this Example? #1209

zhangxiaoshuotttt opened this issue Mar 24, 2024 · 10 comments
Labels

Comments

@zhangxiaoshuotttt
Copy link

Description

@danielpeter @mnagaso Hello!

First of all, I want to express my gratitude for your example #1206 - it was really helpful. However, when I tried to move the source into the water (just like in an OBN geometry), I noticed some strange waves near the PML boundary. I used your original example, only adjusting the position of the source, without changing any other options. I observed some strange waves emanating from the boundary. Additionally, I am curious as to why all the waves are reflected from the sea bottom.
forward_image000000300
forward_image000002700
forward_image000003000

I then tried to only change the parameters L, H, and H_w, and the problem became even more apparent. Do you have any advice on why this happened? Thanks in advance!
forward_image000002000
forward_image000008000
forward_image000010000

By the way, I have a question regarding the internal settings(I define the meshes by interfaces.dat). The wavefield of the simulation is working well; however, when I try to obtain the shotgather, there seems to be an issue. When I set the sea bottom as flat, the shotgather seemed to work well. What could be causing this problem?
forward_image000002000
forward_image000004000
forward_image000006000
X_Water300m_Source10m_SEM
Y_Water300m_Source10m_SEM

Affected SPECFEM2D version

latest development version

Your software and hardware environment

compiler and MPI: intel

Reproduction steps

1. Go to 'EXAMPLES/Gmsh_example_CPML_MPI/DATA/SOURCE'
2. Change settings 'xs=20000.0','zs=18000.0'
3. Use data files '....'
4. See error

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

OS

Linux

@mnagaso
Copy link

mnagaso commented Mar 25, 2024

Hello @zhangxiaoshuotttt

Thank you very much for reporting this issue!
It must be an issue on the preparation of the external mesh files created with meshio in my notebook. Please let me check the details and will come back soon.

@zhangxiaoshuotttt
Copy link
Author

I found the reason why my shot-gather was poor - it was due to sparse receivers. After I made the receiver more dense, my shot gather improved.
X_Water300m_Source10m_SEM
Y_Water300m_Source10m_SEM

@mnagaso
Copy link

mnagaso commented Mar 26, 2024

Hi @zhangxiaoshuotttt

Thanks for your further check!

On my side, I made two modifications on:

  • wrong element/node ids in mesh files
  • add transition layer between pml and non-pml domain.
    which eliminated instability in PML layers.

You can check the updated scripts here.
https://github.com/mnagaso/specfem2d/tree/devel/EXAMPLES/Gmsh_example_CPML_MPI

I think flat case is ok with it. I continue with the topo example now.

Thanks again!

@mnagaso
Copy link

mnagaso commented Mar 29, 2024

Hi @zhangxiaoshuotttt

I made a pull request for modifying this error, at #1211
There was a mistake for defining the acoustic-elastic interface in the "topo" example, thus there was no transition of energy.

Thanks again for pointing this out!

@zhangxiaoshuotttt
Copy link
Author

@mnagaso Hello,

I apologize for the delayed response. Last week, I attempted to review your updated files and noticed some differences. Initially, I wanted to utilize your updated files to obtain correct results, but unfortunately, I was unsuccessful even when using the files updated yesterday.

 ************
  time loop
 ************
               scheme:         Newmark
 
            time step:   3.0000000E-03  s
 number of time steps:        10000
 total simulated time:    30.00000      seconds
 start time:  -1.200000      seconds
 

 =========================================
 =  T i m e  e v o l u t i o n  l o o p  =
 =========================================

 
 Starting time iteration loop ...
 
[MasterComputer:20874:0:20874] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x11b5c6b38)
==== backtrace (tid:  20874) ====
 0  /lib/x86_64-linux-gnu/libucs.so.0(ucs_handle_error+0x2e4) [0x10f483a71fc4]
 1  /lib/x86_64-linux-gnu/libucs.so.0(+0x24fec) [0x10f483a75fec]
 2  /lib/x86_64-linux-gnu/libucs.so.0(+0x251aa) [0x10f483a761aa]
 3  ./xspecfem2D() [0x4bdba2]
 4  ./xspecfem2D() [0x473e8b]
 5  ./xspecfem2D() [0x4e9128]
 6  ./xspecfem2D() [0x640992]
 7  ./xspecfem2D() [0x4053bd]
 8  /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x10f483829d90]
 9  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x10f483829e40]
10  ./xspecfem2D() [0x4052d5]
=================================
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
libc.so.6          000010F483842520  Unknown               Unknown  Unknown
xspecfem2D         00000000004BDBA2  Unknown               Unknown  Unknown
xspecfem2D         0000000000473E8B  Unknown               Unknown  Unknown
xspecfem2D         00000000004E9128  Unknown               Unknown  Unknown
xspecfem2D         0000000000640992  Unknown               Unknown  Unknown
xspecfem2D         00000000004053BD  Unknown               Unknown  Unknown
libc.so.6          000010F483829D90  Unknown               Unknown  Unknown
libc.so.6          000010F483829E40  __libc_start_main     Unknown  Unknown
xspecfem2D         00000000004052D5  Unknown               Unknown  Unknown
run_this_example.sh: 73: [[: not found

see results in directory: OUTPUT_FILES/

done

Allow me to elaborate on the details. I first attempted to test your notebook but encountered an error. I then downloaded all the files within the Mesh and Data folders and ran run_this_example.sh, but I still encountered the same error. However, running another example, such as the previous version, worked without issue.

Despite my efforts to troubleshoot, I could not pinpoint a specific error from the descriptions provided. I apologize for needing to reach out to you again.

Additionally, please note that if we use xcheck_quality_external_mesh, we may encounter another error indicating a negative Jacobian.

Please accept my gratitude for your time and patience,
Warm regards.
Thank you.

@mnagaso
Copy link

mnagaso commented Mar 30, 2024

Hi @zhangxiaoshuotttt,

Thank you very much for trying this update. After making the last commit, I noticed that there requires further modification on the creation of surf/abs files, which was writing out a wrong node ids.

My latest pull request #1212 contains the corrected script for mesh conversion, thus you can run the example jupyter notebooks and will output:

forward_image000007800

Thank you very much again for your signaling this issue,

@zhangxiaoshuotttt
Copy link
Author

@mnagaso Hi,

I am grateful for the time and effort you have dedicated to assisting me. Your recent updates have been helpful, and I have been trying to learn from them to understand better the root causes of the issues I have been experiencing.

May I ask you another question? When I only changed the source position(30000, 18000), all boundaries were set as PML. Do you notice the waves I circled? I am unsure about their origin, and I would appreciate any advice you can offer when you can.

Thank you once again for your unwavering patience and support.

Sincerely,
forward_image000000900
forward_image000001200
forward_image000001500
forward_image000001800
forward_image000002100
forward_image000002400
forward_image000002700
forward_image000003000
forward_image000003300
forward_image000003600
forward_image000003900
forward_image000004200
forward_image000004500
forward_image000004800
forward_image000005100
forward_image000005400
forward_image000005700
forward_image000006000
forward_image000006300
forward_image000006600
forward_image000006900
forward_image000007200
forward_image000007500
forward_image000007800
forward_image000008100
forward_image000008400
forward_image000008700
forward_image000009000
forward_image000009300
forward_image000009600
forward_image000009900

@mnagaso
Copy link

mnagaso commented Mar 31, 2024

Hi @zhangxiaoshuotttt

This is because the element size of the created mesh is a bit too large to avoid this kind of numerical artifacts.
In the first cell of the jupyter notebook, if you put the element size a bit smaller then these artifacts can be reduced, e.g.,

    # test size in meter 
    lc_w = 0.25 * 1000
    lc_g = 0.200 * 1000

    if use_cpml:
        # pml layer thickness
        n_elm_pml = 6
        # use lc_g instead of lc_w for pml layer because lc_g < lc_w
        pml = lc_g * n_elm_pml

then you will have a bit cleaner images.

It is useful to visualize mesh.xdmf with Paraview to check the created mesh.

Thanks!

@zhangxiaoshuotttt
Copy link
Author

That works well. I truly appreciate your help. This example helped me learn a lot. Thanks again for your time and patience.

@mnagaso
Copy link

mnagaso commented Mar 31, 2024

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants