From 09740c459f7846772c546c19d516f37ea072d48f Mon Sep 17 00:00:00 2001 From: ksagiyam Date: Thu, 5 Dec 2024 01:41:30 +0000 Subject: [PATCH] k --- tests/firedrake/regression/test_restricted_function_space.py | 4 +++- tests/pyop2/test_api.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/firedrake/regression/test_restricted_function_space.py b/tests/firedrake/regression/test_restricted_function_space.py index 383503637e..2713b89081 100644 --- a/tests/firedrake/regression/test_restricted_function_space.py +++ b/tests/firedrake/regression/test_restricted_function_space.py @@ -249,17 +249,19 @@ def test_restricted_function_space_extrusion(): extm = ExtrudedMesh(mesh, 1) V = FunctionSpace(extm, "CG", 2) V_res = RestrictedFunctionSpace(V, boundary_set=["bottom"]) + # Check lgmap. lgmap = V_res.topological.local_to_global_map(None) if mesh.comm.rank == 0: lgmap_expected = [-1, 0, 1, -1, 2, 3, -1, 8, 9, -1, 4, 5, -1, 6, 7] else: lgmap_expected = [-1, 4, 5, -1, 6, 7, -1, 8, 9, -1, 0, 1, -1, 2, 3] assert np.allclose(lgmap.indices, lgmap_expected) - f = Function(V_res) + # Check vec. n = V_res.dof_dset.size lgmap_owned = lgmap.indices[:n] local_global_filter = lgmap_owned >= 0 local_array = 1.0 * np.arange(V_res.dof_dset.total_size) + f = Function(V_res) f.dat.data_wo_with_halos[:] = local_array with f.dat.vec as v: assert np.allclose(v.getArray(), local_array[:n][local_global_filter]) diff --git a/tests/pyop2/test_api.py b/tests/pyop2/test_api.py index 11465025c4..6fe24460c4 100644 --- a/tests/pyop2/test_api.py +++ b/tests/pyop2/test_api.py @@ -505,7 +505,7 @@ def test_dset_repr(self, dset): def test_dset_str(self, dset): "DataSet should have the expected string representation." assert str(dset) == "OP2 DataSet: %s on set %s, with dim %s, %s" \ - % (dset.name, dset.set, dset.dim, dset.apply_local_global_filter) + % (dset.name, dset.set, dset.dim, dset._apply_local_global_filter) def test_dset_eq(self, dset): "The equality test for DataSets is same dim and same set"