@@ -15,9 +15,6 @@ A = get_area(tri)
1515refine! (tri; max_area = 1.0e-2 A, rng, use_circumcenter = true )
1616
1717tri2, label_map, index_map = simple_geometry ()
18- # Manually repopulate boundary_vertex_to_ghost after simple_geometry() which uses delete_ghosts=true
19- # This is needed because add_boundary_information! clears the map but the package code changes
20- # may not be loaded in the current session
2118let bn = get_boundary_nodes (tri2)
2219 bv_map = DT. get_boundary_vertex_to_ghost (tri2)
2320 ghost = DT. 𝒢
@@ -309,12 +306,11 @@ end
309306 end
310307 end
311308
312- # Test that boundary_vertex_to_ghost map is correctly maintained
313309 @testset " boundary_vertex_to_ghost consistency" begin
314310 # Test with complicated geometry (multiple curves and sections)
315- # Note: For junction nodes (nodes shared between sections) , the map will only
316- # contain ONE ghost vertex, whichever was set last during processing.
317- # So we check that each boundary node IS in the map and maps to a VALID
311+ # Note: For junction nodes, the map will only
312+ # contain one ghost vertex, whichever was set last during processing.
313+ # So we check that each boundary node is in the map and maps to a valid
318314 # ghost vertex (one that is in the ghost vertex range for that curve).
319315 bv_map = DT. get_boundary_vertex_to_ghost (tri)
320316 for (ghost_vertex, segment_index) in get_ghost_vertex_map (tri)
@@ -350,12 +346,10 @@ end
350346@testset " boundary_vertex_to_ghost getter and setters" begin
351347 tri, label_map, index_map = simple_geometry ()
352348
353- # Test initial state - empty map for unconstrained tri before boundary info added
354349 bv_map = DT. get_boundary_vertex_to_ghost (tri)
355350 @test bv_map isa Dict
356351 @test isempty (bv_map)
357352
358- # Manually add some mappings for testing
359353 I = DT. integer_type (tri)
360354 test_vertex = I (5 )
361355 test_ghost = I (- 2 )
@@ -364,56 +358,47 @@ end
364358 @test haskey (DT. get_boundary_vertex_to_ghost (tri), test_vertex)
365359 @test DT. get_boundary_vertex_to_ghost (tri)[test_vertex] == test_ghost
366360
367- # Test deletion
368361 DT. delete_boundary_vertex_from_ghost_map! (tri, test_vertex)
369362 @test ! haskey (DT. get_boundary_vertex_to_ghost (tri), test_vertex)
370363
371- # Test with actual triangulation with boundaries
372364 x, y = complicated_geometry ()
373365 rng = StableRNG (99988 )
374366 boundary_nodes, points = convert_boundary_points_to_indices (x, y)
375367 tri_with_boundary = triangulate (points; rng, boundary_nodes, delete_ghosts = false )
376368
377- # Verify map is populated
378369 bv_map = DT. get_boundary_vertex_to_ghost (tri_with_boundary)
379370 @test ! isempty (bv_map)
380371
381- # Verify all boundary nodes are in the map
382372 all_boundary_nodes = reduce (vcat, reduce (vcat, get_boundary_nodes (tri_with_boundary)))
383373 for bn in all_boundary_nodes
384374 @test haskey (bv_map, bn)
385375 end
386376
387- # Verify non-boundary nodes are not in the map
388377 for v in each_vertex (tri_with_boundary)
389378 if v ∉ all_boundary_nodes
390379 @test ! haskey (bv_map, v)
391380 end
392381 end
393382end
394383
395- @testset " boundary_vertex_to_ghost with Base. copy and ==" begin
384+ @testset " boundary_vertex_to_ghost with copy and ==" begin
396385 x, y = complicated_geometry ()
397386 rng = StableRNG (99988 )
398387 boundary_nodes, points = convert_boundary_points_to_indices (x, y)
399388 tri = triangulate (points; rng, boundary_nodes, delete_ghosts = false )
400389
401- # Test Base.copy preserves the map
402390 tri_copy = copy (tri)
403391 @test DT. get_boundary_vertex_to_ghost (tri) == DT. get_boundary_vertex_to_ghost (tri_copy)
404392 @test DT. get_boundary_vertex_to_ghost (tri) != = DT. get_boundary_vertex_to_ghost (tri_copy) # Different objects
405393
406- # Test Base.== compares the map
407394 @test tri == tri_copy
408395
409- # Modify the copy's map and verify inequality
410396 I = DT. integer_type (tri_copy)
411397 fake_vertex = I (999999 )
412398 fake_ghost = I (- 999 )
413399 DT. add_boundary_vertex_to_ghost! (tri_copy, fake_vertex, fake_ghost)
414400 @test tri != tri_copy
415401
416- # Remove it and verify equality again
417402 DT. delete_boundary_vertex_from_ghost_map! (tri_copy, fake_vertex)
418403 @test tri == tri_copy
419404end
0 commit comments