@@ -503,35 +503,37 @@ def boundary_2(x):
503
503
504
504
505
505
# TODO Test that submesh of full mesh is a copy of the mesh
506
- @pytest .mark .parametrize ("d" , [2 , 3 ])
506
+ @pytest .mark .parametrize ("d" , [1 , 2 , 3 ])
507
507
@pytest .mark .parametrize ("n" , [3 , 6 ])
508
508
@pytest .mark .parametrize ("codim" , [0 , 1 , 2 ])
509
509
@pytest .mark .parametrize ("marker" , [lambda x : x [0 ] >= 0.5 , lambda x : x [0 ] >= - 1 ])
510
510
@pytest .mark .parametrize ("ghost_mode" , [GhostMode .none , GhostMode .shared_facet ])
511
511
@pytest .mark .parametrize ("simplex" , [True , False ])
512
512
def test_submesh_full (d , n , codim , marker , ghost_mode , simplex ):
513
- if d == codim :
514
- pytest . xfail ( "Cannot create vertex submesh" )
515
- if d == 2 :
513
+ if d == 1 :
514
+ mesh = create_unit_interval ( MPI . COMM_WORLD , n , ghost_mode = ghost_mode )
515
+ elif d == 2 :
516
516
ct = CellType .triangle if simplex else CellType .quadrilateral
517
517
mesh = create_unit_square (MPI .COMM_WORLD , n , n , ghost_mode = ghost_mode , cell_type = ct )
518
518
else :
519
519
ct = CellType .tetrahedron if simplex else CellType .hexahedron
520
520
mesh = create_unit_cube (MPI .COMM_WORLD , n , n , n , ghost_mode = ghost_mode , cell_type = ct )
521
521
522
- edim = mesh .topology .dim - codim
522
+ edim = max ( mesh .topology .dim - codim , 0 )
523
523
entities = locate_entities (mesh , edim , marker )
524
524
submesh , entity_map , vertex_map , geom_map = create_submesh (mesh , edim , entities )
525
525
submesh_topology_test (mesh , submesh , entity_map , vertex_map , edim )
526
526
submesh_geometry_test (mesh , submesh , entity_map , geom_map , edim )
527
527
528
528
529
- @pytest .mark .parametrize ("d" , [2 , 3 ])
529
+ @pytest .mark .parametrize ("d" , [1 , 2 , 3 ])
530
530
@pytest .mark .parametrize ("n" , [3 , 6 ])
531
531
@pytest .mark .parametrize ("boundary" , [boundary_0 , boundary_1 , boundary_2 ])
532
532
@pytest .mark .parametrize ("ghost_mode" , [GhostMode .none , GhostMode .shared_facet ])
533
533
def test_submesh_boundary (d , n , boundary , ghost_mode ):
534
- if d == 2 :
534
+ if d == 1 :
535
+ mesh = create_unit_interval (MPI .COMM_WORLD , n , ghost_mode = ghost_mode )
536
+ elif d == 2 :
535
537
mesh = create_unit_square (MPI .COMM_WORLD , n , n , ghost_mode = ghost_mode )
536
538
else :
537
539
mesh = create_unit_cube (MPI .COMM_WORLD , n , n , n , ghost_mode = ghost_mode )
0 commit comments