コード例 #1
0
ファイル: test_core.py プロジェクト: nbud/arim
    def test_interface_reflection(self):
        n = 10
        points = g.Points(np.random.uniform(size=(n, 3)))
        orientations = g.Points(np.eye(3), "coordinate system")

        interface = c.Interface(
            points,
            orientations,
            transmission_reflection="reflection",
            kind="fluid_solid",
            are_normals_on_inc_rays_side=True,
            are_normals_on_out_rays_side=None,
            reflection_against=water,
        )

        with pytest.raises(ValueError):
            c.Interface(
                points,
                orientations,
                transmission_reflection="reflection",
                kind="fluid_solid",
                are_normals_on_inc_rays_side=True,
                are_normals_on_out_rays_side=None,
                reflection_against=None,
            )

        assert interface.points is points
        assert np.allclose(interface.orientations[np.newaxis, ...],
                           interface.orientations[...])
        assert interface.transmission_reflection is c.TransmissionReflection.reflection
        assert interface.reflection_against is water
        str(interface)
        repr(interface)
コード例 #2
0
ファイル: test_core.py プロジェクト: nbud/arim
    def test_interface_probe(self):
        n = 10
        points = g.Points(np.random.uniform(size=(n, 3)))
        orientations = g.Points(np.eye(3), "coordinate system")

        interface = c.Interface(
            points,
            orientations,
            are_normals_on_inc_rays_side=None,
            are_normals_on_out_rays_side=True,
        )

        assert interface.points is points
        assert np.allclose(interface.orientations[np.newaxis, ...],
                           interface.orientations[...])
        str(interface)
        repr(interface)