Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 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])
Ejemplo n.º 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])
Ejemplo n.º 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])
Ejemplo n.º 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])
Ejemplo n.º 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])
Ejemplo n.º 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])
Ejemplo n.º 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]
Ejemplo n.º 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]