def test_reflect_wrong_symmetry_plane_2(self): params = FFD([3, 2, 2]) params.read_parameters('tests/test_datasets/parameters_sphere.prm') params.array_mu_y = np.array( [0.2, 0., 0., 0., 0.5, 0., 0., 0., 1., 0., 0.3, 0.]).reshape( (3, 2, 2)) with self.assertRaises(RuntimeError): params.reflect(axis=1)
def test_reflect_axis_1(self): params = FFD([3, 2, 2]) params.read_parameters('tests/test_datasets/parameters_sphere.prm') params.array_mu_y = np.array( [0.2, 0., 0., 0., 0.5, 0., 0., 0., 0., 0., 0., 0.]).reshape( (3, 2, 2)) params.reflect(axis=1) array_mu_y_exact = np.array([ 0.2, 0., 0., 0., -0.2, -0., 0.5, 0., 0., 0., -0.5, -0., 0., 0., 0., 0., 0., 0. ]).reshape((3, 3, 2)) np.testing.assert_array_almost_equal(params.array_mu_y, array_mu_y_exact)