예제 #1
0
def test_adhmodel_read_hotstart():
    # set test project name
    project_name = 'SanDiego'
    # set project directory
    path = os.path.join(TESTDIR, 'test_files', project_name,
                        f'{project_name}.nc')
    # instantiate empty adh model object
    adhmod = AdhModel()
    # read the mesh file
    adhmod.read_hotstart(path=path, fmt='nc')
예제 #2
0
 def test_read_hot_start(self):
     path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                         'test_files')
     fname = os.path.join(path, 'angle_bt.hot')
     out_file = os.path.join(path, 'out_files', 'out_angle_bt.hot')
     base_file = os.path.join(path, 'base_angle_bt.hot')
     model = AdhModel()
     model.read_hotstart(fname, fmt='ascii')
     hotstart = model.simulation.hotstart
     self.assertEqual(1, len(hotstart))
     self.assertEqual(250, hotstart.ioh.size)
     model.simulation.write_hotstart(out_file)
     self.assertTrue(filecmp.cmp(base_file, out_file, shallow=False))