def test_open_foam_write_comparison(self):
open_foam_handler = ofh.OpenFoamHandler()
mesh_points = open_foam_handler.parse(
'tests/test_datasets/test_openFOAM'
)
mesh_points[0] = [-14., 1.55, 0.2]
mesh_points[1] = [-14.3, 2.55, 0.3]
mesh_points[2] = [-14.3, 2.55, 0.3]
mesh_points[2000] = [7.8, -42.8, .0]
mesh_points[2001] = [8.8, -41.8, .1]
mesh_points[2002] = [9.8, -40.8, .0]
mesh_points[-3] = [236.3, 183.7, 0.06]
mesh_points[-2] = [237.3, 183.7, 0.06]
mesh_points[-1] = [236.3, 185.7, 0.06]
outfilename = 'tests/test_datasets/test_openFOAM_out'
outfilename_expected = 'tests/test_datasets/test_openFOAM_out_true'
open_foam_handler.write(mesh_points, outfilename)
self.assertTrue(filecmp.cmp(outfilename, outfilename_expected))
self.addCleanup(os.remove, outfilename)
评论列表
文章目录