Skip to content

New fwi notebook overview#236

Open
Olender wants to merge 130 commits into
mainfrom
new_fwi_notebook_overview
Open

New fwi notebook overview#236
Olender wants to merge 130 commits into
mainfrom
new_fwi_notebook_overview

Conversation

@Olender

@Olender Olender commented Mar 16, 2026

Copy link
Copy Markdown
Member

No description provided.

"\n",
"**What is Full Waveform Inversion?**\n",
"\n",
"Classical FWI is an iterative PDE-constrained optimization process that minimizes a cost functional, such as, the difference between observed seismic data and synthetic data generated from a velocity model. The cost functional to be minimized varies depending on your desired FWI research. The process can involve:\n",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decidir exclusão ou não

"\n",
"Let's set up our FWI problem parameters. We'll use a higher-order mass-lumped triangular finite element method (degree 4) for better accuracy, and define our mesh, acquisition geometry, and time domain settings.\n",
"\n",
"For a better understanding of why we chose degree higher-oder mass lumped triangles, please look at the [spyro paper](https://doi.org/10.5194/gmd-15-8639-2022)."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line e adicionar citação em cima

Comment thread notebook_tutorials/fwi_tutorial.ipynb Outdated
"id": "c4fa09e3",
"metadata": {},
"source": [
"Let us define our mesh dimensions. These are the mesh dimonsions for the domain of interest and do not include any absorbing layers."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduzir tamanho de malha e local dos receptores e fontes

"Here we define the acquisition geometry, including the properties of the sources and receivers. \n",
"In this setup, we use **8 independent sources**.\n",
"\n",
"Since we are **not currently using source-encoding techniques** (only partially supported) nor a **supershot approach** (currently supported), each source requires a **fully independent forward propagation**. As a result, a total of **8 separate forward simulations** will be performed with this configuration.\n",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the source-encoding and supershot comments and add a seperate notebook explaining them

Comment thread notebook_tutorials/fwi_tutorial.ipynb Outdated
"For this reason, it is recommended to **parallelize in multiples of 8** to achieve better performance. \n",
"However, in the present case, the problem is solved **in serial**. The simulations are therefore executed sequentially, one after the other, with intermediate results stored in cache. These cached data are continuously overwritten or discarded between runs.\n",
"\n",
"I've also printed the source location value so you can see that create_transect creates a list of floats. The same is true for the receiver locations. Therefore, you can pass data to them directly, just remember that it has to be a list of floats."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduzir pra 4 fontes

"id": "44030540",
"metadata": {},
"source": [
"Let's add some Clayton-Engquist absorbing boundary conditions since they are local (without adding a pad), and therefore computationally cheap. For other more realistic cases we recommend using HABCs."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduzir

"id": "a409d9bb",
"metadata": {},
"source": [
"Here we define our time marching related parameters. Spyro is able to calculate the maximum stable timestep, but since this is outside of the scope of this tutorial we just set up a value we know will work. If youuse a time-step large enought that your problem becomes unstable you will receive an appropriate error."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduzir e colocar nota

Comment thread notebook_tutorials/fwi_tutorial.ipynb Outdated
"id": "dfee9c92",
"metadata": {},
"source": [
"Now we'll create the \"true\" velocity model that will generate our synthetic observed data. This model contains both circular and rectangular anomalies to create a little more complexity for the inversion challenge. I call this velocity model the Minas Cheese model. You will usually see in the literature a Camembert model consisting of only a circle, but since spyro's team is mostly Brazilian, we use the Brazilian Minas cheese model and take into account that in the 1700s gold used to be hidden inside Minas cheese wheels."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adicionar nota

Comment thread notebook_tutorials/fwi_tutorial.ipynb Outdated
"id": "dfee9c92",
"metadata": {},
"source": [
"Now we'll create the \"true\" velocity model that will generate our synthetic observed data. This model contains both circular and rectangular anomalies to create a little more complexity for the inversion challenge. I call this velocity model the Minas Cheese model. You will usually see in the literature a Camembert model consisting of only a circle, but since spyro's team is mostly Brazilian, we use the Brazilian Minas cheese model and take into account that in the 1700s gold used to be hidden inside Minas cheese wheels."

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicar o "observado"

" \"\"\"\n",
" \n",
" # Create FWI object for generating real data\n",
" fwi = spyro.FullWaveformInversion(dictionary=dictionary)\n",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rever o objeto real

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PAramos aqui

If True, output the velocity model to a pvd file for visualization.
Default is False.
dg_velocity_model : bool, optional
If True, use DG0 function space. Default is True.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHange default to False

@codecov

codecov Bot commented Mar 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.17259% with 86 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.10%. Comparing base (a7a5362) to head (7f3b6ff).
⚠️ Report is 540 commits behind head on main.

Files with missing lines Patch % Lines
spyro/utils/utils.py 37.77% 28 Missing ⚠️
spyro/meshing/meshing_functions.py 84.75% 25 Missing ⚠️
spyro/solvers/backward_time_integration.py 61.53% 10 Missing ⚠️
spyro/io/basicio.py 86.00% 7 Missing ⚠️
spyro/solvers/inversion.py 68.42% 6 Missing ⚠️
spyro/utils/velocity_to_grid.py 88.00% 3 Missing ⚠️
spyro/meshing/meshing_parameters.py 92.85% 2 Missing ⚠️
spyro/io/model_parameters.py 80.00% 1 Missing ⚠️
spyro/plots/plots.py 80.00% 1 Missing ⚠️
spyro/solvers/acoustic_wave.py 50.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
+ Coverage   78.34%   82.10%   +3.76%     
==========================================
  Files          74       75       +1     
  Lines        5228     5489     +261     
==========================================
+ Hits         4096     4507     +411     
+ Misses       1132      982     -150     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants