|
3 | 3 | import pytest |
4 | 4 | from sympy import Float |
5 | 5 |
|
| 6 | +from conftest import assert_structure |
6 | 7 | from devito import (Grid, Operator, Dimension, SparseFunction, SparseTimeFunction, |
7 | 8 | Function, TimeFunction, DefaultDimension, Eq, switchconfig, |
8 | 9 | PrecomputedSparseFunction, PrecomputedSparseTimeFunction, |
@@ -958,6 +959,10 @@ def test_interpolate_subdomain(self): |
958 | 959 | assert np.all(np.isclose(sr0.data, check0)) |
959 | 960 | assert np.all(np.isclose(sr1.data, check1)) |
960 | 961 | assert np.all(np.isclose(sr2.data, check2)) |
| 962 | + assert_structure(op, |
| 963 | + ['p_sr0', 'p_sr0rsr0xrsr0y', 'p_sr1', |
| 964 | + 'p_sr1rsr1xrsr1y', 'p_sr2', 'p_sr2rsr2xrsr2y'], |
| 965 | + 'p_sr0rsr0xrsr0yp_sr1rsr1xrsr1yp_sr2rsr2xrsr2y') |
961 | 966 |
|
962 | 967 | def test_interpolate_subdomain_sinc(self): |
963 | 968 | """ |
@@ -997,6 +1002,10 @@ def test_interpolate_subdomain_sinc(self): |
997 | 1002 |
|
998 | 1003 | assert np.all(np.isclose(sr0.data, sr2.data)) |
999 | 1004 | assert np.all(np.isclose(sr1.data, sr2.data)) |
| 1005 | + assert_structure(op, |
| 1006 | + ['p_sr0', 'p_sr0rsr0xrsr0y', 'p_sr1', |
| 1007 | + 'p_sr1rsr1xrsr1y', 'p_sr2', 'p_sr2rsr2xrsr2y'], |
| 1008 | + 'p_sr0rsr0xrsr0yp_sr1rsr1xrsr1yp_sr2rsr2xrsr2y') |
1000 | 1009 |
|
1001 | 1010 | def test_inject_subdomain(self): |
1002 | 1011 | """ |
@@ -1041,6 +1050,9 @@ def test_inject_subdomain(self): |
1041 | 1050 |
|
1042 | 1051 | assert np.all(np.isclose(f0.data, check0)) |
1043 | 1052 | assert np.all(np.isclose(f1.data, check1)) |
| 1053 | + assert_structure(op, |
| 1054 | + ['p_sr0rsr0xrsr0y'], |
| 1055 | + 'p_sr0rsr0xrsr0y') |
1044 | 1056 |
|
1045 | 1057 | def test_inject_subdomain_sinc(self): |
1046 | 1058 | """ |
@@ -1070,6 +1082,9 @@ def test_inject_subdomain_sinc(self): |
1070 | 1082 |
|
1071 | 1083 | assert np.all(np.isclose(f0.data, f2.data[:9, -9:])) |
1072 | 1084 | assert np.all(np.isclose(f1.data, f2.data[1:-1, 1:-1])) |
| 1085 | + assert_structure(op, |
| 1086 | + ['p_sr0rsr0xrsr0y'], |
| 1087 | + 'p_sr0rsr0xrsr0y') |
1073 | 1088 |
|
1074 | 1089 | @pytest.mark.parallel(mode=4) |
1075 | 1090 | def test_interpolate_subdomain_mpi(self, mode): |
|
0 commit comments