Esempio n. 1
0
 def test_closed_surface_semi_detached(self):
     orbital_position_container = self.build_system('semi-detached',
                                                    up.radians(10))
     self.assertTrue(
         testutils.surface_closed(
             faces=orbital_position_container.primary.faces,
             points=orbital_position_container.primary.points))
Esempio n. 2
0
    def test_closed_surface_over_contact(self):
        s = testutils.prepare_binary_system(
            testutils.BINARY_SYSTEM_PARAMS['over-contact'],
            spots_primary=testutils.SPOTS_META["primary"],
            spots_secondary=testutils.SPOTS_META["secondary"])
        s.primary.discretization_factor = up.radians(7)
        s.init()

        orbital_position_container = testutils.prepare_orbital_position_container(
            s)
        orbital_position_container.build_mesh(components_distance=1.0)
        orbital_position_container.build_faces(components_distance=1.0)
        for component in ['primary', 'secondary']:
            instance = getattr(orbital_position_container, component)
            points = instance.points
            faces = instance.faces
            if isinstance(instance.spots, (dict, )):
                for idx, spot in instance.spots.items():
                    faces = up.concatenate((faces, spot.faces + len(points)),
                                           axis=0)
                    points = up.concatenate((points, spot.points), axis=0)
            setattr(instance, 'points', points)
            setattr(instance, 'faces', faces)

        points = np.concatenate((orbital_position_container.primary.points,
                                 orbital_position_container.secondary.points))
        faces = np.concatenate(
            (orbital_position_container.primary.faces,
             orbital_position_container.secondary.faces +
             np.shape(orbital_position_container.primary.points)[0]))
        self.assertTrue(testutils.surface_closed(faces=faces, points=points))
Esempio n. 3
0
    def test_closed_surface_over_contact(self):
        s = testutils.prepare_binary_system(
            testutils.BINARY_SYSTEM_PARAMS['over-contact'])
        s.primary.discretization_factor = up.radians(10)
        s.init()

        orbital_position_container = testutils.prepare_orbital_position_container(
            s)
        orbital_position_container.build_mesh(components_distance=1.0)
        orbital_position_container.build_faces(components_distance=1.0)

        points = np.concatenate((orbital_position_container.primary.points,
                                 orbital_position_container.secondary.points))
        faces = np.concatenate(
            (orbital_position_container.primary.faces,
             orbital_position_container.secondary.faces +
             np.shape(orbital_position_container.primary.points)[0]))
        self.assertTrue(testutils.surface_closed(faces=faces, points=points))
Esempio n. 4
0
 def test_closed_surface_squashed(self):
     position_container = self.build_system('squashed', up.radians(10))
     self.assertTrue(testutils.surface_closed(faces=position_container.star.faces,
                                              points=position_container.star.points))