@@ -35,32 +35,32 @@ def test_tetrahedron_interior(ls_values, vol_ex):
35
35
vol = cut_cell .volume ()
36
36
print (vol )
37
37
38
- assert np .isclose (vol ,0.0 )
38
+ assert np .isclose (vol ,vol_ex )
39
39
40
- # level_set_values = [(np.array([0.1,-0.1,0.2,0.2]),68./27.),
41
- # (np.array([-0.1,0.1,0.2,0.2]),68./27.),
42
- # (np.array([0.1,0.1,-0.2,0.2]),56./27.),
43
- # (np.array([-0.1,-0.1,0.2,0.2]),160./81.),
44
- # (np.array([0.1,-0.1,-0.2,0.2]),4./3.),
45
- # (np.array([-0.1,0.1,-0.2,0.2]),4./3.),
46
- # (np.array([0.1,-0.1,0.2,-0.2]),4./3.),
47
- # (np.array([-0.1,0.1,0.2,-0.2]),4./3.),
48
- # (np.array([0.1,0.1,-0.2,-0.2]),56./81.),
49
- # (np.array([-0.1,-0.1,0.2,-0.2]),16./27.),
50
- # (np.array([0.1,-0.1,-0.2,-0.2]),4./27.),
51
- # (np.array([-0.1,0.1,-0.2,-0.2]),4./27.),
52
- # (np.array([0.1,0.1,0.2,-0.2]),56./27.),
53
- # (np.array([-0.1,-0.1,-0.2,0.2]),16./27.)]
40
+ level_set_values = [(np .array ([0.1 ,- 0.1 ,0.2 ,0.2 ]),68. / 27. ),
41
+ (np .array ([- 0.1 ,0.1 ,0.2 ,0.2 ]),68. / 27. ),
42
+ (np .array ([0.1 ,0.1 ,- 0.2 ,0.2 ]),56. / 27. ),
43
+ (np .array ([- 0.1 ,- 0.1 ,0.2 ,0.2 ]),160. / 81. ),
44
+ (np .array ([0.1 ,- 0.1 ,- 0.2 ,0.2 ]),4. / 3. ),
45
+ (np .array ([- 0.1 ,0.1 ,- 0.2 ,0.2 ]),4. / 3. ),
46
+ (np .array ([0.1 ,- 0.1 ,0.2 ,- 0.2 ]),4. / 3. ),
47
+ (np .array ([- 0.1 ,0.1 ,0.2 ,- 0.2 ]),4. / 3. ),
48
+ (np .array ([0.1 ,0.1 ,- 0.2 ,- 0.2 ]),56. / 81. ),
49
+ (np .array ([- 0.1 ,- 0.1 ,0.2 ,- 0.2 ]),16. / 27. ),
50
+ (np .array ([0.1 ,- 0.1 ,- 0.2 ,- 0.2 ]),4. / 27. ),
51
+ (np .array ([- 0.1 ,0.1 ,- 0.2 ,- 0.2 ]),4. / 27. ),
52
+ (np .array ([0.1 ,0.1 ,0.2 ,- 0.2 ]),56. / 27. ),
53
+ (np .array ([- 0.1 ,- 0.1 ,- 0.2 ,0.2 ]),16. / 27. )]
54
54
55
- # @pytest.mark.parametrize("ls_values, vol_ex", level_set_values)
56
- # def test_tetrahedron_exterior(ls_values, vol_ex):
57
- # vertex_coordinates = np.array([1.,1.,1., 1.,-1., -1., -1, 1., -1., -1., -1, 1])
55
+ @pytest .mark .parametrize ("ls_values, vol_ex" , level_set_values )
56
+ def test_tetrahedron_exterior (ls_values , vol_ex ):
57
+ vertex_coordinates = np .array ([1. ,1. ,1. , 1. ,- 1. , - 1. , - 1 , 1. , - 1. , - 1. , - 1 , 1 ])
58
58
59
- # cell_type = cutcells.CellType.tetrahedron
60
- # triangulate = True
61
- # gdim = 3
59
+ cell_type = cutcells .CellType .tetrahedron
60
+ triangulate = True
61
+ gdim = 3
62
62
63
- # cut_cell = cutcells.cut(cell_type, vertex_coordinates, gdim, ls_values, "phi>0", triangulate)
64
- # vol = cut_cell.volume()
63
+ cut_cell = cutcells .cut (cell_type , vertex_coordinates , gdim , ls_values , "phi>0" , triangulate )
64
+ vol = cut_cell .volume ()
65
65
66
- # assert np.isclose(vol,vol_ex)
66
+ assert np .isclose (vol ,vol_ex )
0 commit comments