Skip to content

Commit a87df54

Browse files
committed
intermediate commit
1 parent 14f422d commit a87df54

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

examples/gradient_2D.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
spacing = 10
1212

1313
# space order
14-
space_order = 8
14+
space_order = 4
1515

1616
# dtype
1717
dtype = np.float32
@@ -20,7 +20,7 @@
2020
propagation_time = 0.5
2121

2222
# time step variation
23-
dt = 0.001;
23+
dt = 0.001
2424

2525
# compiler options
2626
compiler_options = {
@@ -74,7 +74,8 @@ def create_solver(saving_stride, velocity_model):
7474
# config boundary conditions
7575
# (none, null_dirichlet or null_neumann)
7676
space_model.config_boundary(
77-
damping_length=(damping, damping, damping, damping),
77+
#damping_length=(damping, damping, damping, damping),
78+
damping_length=10,
7879
boundary_condition=(
7980
"null_neumann", "null_dirichlet",
8081
"null_dirichlet", "null_dirichlet"
@@ -96,14 +97,15 @@ def create_solver(saving_stride, velocity_model):
9697
# create the set of sources
9798
source = Source(
9899
space_model,
99-
coordinates=[(domain_size//2, 40)],
100+
coordinates=[(20, domain_size//2)],
100101
window_radius=4
101102
)
102103

103104
# crete the set of receivers
104105
receiver = Receiver(
105106
space_model=space_model,
106-
coordinates=[(i, domain_size-40) for i in range(0, domain_size, 10)],
107+
#coordinates=[(domain_size-20, i) for i in range(0, domain_size, 10)],
108+
coordinates=[(domain_size-20, i) for i in np.linspace(0, domain_size, num=101)],
107109
window_radius=4
108110
)
109111

@@ -127,7 +129,9 @@ def calculate_true_seimogram(velocity_model):
127129
# true model solver
128130
solver = create_solver(saving_stride=0, velocity_model=velocity_model)
129131

130-
u_true, recv_true = solver.forward()
132+
u_true, recv_true = solver.forward()
133+
134+
print("Shape u", u_true.shape)
131135

132136
plot_velocity_model(solver.space_model.velocity_model,
133137
sources=solver.sources.grid_positions,
@@ -182,12 +186,12 @@ def camembert_velocity_model(grid_size, radius):
182186

183187
if __name__ == "__main__":
184188

185-
grid_size = domain_size // spacing
189+
grid_size = domain_size // spacing + 1
186190

187191
# True velocity model
188192
# Camembert model
189193
tru_vel = camembert_velocity_model(grid_size, radius=15)
190-
194+
191195
# Smooth velocity model
192196
smooth_vel = np.zeros(shape=(grid_size, grid_size), dtype=dtype)
193197
smooth_vel[:] = 2000

0 commit comments

Comments
 (0)