def test_initX_enkf_linalg_lowrank_EE(self): """Test AnalysisModule.initX with EE=True and GE=False""" mod = AnalysisModule(self.rng, name="STD_ENKF") A, S, R, dObs, E, D = self._n_identity_mcs() mod.setVar('USE_EE', True) self.assertTrue(mod.getBool('USE_EE')) self.assertFalse(mod.getBool('USE_GE')) elt_a, elt_b = 1.33, -0.167 vals = (elt_a, elt_b, elt_b, elt_b, elt_a, elt_b, elt_b, elt_b, elt_a) expected = self.construct_matrix(3, vals) X = mod.initX(A, S, R, dObs, E, D) self._matrix_close(X, expected)
def test_initX_enkf_linalg_lowrank_EE(self): """Test AnalysisModule.initX with EE=True and GE=False""" mod = AnalysisModule( self.rng , name = "STD_ENKF" ) A, S, R, dObs, E, D = self._n_identity_mcs() mod.setVar('USE_EE', True) self.assertTrue(mod.getBool('USE_EE')) self.assertFalse(mod.getBool('USE_GE')) elt_a, elt_b = 1.33, -0.167 vals = (elt_a, elt_b, elt_b, elt_b, elt_a, elt_b, elt_b, elt_b, elt_a) expected = self.construct_matrix(3, vals) X = mod.initX(A, S, R, dObs, E, D) self._matrix_close(X, expected)
def test_initX_subspace_inversion_algorithm(self): """Test AnalysisModule.initX with EE=True and GE=True, the subspace inversion algorithm""" mod = AnalysisModule(self.rng, name="STD_ENKF") A, S, R, dObs, E, D = self._n_identity_mcs() mod.setVar('USE_EE', True) mod.setVar('USE_GE', True) self.assertTrue(mod.getBool('USE_EE')) self.assertTrue(mod.getBool('USE_GE')) vals = (1.39, -0.111, -0.278, -0.111, 1.39, -0.278, -0.278, -0.278, 1.56) expected = self.construct_matrix(3, vals) X = mod.initX(A, S, R, dObs, E, D) self._matrix_close(X, expected)
def test_initX_subspace_inversion_algorithm(self): """Test AnalysisModule.initX with EE=True and GE=True, the subspace inversion algorithm""" mod = AnalysisModule( self.rng , name = "STD_ENKF" ) A, S, R, dObs, E, D = self._n_identity_mcs() mod.setVar('USE_EE', True) mod.setVar('USE_GE', True) self.assertTrue(mod.getBool('USE_EE')) self.assertTrue(mod.getBool('USE_GE')) vals = ( 1.39, -0.111, -0.278, -0.111, 1.39, -0.278, -0.278, -0.278, 1.56 ) expected = self.construct_matrix(3, vals) X = mod.initX(A, S, R, dObs, E, D) self._matrix_close(X, expected)