-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from Olender/issue_0041
New features of isotropic elastic wave propagator
- Loading branch information
Showing
45 changed files
with
1,717 additions
and
1,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ | |
*.hdf5 | ||
*.msh | ||
*.segy | ||
*.png | ||
*.vtk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
''' | ||
From Mohammad Mehdi Ghorbani's dissertation: | ||
https://www.teses.usp.br/teses/disponiveis/3/3152/tde-16032023-085210/pt-br.php | ||
''' | ||
import firedrake as fire | ||
import numpy as np | ||
import spyro | ||
|
||
L = 500 # [m] | ||
|
||
rho = 7850 # [kg/m3] | ||
lambda_in = 6.86e9 # [Pa] | ||
lambda_out = 9.88e9 # [Pa] | ||
mu_in = 3.86e9 # [Pa] | ||
mu_out = 5.86e9 # [Pa] | ||
|
||
smag = 1e6 | ||
freq = 2 # Central frequency of Ricker wavelet [Hz] | ||
hf = 90 # [m] | ||
hs = 100 # [m] | ||
source_locations = spyro.create_transect((-hf, 0.2*L), (-hf, 0.8*L), 3) | ||
receiver_locations = spyro.create_transect((-hs, 0), (-hs, L), 40) | ||
source_locations = [[-hf, 0.5*L]] | ||
|
||
time_step = 2e-4 # [s] | ||
final_time = 1.5 # [s] | ||
out_freq = int(0.01/time_step) | ||
|
||
n = 20 | ||
mesh = fire.RectangleMesh(n, n, 0, L, originX=-L, diagonal='crossed') | ||
z, x = fire.SpatialCoordinate(mesh) | ||
|
||
zc = 250 # [m] | ||
xc = 250 # [m] | ||
ri = 50 # [m] | ||
camembert = lambda v_inside, v_outside: fire.conditional( | ||
(z - zc) ** 2 + (x - xc) ** 2 < ri**2, v_inside, v_outside) | ||
|
||
d = {} | ||
|
||
d["options"] = { | ||
"cell_type": "T", | ||
"variant": "lumped", | ||
"degree": 4, | ||
"dimension": 2, | ||
} | ||
|
||
d["parallelism"] = { | ||
"type": "automatic", | ||
} | ||
|
||
d["mesh"] = { | ||
"user_mesh": mesh, | ||
} | ||
|
||
d["acquisition"] = { | ||
"source_type": "ricker", | ||
"source_locations": source_locations, | ||
"frequency": freq, | ||
"delay": 0, | ||
"delay_type": "time", | ||
"amplitude": np.array([0, smag]), | ||
#"amplitude": smag * np.eye(2), | ||
#"amplitude": smag * np.array([[0, 1], [-1, 0]]), | ||
"receiver_locations": receiver_locations, | ||
} | ||
|
||
d["synthetic_data"] = { | ||
"type": "object", | ||
"density": fire.Constant(rho), | ||
"lambda": camembert(lambda_in, lambda_out), | ||
"mu": camembert(mu_in, mu_out), | ||
"real_velocity_file": None, | ||
} | ||
|
||
d["time_axis"] = { | ||
"initial_time": 0, | ||
"final_time": final_time, | ||
"dt": time_step, | ||
"output_frequency": out_freq, | ||
"gradient_sampling_frequency": 1, | ||
} | ||
|
||
d["visualization"] = { | ||
"forward_output": True, | ||
"forward_output_filename": "results/forward_output.pvd", | ||
"fwi_velocity_model_output": False, | ||
"gradient_output": False, | ||
"adjoint_output": False, | ||
"debug_output": False, | ||
} | ||
|
||
d["absorving_boundary_conditions"] = { | ||
"status": True, | ||
"damping_type": "local", | ||
} | ||
|
||
wave = spyro.IsotropicWave(d) | ||
wave.set_mesh(user_mesh=mesh, mesh_parameters={}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
''' | ||
From Turkel et al. (2023): | ||
https://doi.org/10.1016/j.wavemoti.2022.103109 | ||
''' | ||
import numpy as np | ||
import spyro | ||
|
||
L = 2000 # Size of the edges of the cube [m] | ||
N = 5 # Number of elements in each direction | ||
h = L/N # Element size [m] | ||
|
||
c_p = 5000 # P-wave velocity [m/s] | ||
c_s = 2500 # S-wave velocity [m/s] | ||
rho = 1000 # Density [kg/m3] | ||
|
||
smag = 1e9 # Source magnitude | ||
freq = 1 # Source frequency [Hz] | ||
|
||
final_time = 2 | ||
time_step = 5e-4 | ||
out_freq = (0.01/time_step) | ||
|
||
print(f'Element size: {h} m') | ||
print(f'Cross time : {h/c_p} s') | ||
print(f'Time step : {time_step} s') | ||
|
||
d = {} | ||
|
||
d["options"] = { | ||
"cell_type": "T", | ||
"variant": "lumped", | ||
"degree": 3, | ||
"dimension": 3, | ||
} | ||
|
||
d["parallelism"] = { | ||
"type": "automatic", | ||
} | ||
|
||
d["mesh"] = { | ||
"Lz": L, | ||
"Lx": L, | ||
"Ly": L, | ||
"h": h, | ||
"mesh_file": None, | ||
"mesh_type": "firedrake_mesh", | ||
} | ||
|
||
d["acquisition"] = { | ||
"source_type": "ricker", | ||
"source_locations": [[-L/2, L/2, L/2]], | ||
"frequency": freq, | ||
"delay": 0, | ||
"delay_type": "time", | ||
"amplitude": np.array([smag, 0, 0]), | ||
"receiver_locations": [], | ||
} | ||
|
||
d["synthetic_data"] = { | ||
"type": "object", | ||
"density": rho, | ||
"p_wave_velocity": c_p, | ||
"s_wave_velocity": c_s, | ||
"real_velocity_file": None, | ||
} | ||
|
||
d["time_axis"] = { | ||
"initial_time": 0, | ||
"final_time": final_time, | ||
"dt": time_step, | ||
"output_frequency": out_freq, | ||
"gradient_sampling_frequency": 1, | ||
} | ||
|
||
d["visualization"] = { | ||
"forward_output": True, | ||
"forward_output_filename": "results/elastic_cube_3D.pvd", | ||
"fwi_velocity_model_output": False, | ||
"gradient_output": False, | ||
"adjoint_output": False, | ||
"debug_output": False, | ||
} | ||
|
||
d["absorving_boundary_conditions"] = { | ||
"status": True, | ||
"damping_type": "local", | ||
} | ||
|
||
wave = spyro.IsotropicWave(d) | ||
wave.set_mesh(mesh_parameters={'dx': h}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.