|
2 | 2 |
|
3 | 3 | from conftest import assert_structure |
4 | 4 | from devito import (Eq, Inc, Grid, Function, TimeFunction, SubDimension, SubDomain, |
5 | | - Operator, solve) |
| 5 | + Operator, VectorTimeFunction, Buffer, curl, solve) |
6 | 6 |
|
7 | 7 |
|
8 | 8 | def test_issue_1725(): |
@@ -125,3 +125,23 @@ def test_issue_1921(): |
125 | 125 | op1.apply(time_m=1, time_M=5, g=g1) |
126 | 126 |
|
127 | 127 | assert np.all(g.data == g1.data) |
| 128 | + |
| 129 | + |
| 130 | +def test_fission_largest_cluster(): |
| 131 | + grid = Grid(shape=(10, 10, 10)) |
| 132 | + x, y, z = grid.dimensions |
| 133 | + |
| 134 | + space_order = 2 |
| 135 | + |
| 136 | + A = VectorTimeFunction(name='A', grid=grid, save=Buffer(1), space_order=2, |
| 137 | + time_order=1, staggered=(x, y, z)) |
| 138 | + B = VectorTimeFunction(name='B', grid=grid, save=Buffer(1), space_order=2, |
| 139 | + time_order=1, staggered=((y, z),(x, z),(x, y))) |
| 140 | + f = Function(name='f', grid=grid, space_order=2) |
| 141 | + |
| 142 | + eqs = [Eq(B.forward, solve(Eq(curl(A), -B.dt), B.forward)), |
| 143 | + Eq(A.forward, solve(Eq(curl(B.forward), f*A.dt), A.forward))] |
| 144 | + |
| 145 | + op = Operator(eqs, opt='fission') |
| 146 | + |
| 147 | + assert_structure(op, ['t,x,y,z', 't,x,y,z'], 't,x,y,z,x,y,z') |
0 commit comments