def test_save_points_deformed(self): params = RBFParameters() params.read_parameters( filename='tests/test_datasets/parameters_rbf_cube.prm') outfilename = 'tests/test_datasets/box_test_cube_deformed_out.vtk' outfilename_expected = 'tests/test_datasets/box_test_cube_deformed.vtk' params.save_points(outfilename, True) self.assertTrue(filecmp.cmp(outfilename, outfilename_expected)) os.remove(outfilename)
def test_save_points_deformed(self): params = RBFParameters() params.read_parameters( filename='tests/test_datasets/parameters_rbf_cube.prm') outfilename = 'tests/test_datasets/box_test_cube_deformed_out.vtk' outfilename_expected = 'tests/test_datasets/box_test_cube_deformed.vtk' params.save_points(outfilename, True) with open(outfilename, 'r') as out, open(outfilename_expected, 'r') as exp: self.assertTrue(out.readlines()[1:] == exp.readlines()[1:]) os.remove(outfilename)
ax = fig.add_subplot(111, projection='3d') ax.scatter(mesh[:, 0], mesh[:, 1], mesh[:, 2], c='blue', marker='o') ax.set_xlabel('X axis') ax.set_ylabel('Y axis') ax.set_zlabel('Z axis') plt.show() # modified 2-D mesh # read the RBF parameters params = RBFParameters() params.read_parameters(filename='turn_airfoil.prm') params.plot_points() params.save_points(filename='point.vtk') # rbf = RBF(params, mesh) rbf.perform() new_mesh_points = rbf.modified_mesh_points # fig = plt.figure(2) ax = fig.add_subplot(111, projection='3d') ax.scatter(new_mesh_points[:, 0], new_mesh_points[:, 1], new_mesh_points[:, 2], c='red', marker='o') ax.set_xlabel('X axis') ax.set_ylabel('Y axis')