Ejemplo n.º 1
0
def test_4_by_5():
    link_faces = sgrid.face_index_at_links((4, 5))

    BAD = sgrid.BAD_INDEX_VALUE

    assert_array_equal(
        link_faces,
        np.array([
            BAD, 0, 1, 2, BAD, BAD, 3, 4, 5, BAD, BAD, 6, 7, 8, BAD, BAD, BAD,
            BAD, BAD, 9, 10, 11, 12, 13, 14, 15, 16, BAD, BAD, BAD, BAD
        ]))
Ejemplo n.º 2
0
    def test_4_by_5(self):
        link_faces = sgrid.face_index_at_links((4, 5))

        BAD = sgrid.BAD_INDEX_VALUE

        self.assertArrayEqual(link_faces, np.array([BAD, 0, 1, 2, BAD,
                                                 BAD, 3, 4, 5, BAD,
                                                 BAD, 6, 7, 8, BAD,
                                                 BAD, BAD, BAD, BAD,
                                                 9, 10, 11, 12,
                                                 13, 14, 15, 16,
                                                 BAD, BAD, BAD, BAD]))
Ejemplo n.º 3
0
def test_with_active_links():
    active_links = sgrid.active_links((4, 5))
    active_links = active_links[:-1]
    link_faces = sgrid.face_index_at_links((4, 5), actives=active_links)

    BAD = sgrid.BAD_INDEX_VALUE

    assert_array_equal(
        link_faces,
        np.array([
            BAD, 0, 1, 2, BAD, BAD, 3, 4, 5, BAD, BAD, 6, 7, 8, BAD, BAD, BAD,
            BAD, BAD, 9, 10, 11, 12, 13, 14, 15, BAD, BAD, BAD, BAD, BAD
        ]))
Ejemplo n.º 4
0
    def test_with_active_links(self):
        active_links = sgrid.active_links((4, 5))
        active_links = active_links[:-1]
        link_faces = sgrid.face_index_at_links((4, 5), actives=active_links)

        BAD = sgrid.BAD_INDEX_VALUE

        self.assertArrayEqual(link_faces, np.array([BAD, 0, 1, 2, BAD,
                                                 BAD, 3, 4, 5, BAD,
                                                 BAD, 6, 7, 8, BAD,
                                                 BAD, BAD, BAD, BAD,
                                                 9, 10, 11, 12,
                                                 13, 14, 15, BAD,
                                                 BAD, BAD, BAD, BAD]))