Skip to content

Commit

Permalink
k
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Dec 5, 2024
1 parent 6adc729 commit 09740c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/firedrake/regression/test_restricted_function_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion tests/pyop2/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 09740c4

Please sign in to comment.