Example #1
0
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]
Example #2
0
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]
Example #3
0
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]
Example #4
0
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]
Example #5
0
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]
Example #6
0
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]
Example #7
0
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]
Example #8
0
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]
Example #9
0
    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])
Example #10
0
    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])
Example #11
0
    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])
Example #12
0
    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])
Example #13
0
    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])
Example #14
0
    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])
Example #15
0
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]
Example #16
0
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]