def test_pod_attributes_08(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.vtk' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) assert pod_handler.weights == None
def test_pod_attributes_07_mat(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.mat' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) assert isinstance(pod_handler.snapshots, np.ndarray)
def test_pod_print_info(self): output_name = 'Velocity' weights_name = 'fake_weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.vtk' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() pod_handler.print_info()
def test_pod_start_weights_03(self): output_name = 'Velocity' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.vtk' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() assert pod_handler.weights.shape == (7500, )
def test_pod_start_weights_01_mat(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.mat' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() assert pod_handler.weights.shape == (1024, )
def test_pod_start_snapshots_01_vtk(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.vtk' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() assert pod_handler.snapshots.shape == (2500, 4)
def test_pod_add_snapshot_04_mat(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.mat' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() pod_handler.add_snapshot() np.testing.assert_almost_equal(pod_handler.snapshots[-1, -1], 0.5650054088)
def test_pod_add_snapshot_03_vtk(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.vtk' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() pod_handler.add_snapshot() np.testing.assert_almost_equal(pod_handler.snapshots[30, -1], 4.09717798233)
def test_pod_start_weights_02_mat(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.mat' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() expected_weights = np.ones(np.shape(pod_handler.weights)) np.testing.assert_array_almost_equal(pod_handler.weights, expected_weights)
def test_pod_start_weights_02_vtk(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.vtk' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() expected_weights = np.load('tests/test_datasets/weights_test.npy') np.testing.assert_array_almost_equal(pod_handler.weights, expected_weights)
def test_pod_add_snapshot_02_mat(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.mat' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() pod_handler.add_snapshot() print pod_handler.snapshots[0, -1] np.testing.assert_almost_equal(pod_handler.snapshots[0, -1], 12.1680652248)
def test_pod_start_snapshots_04(self): output_name = 'Velocity' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.vtk' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() expected_snapshots = np.load( 'tests/test_datasets/snapshots_vectorial_test.npy') np.testing.assert_array_almost_equal(pod_handler.snapshots, expected_snapshots)
def test_pod_add_snapshot_01_mat(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.mat' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() pod_handler.add_snapshot() mu_1 = np.array([-.5, .5, .5, -.5, -0.3009776]) mu_2 = np.array([-.5, -.5, .5, .5, -0.22145312]) expected_mu_values = np.array([mu_1, mu_2]) np.testing.assert_array_almost_equal(pod_handler.mu_values, expected_mu_values)
def test_pod_write_structures_01_mat(self): output_name = 'Pressure' weights_name = 'Weights' namefile_prefix = 'tests/test_datasets/matlab_0' file_format = '.mat' pod_handler = pod.Pod(output_name, weights_name, namefile_prefix, file_format) pod_handler.start() pod_handler.write_structures() expected_pod_basis = np.load( 'tests/test_datasets/pod_basis_test_mat.npy') np.testing.assert_array_almost_equal(pod_handler.pod_basis, expected_pod_basis) os.remove('pod_basis_Pressure.npy') os.remove('coefs_tria_Pressure.npy')