From 7c977859cfca79378b6a22e80cb3c26d973d7202 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Wed, 10 Mar 2021 06:26:56 +0100 Subject: [PATCH] Minor improvements and fixes for internal variables --- src/daComposant/daAlgorithms/4DVAR.py | 246 ++------------- src/daComposant/daCore/NumericObjects.py | 286 +++++++++++++++--- .../daYacsSchemaCreator/infos_daComposant.py | 1 + 3 files changed, 268 insertions(+), 265 deletions(-) diff --git a/src/daComposant/daAlgorithms/4DVAR.py b/src/daComposant/daAlgorithms/4DVAR.py index da643e6..5ed587b 100644 --- a/src/daComposant/daAlgorithms/4DVAR.py +++ b/src/daComposant/daAlgorithms/4DVAR.py @@ -21,7 +21,7 @@ # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D import logging -from daCore import BasicObjects +from daCore import BasicObjects, NumericObjects import numpy, scipy.optimize, scipy.version # ============================================================================== @@ -35,6 +35,18 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): message = "Prise en compte des contraintes", listval = ["EstimateProjection"], ) + self.defineRequiredParameter( + name = "Variant", + default = "4DVAR", + typecast = str, + message = "Variant ou formulation de la méthode", + listval = [ + "4DVAR", + ], + listadv = [ + "4DVAR-Std", + ], + ) self.defineRequiredParameter( name = "EstimationOf", default = "State", @@ -126,234 +138,14 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None): self._pre_run(Parameters, Xb, Y, U, HO, EM, CM, R, B, Q) # - # Opérateurs - # ---------- - Hm = HO["Direct"].appliedControledFormTo - # - Mm = EM["Direct"].appliedControledFormTo + #-------------------------- + # Default 4DVAR + if self._parameters["Variant"] in ["4DVAR", "4DVAR-Std"]: + NumericObjects.std4dvar(self, Xb, Y, U, HO, EM, CM, R, B, Q) # - if CM is not None and "Tangent" in CM and U is not None: - Cm = CM["Tangent"].asMatrix(Xb) + #-------------------------- else: - Cm = None - # - def Un(_step): - if U is not None: - if hasattr(U,"store") and 1<=_step