def test_rbf_cube_mod(self): mesh_points_ref = np.load( 'tests/test_datasets/meshpoints_cube_mod_rbf.npy') rbf = RBF() rbf.read_parameters('tests/test_datasets/parameters_rbf_cube.prm') rbf.radius = 0.5 deformed_mesh = rbf(self.get_cube_mesh_points()) np.testing.assert_array_almost_equal(deformed_mesh, mesh_points_ref)
def test_write_parameters_filename_default_existance(self): params = RBF() params.basis = 'inv_multi_quadratic_biharmonic_spline' params.radius = 0.1 params.original_control_points = np.array( [0., 0., 0., 0., 0., 1., 0., 1., 0.]).reshape((3, 3)) params.deformed_control_points = np.array( [0., 0., 0., 0., 0., 1., 0., 1., 0.]).reshape((3, 3)) params.write_parameters() outfilename = 'parameters_rbf.prm' assert os.path.isfile(outfilename) os.remove(outfilename)