コード例 #1
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_add_snapshot2(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     offline.add_snapshot([-0.29334384, -0.2312056],
                          "tests/test_datasets/matlab_04.vtk")
     assert offline.snapshots.values.shape == (2500, 5)
コード例 #2
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_optimal_mu2(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     mu = offline.optimal_mu(error=offline.loo_error())
     expected_mu = np.array([-0.29334384, -0.23120563])
     np.testing.assert_array_almost_equal(mu[0], expected_mu)
コード例 #3
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_optimal_mu(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     mu = offline.optimal_mu()
     expected_mu = np.array([-0.29334384, -0.23120563])
     np.testing.assert_array_almost_equal(mu[0], expected_mu)
コード例 #4
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_add_snapshot(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     offline.add_snapshot([-0.29334384, -0.2312056],
                          "tests/test_datasets/matlab_04.vtk")
     expected_mu = np.array([[-.5, .5, .5, -.5, -0.29334384],
                             [-.5, -.5, .5, .5, -0.2312056]])
     np.testing.assert_array_almost_equal(expected_mu, offline.mu.values)
コード例 #5
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_init_database2(self):
     mu_values = [[-.5, -.5], [.5, -.5], [.5, .5], [-.5, .5]]
     files = [
         "tests/test_datasets/matlab_00.vtk",
         "tests/test_datasets/matlab_01.vtk",
         "tests/test_datasets/matlab_02.vtk",
         "tests/test_datasets/matlab_03.vtk"
     ]
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database(mu_values, files)
     assert offline.snapshots.values.shape == (2500, 4)
コード例 #6
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_init_database2(self):
     mu_values = [[-.5, -.5], [.5, -.5], [.5, .5], [-.5, .5]]
     files = [
         "tests/test_datasets/matlab_00.vtk",
         "tests/test_datasets/matlab_01.vtk",
         "tests/test_datasets/matlab_02.vtk",
         "tests/test_datasets/matlab_03.vtk"
     ]
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database(mu_values, files)
     assert offline.snapshots.values.shape == (2500, 4)
コード例 #7
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_init_database(self):
     mu_values = [[-.5, -.5], [.5, -.5], [.5, .5], [-.5, .5]]
     files = [
         "tests/test_datasets/matlab_00.vtk",
         "tests/test_datasets/matlab_01.vtk",
         "tests/test_datasets/matlab_02.vtk",
         "tests/test_datasets/matlab_03.vtk"
     ]
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database(mu_values, files)
     expected_mu = np.array([[-.5, .5, .5, -.5], [-.5, -.5, .5, .5]])
     np.testing.assert_array_almost_equal(expected_mu, offline.mu.values)
コード例 #8
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_init_database(self):
     mu_values = [[-.5, -.5], [.5, -.5], [.5, .5], [-.5, .5]]
     files = [
         "tests/test_datasets/matlab_00.vtk",
         "tests/test_datasets/matlab_01.vtk",
         "tests/test_datasets/matlab_02.vtk",
         "tests/test_datasets/matlab_03.vtk"
     ]
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database(mu_values, files)
     expected_mu = np.array([[-.5, .5, .5, -.5], [-.5, -.5, .5, .5]])
     np.testing.assert_array_almost_equal(expected_mu, offline.mu.values)
コード例 #9
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_save(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     offline.generate_rb_space()
     offline.save_rb_space('space')
     assert os.path.isfile('space')
コード例 #10
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_save(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     offline.generate_rb_space()
     offline.save_rb_space('space')
     assert os.path.isfile('space')
コード例 #11
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_add_snapshot2(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     offline.add_snapshot([-0.29334384, -0.2312056],
                          "tests/test_datasets/matlab_04.vtk")
     assert offline.snapshots.values.shape == (2500, 5)
コード例 #12
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_add_snapshot(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     offline.add_snapshot([-0.29334384, -0.2312056],
                          "tests/test_datasets/matlab_04.vtk")
     expected_mu = np.array([[-.5, .5, .5, -.5, -0.29334384],
                             [-.5, -.5, .5, .5, -0.2312056]])
     np.testing.assert_array_almost_equal(expected_mu, offline.mu.values)
コード例 #13
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_init_database_from_file_wrongfile(self):
     conf_file = 'tests/test_datasets/wrongmu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     with self.assertRaises(ValueError):
         offline.init_database_from_file(conf_file)
コード例 #14
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_loo_error(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     error = offline.loo_error()
     assert error.shape == (4, )
コード例 #15
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_init_database_from_file2(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     assert offline.snapshots.values.shape == (2500, 4)
コード例 #16
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_init_database_from_file_nofile(self):
     conf_file = 'tests/test_datasets/notexisting_mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     with self.assertRaises(IOError):
         offline.init_database_from_file(conf_file)
コード例 #17
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_init_database_from_file(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     expected_mu = np.array([[-.5, .5, .5, -.5], [-.5, -.5, .5, .5]])
     np.testing.assert_array_almost_equal(expected_mu, offline.mu.values)
コード例 #18
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_init_database_from_file(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     expected_mu = np.array([[-.5, .5, .5, -.5], [-.5, -.5, .5, .5]])
     np.testing.assert_array_almost_equal(expected_mu, offline.mu.values)
コード例 #19
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_init_database_from_file2(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     assert offline.snapshots.values.shape == (2500, 4)
コード例 #20
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_init_database_from_file_nofile(self):
     conf_file = 'tests/test_datasets/notexisting_mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     with self.assertRaises(IOError):
         offline.init_database_from_file(conf_file)
コード例 #21
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_offline(self):
     offline = Offline(output_name='Pressure')
コード例 #22
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_init_database_from_file_wrongfile(self):
     conf_file = 'tests/test_datasets/wrongmu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     with self.assertRaises(ValueError):
         offline.init_database_from_file(conf_file)
コード例 #23
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_generate(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     offline.generate_rb_space()
コード例 #24
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_generate(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     offline.generate_rb_space()
コード例 #25
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_loo_error2(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     max_error = np.max(offline.loo_error())
     assert isinstance(max_error, float)
コード例 #26
0
ファイル: test_offline.py プロジェクト: xuhan425/EZyRB
 def test_loo_error(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     error = offline.loo_error()
     assert error.shape == (4, )
コード例 #27
0
ファイル: test_offline.py プロジェクト: mathLab/EZyRB
 def test_loo_error2(self):
     conf_file = 'tests/test_datasets/mu.conf'
     offline = Offline(output_name='Pressure', dformat='point')
     offline.init_database_from_file(conf_file)
     max_error = np.max(offline.loo_error())
     assert isinstance(max_error, float)