def test_reflect_wrong_symmetry_plane_1(self): params = FFD([3, 2, 2]) params.read_parameters('tests/test_datasets/parameters_sphere.prm') params.array_mu_x = 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=0)
def test_reflect_axis_0(self): params = FFD([3, 2, 2]) params.read_parameters('tests/test_datasets/parameters_sphere.prm') params.array_mu_x = np.array( [0.2, 0., 0., 0., 0.5, 0., 0., .2, 0., 0., 0., 0.]).reshape( (3, 2, 2)) params.reflect(axis=0) array_mu_x_exact = np.array([ 0.2, 0., 0., 0., 0.5, 0., 0., 0.2, 0., 0., 0., 0., -0.5, -0., -0., -0.2, -0.2, -0., -0., -0. ]).reshape((5, 2, 2)) np.testing.assert_array_almost_equal(params.array_mu_x, array_mu_x_exact)