def test_mesh_point_3d(): "Test mesh-point intersection in 3D" point = Point(0.1, 0.2, 0.3) mesh = UnitCubeMesh(8, 8, 8) intersection = intersect(mesh, point) assert intersection.intersected_cells() == [816]
def test_mesh_point_1d(): "Test mesh-point intersection in 1D" point = Point(0.1) mesh = UnitIntervalMesh(16) intersection = intersect(mesh, point) assert intersection.intersected_cells() == [1]
def test_mesh_point_2d(): "Test mesh-point intersection in 2D" point = Point(0.1, 0.2) mesh = UnitSquareMesh(16, 16) intersection = intersect(mesh, point) assert intersection.intersected_cells() == [98]
def test_mesh_point_2d_quadrilateral(): "Test mesh-point intersection in 2D for quadrilateral mesh" point = Point(0.1, 0.2) mesh = UnitSquareMesh.create(16, 16, CellType.Type.quadrilateral) intersection = intersect(mesh, point) assert intersection.intersected_cells() == [49]
def test_mesh_point_3d(self): "Test mesh-point intersection in 3D" point = Point(0.1, 0.2, 0.3) mesh = UnitCubeMesh(8, 8, 8) intersection = intersect(mesh, point) if MPI.size(mesh.mpi_comm()) == 1: self.assertEqual(intersection.intersected_cells(), [816])
def test_mesh_point_2d(self): "Test mesh-point intersection in 2D" point = Point(0.1, 0.2) mesh = UnitSquareMesh(16, 16) intersection = intersect(mesh, point) if MPI.size(mesh.mpi_comm()) == 1: self.assertEqual(intersection.intersected_cells(), [98])
def test_mesh_point_1d(self): "Test mesh-point intersection in 1D" point = Point(0.1) mesh = UnitIntervalMesh(16) intersection = intersect(mesh, point) if MPI.size(mesh.mpi_comm()) == 1: self.assertEqual(intersection.intersected_cells(), [1])
def test_mesh_point_3d_hexahedron(): "Test mesh-point intersection in 3D for hexahedral mesh" point = Point(0.1, 0.2, 0.3) mesh = UnitCubeMesh.create(8, 8, 8, CellType.Type.hexahedron) intersection = intersect(mesh, point) # Returns [] now, but [136] is the correct cell. assert intersection.intersected_cells() == [136]