From: Jean-Philippe ARGAUD Date: Wed, 10 Mar 2021 05:26:56 +0000 (+0100) Subject: Minor improvements and fixes for internal variables X-Git-Tag: V9_7_0b1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7c977859cfca79378b6a22e80cb3c26d973d7202;p=modules%2Fadao.git Minor improvements and fixes for internal variables --- 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