Skip to content

Commit

Permalink
misc: Update elastic testing
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed May 28, 2024
1 parent c22fcad commit 3c46097
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions tests/test_xdsl_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from devito import (Grid, TensorTimeFunction, VectorTimeFunction, div, grad, diag, solve,
Operator, Eq, Constant, norm, SpaceDimension)
from devito.types import Array, Function, TimeFunction
from devito.tools import as_tuple

from xdsl.dialects.scf import For, Yield
from xdsl.dialects.arith import Addi
Expand Down Expand Up @@ -653,7 +654,6 @@ def test_xdsl_mul_eqs_VI():
assert np.isclose(v.data_with_halo, devito_res_v).all()


# @pytest.mark.xfail(reason=" .forward.dx cannot be handled")
def test_xdsl_mul_eqs_VII():
# Define a Devito Operator with multiple eqs
grid = Grid(shape=(4, 4))
Expand Down Expand Up @@ -849,8 +849,10 @@ class TestElastic():
def test_elastic_2D(self, shape, so, nt):

# Initial grid: km x km, with spacing
extent = (1500., 1500.)
shape = shape
shape = shape # Number of grid point (nx, nz)
spacing = as_tuple(10.0 for _ in range(len(shape)))
extent = tuple([s*(n-1) for s, n in zip(spacing, shape)])

x = SpaceDimension(name='x', spacing=Constant(name='h_x', value=extent[0]/(shape[0]-1))) # noqa
z = SpaceDimension(name='z', spacing=Constant(name='h_z', value=extent[1]/(shape[1]-1))) # noqa
grid = Grid(extent=extent, shape=shape, dimensions=(x, z))
Expand Down
3 changes: 1 addition & 2 deletions xdsl_examples/elastic2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@


# Initial grid: km x km, with spacing
shape = (args.shape) # Number of grid point (nx, ny, nz)
shape = args.shape # Number of grid point (nx, nz)
spacing = as_tuple(10.0 for _ in range(len(shape))) # Grid spacing in m. The domain size is now 1km by 1km

extent = tuple([s*(n-1) for s, n in zip(spacing, shape)])

shape = args.shape
x = SpaceDimension(name='x', spacing=Constant(name='h_x', value=extent[0]/(shape[0]-1)))
z = SpaceDimension(name='z', spacing=Constant(name='h_z', value=extent[1]/(shape[1]-1)))
grid = Grid(extent=extent, shape=shape, dimensions=(x, z))
Expand Down

0 comments on commit 3c46097

Please sign in to comment.