Exemple #1
0
 def test_find_directions_defined_map(self):
     directions = opt_struct._find_directions(None, None,
                                              [[1, 0, 0], [0, 1, 0]],
                                              [1, 2, 3, 4], [0, 0, 1, 1])
     assert directions.shape == (4, 3)
     assert np.allclose(directions,
                        [[1, 0, 0], [1, 0, 0], [0, 1, 0], [0, 1, 0]])
Exemple #2
0
 def test_find_directions_normal(self, idx, lf_type, sphere_surf):
     directions = opt_struct._find_directions(sphere_surf, lf_type,
                                              'normal', idx)
     if lf_type == 'node':
         normals = sphere_surf.nodes_normals()[idx]
     elif lf_type == 'element':
         normals = sphere_surf.triangle_normals()[idx]
     assert np.allclose(directions, -normals)
Exemple #3
0
 def test_find_directions_defined_1_to_2(self):
     directions = opt_struct._find_directions(None, None, [1, 0, 0], [1, 2],
                                              [1, 2])
     assert directions.shape == (2, 3)
     assert np.allclose(directions, [[1, 0, 0], [1, 0, 0]])