From: Jean-Philippe ARGAUD Date: Fri, 19 Apr 2013 09:05:12 +0000 (+0200) Subject: Remove misused names in examples X-Git-Tag: V7_2_0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=832f93b3e4606934748123e9e56386ee07335ee4;p=modules%2Fadao.git Remove misused names in examples --- diff --git a/examples/daSkeletons/External_data_definition_by_scripts/Physical_simulation_functions.py b/examples/daSkeletons/External_data_definition_by_scripts/Physical_simulation_functions.py index b189a7c..a1fadfc 100644 --- a/examples/daSkeletons/External_data_definition_by_scripts/Physical_simulation_functions.py +++ b/examples/daSkeletons/External_data_definition_by_scripts/Physical_simulation_functions.py @@ -34,7 +34,7 @@ import os, numpy, time # # ============================================================================== # -def FunctionH( XX ): +def DirectOperator( XX ): """ Direct non-linear simulation operator """ # # --------------------------------------> EXAMPLE TO BE REMOVED @@ -62,8 +62,8 @@ def TangentHMatrix( X, increment = 0.01, centeredDF = False ): X_moins_dXi = numpy.array( X.A1 ) X_moins_dXi[i] = X[i] - dX[i] # - HX_plus_dXi = FunctionH( X_plus_dXi ) - HX_moins_dXi = FunctionH( X_moins_dXi ) + HX_plus_dXi = DirectOperator( X_plus_dXi ) + HX_moins_dXi = DirectOperator( X_moins_dXi ) # HX_Diff = ( HX_plus_dXi - HX_moins_dXi ) / (2.*dX[i]) # @@ -76,11 +76,11 @@ def TangentHMatrix( X, increment = 0.01, centeredDF = False ): X_plus_dXi = numpy.array( X.A1 ) X_plus_dXi[i] = X[i] + dX[i] # - HX_plus_dXi = FunctionH( X_plus_dXi ) + HX_plus_dXi = DirectOperator( X_plus_dXi ) # HX_plus_dX.append( HX_plus_dXi ) # - HX = FunctionH( X ) + HX = DirectOperator( X ) # Jacobian = [] for i in range( len(dX) ): @@ -90,13 +90,13 @@ def TangentHMatrix( X, increment = 0.01, centeredDF = False ): # return Jacobian # -def TangentH( X ): +def TangentOperator( X ): """ Tangent operator """ _X = numpy.asmatrix(X).flatten().T HtX = self.TangentHMatrix( _X ) * _X return HtX.A1 # -def AdjointH( (X, Y) ): +def AdjointOperator( (X, Y) ): """ Ajoint operator """ # Jacobian = TangentHMatrix( X, centeredDF = False ) @@ -116,6 +116,6 @@ if __name__ == "__main__": from Physical_data_and_covariance_matrices import True_state X0, noms = True_state() - FX = FunctionH( X0 ) + FX = DirectOperator( X0 ) print "FX =", FX print diff --git a/examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py b/examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py index 4ff3b09..640bdd6 100644 --- a/examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py +++ b/examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py @@ -53,27 +53,27 @@ logging.info("ComputationFunctionNode: Found method is \'%s\'"%method) # Loading the H operator functions from external definitions # ---------------------------------------------------------- logging.info("ComputationFunctionNode: Loading operator functions") -FunctionH = Physical_simulation_functions.FunctionH -TangentH = Physical_simulation_functions.TangentH -AdjointH = Physical_simulation_functions.AdjointH +DirectOperator = Physical_simulation_functions.DirectOperator +TangentOperator = Physical_simulation_functions.TangentOperator +AdjointOperator = Physical_simulation_functions.AdjointOperator # # Executing the possible computations # ----------------------------------- if method == "Direct": logging.info("ComputationFunctionNode: Direct computation") Xcurrent = computation["inputValues"][0][0][0] - data = FunctionH(numpy.matrix( Xcurrent ).T) + data = DirectOperator(numpy.matrix( Xcurrent ).T) # if method == "Tangent": logging.info("ComputationFunctionNode: Tangent computation") Xcurrent = computation["inputValues"][0][0][0] - data = TangentH(numpy.matrix( Xcurrent ).T) + data = TangentOperator(numpy.matrix( Xcurrent ).T) # if method == "Adjoint": logging.info("ComputationFunctionNode: Adjoint computation") Xcurrent = computation["inputValues"][0][0][0] Ycurrent = computation["inputValues"][0][0][1] - data = AdjointH((numpy.matrix( Xcurrent ).T, numpy.matrix( Ycurrent ).T)) + data = AdjointOperator((numpy.matrix( Xcurrent ).T, numpy.matrix( Ycurrent ).T)) # # Formatting the output # ---------------------