Skip to content

Commit 15841ca

Browse files
borrowing the 2D tests from the other PR
1 parent 9d64eb0 commit 15841ca

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

test/test_grid_addboundaryset.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
@test getfacetset(grid, "test_boundary_facetset") == Ferrite.create_boundaryfacetset(grid, topology, filter_function)
237237
end
238238

239-
@testset "mixed grid" begin
239+
@testset "mixed grid 3D" begin
240240
nodes = reshape([Node(Vec(x, y, z)) for x in -1:1, y in -1:1, z in 0:1], :)
241241
for (shape1, shape2) in ((Hexahedron, Wedge), (Wedge, Hexahedron))
242242
grid = Grid([generate_cell1(shape1), generate_cell2(shape2)], nodes)
@@ -245,4 +245,15 @@
245245
@test getfacetset(grid, "boundary") == boundary_facets(shape1, shape2)
246246
end
247247
end
248+
@testset "mixed grid 2D" begin
249+
nodes = [Node((-1.0, 0.0)), Node((0.0, 0.0)), Node((1.0, 0.0)), Node((-1.0, 1.0)), Node((0.0, 1.0))]
250+
cells = [
251+
Quadrilateral((1, 2, 5, 4)),
252+
Triangle((3, 5, 2)),
253+
]
254+
grid = Grid(cells, nodes)
255+
topology = ExclusiveTopology(grid)
256+
addboundaryfacetset!(grid, topology, "boundary", _ -> true)
257+
@test getfacetset(grid, "boundary") == Set([FacetIndex(1, 1), FacetIndex(1, 3), FacetIndex(1, 4), FacetIndex(2, 1), FacetIndex(2, 3)])
258+
end
248259
end

0 commit comments

Comments
 (0)