Skip to content

Commit

Permalink
Lint modifications from issue 130
Browse files Browse the repository at this point in the history
  • Loading branch information
SouzaEM committed Nov 1, 2024
1 parent f542957 commit 83e95c4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spyro/examples/elastic_local_abc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import firedrake as fire
import numpy as np
import spyro

Expand All @@ -21,6 +20,7 @@
final_time = 2.0 # [s]
out_freq = int(0.01/time_step)


def build_solver(local_abc, dt_scheme):
d = {}

Expand Down Expand Up @@ -91,4 +91,4 @@ def build_solver(local_abc, dt_scheme):
wave = spyro.IsotropicWave(d)
wave.set_mesh(mesh_parameters={'dx': h})

return wave
return wave
2 changes: 1 addition & 1 deletion spyro/io/field_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ def log(self, t):
functional.sample()

def get(self, key):
return self.__enabled_functionals[key].list[-1]
return self.__enabled_functionals[key].list[-1]
2 changes: 1 addition & 1 deletion spyro/solvers/elastic_wave/functionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def mechanical_energy_form(wave):
eps = lambda v: 0.5*(grad(v) + grad(v).T)
U = (lmbda*div(u_n)*div(u_n) + 2*mu*inner(eps(u_n), eps(u_n)))*dx

return K + U
return K + U
2 changes: 2 additions & 0 deletions spyro/solvers/elastic_wave/local_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def local_abc_form(wave):
uz_dx, ux_dx, uy_dx,
uz_dy, ux_dy, uy_dy)


def clayton_engquist_A1_terms(ndim, rho, c_p, c_s,
v, iz, ix, iy, qr_s,
uz_dt, ux_dt, uy_dt,
Expand Down Expand Up @@ -150,6 +151,7 @@ def clayton_engquist_A1_terms(ndim, rho, c_p, c_s,

return F_t


def stacey_terms(ndim, rho, c_p, c_s,
v, iz, ix, iy, qr_s,
uz_dt, ux_dt, uy_dt,
Expand Down
4 changes: 2 additions & 2 deletions test/test_elastic_local_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def test_clayton_engquist_abc():

def test_with_central():
wave = build_solver("Stacey", "central")
with pytest.raises(AssertionError) as e:
with pytest.raises(AssertionError):
wave.forward_solve()


def test_with_backward_2nd():
wave = build_solver("Stacey", "backward_2nd")
wave.forward_solve()
last_mechanical_energy = wave.field_logger.get("mechanical_energy")
assert last_mechanical_energy < expected_mechanical_energy
assert last_mechanical_energy < expected_mechanical_energy

0 comments on commit 83e95c4

Please sign in to comment.