#
# ==============================================================================
#
-def FunctionH( XX ):
+def DirectOperator( XX ):
""" Direct non-linear simulation operator """
#
# --------------------------------------> EXAMPLE TO BE REMOVED
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])
#
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) ):
#
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 )
from Physical_data_and_covariance_matrices import True_state
X0, noms = True_state()
- FX = FunctionH( X0 )
+ FX = DirectOperator( X0 )
print "FX =", FX
print
# 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
# ---------------------