]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Nouvelle structure <<<<>>>>
authorAndré Ribes <andre.ribes@edf.fr>
Fri, 8 Apr 2011 08:33:28 +0000 (10:33 +0200)
committerAndré Ribes <andre.ribes@edf.fr>
Fri, 8 Apr 2011 08:33:28 +0000 (10:33 +0200)
doc/Makefile.am
resources/ADAOSchemaCatalog.xml
src/daSalome/daYacsIntegration/daOptimizerLoop.py
src/tests/daSalome/test017_3DVAR_function_script.py

index e6b9f3398018bbaab995fd9fa4d83b7f8258173c..c9e79339fd42f3af61eb235d7178e3455d11593c 100644 (file)
@@ -12,6 +12,7 @@ EXTRA_DIST = main.rst intro.rst conf.py
 install-data-local:
        make html
        ${mkinstalldirs} $(DESTDIR)$(docdir)
+       ${mkinstalldirs} $(salomeresdir)
        cp -R $(BUILDDIR)/html/* $(DESTDIR)$(docdir)
        cp $(SRCDIR)/resources/*.png $(salomeresdir)
        cp $(SRCDIR)/images/eficas_*.png $(salomeresdir)
index 9190aea11df0b1a2c755063cd6f5bd0912e09fb6..2f58cc86ae3221be4ca8741cfa24bb99cc844ec5 100644 (file)
     <member type="string" name="value"></member>
   </struct>
   <sequence content="SALOME_TYPES/Parameter" name="SALOME_TYPES/ParameterList"></sequence>
-  <sequence content="double" name="Value1D"></sequence>
-  <sequence content="Value1D" name="SALOME_TYPES/Value"></sequence>
+  <sequence content="double" name="SALOME_TYPES/Variable"></sequence>
+  <sequence content="SALOME_TYPES/Variable" name="SALOME_TYPES/VariableSequence"></sequence>
+  <sequence content="SALOME_TYPES/VariableSequence" name="SALOME_TYPES/StateSequence"></sequence>
+  <sequence content="SALOME_TYPES/StateSequence" name="SALOME_TYPES/TimeSequence"></sequence>
   <sequence content="string" name="SALOME_TYPES/VarList"></sequence>
-  <sequence content="SALOME_TYPES/Value" name="SALOME_TYPES/ValueList"></sequence>
   <struct name="SALOME_TYPES/ParametricInput">
     <member type="SALOME_TYPES/VarList" name="inputVarList"></member>
     <member type="SALOME_TYPES/VarList" name="outputVarList"></member>
-    <member type="SALOME_TYPES/ValueList" name="inputValues"></member>
+    <member type="SALOME_TYPES/TimeSequence" name="inputValues"></member>
     <member type="SALOME_TYPES/ParameterList" name="specificParameters"></member>
   </struct>
   <struct name="SALOME_TYPES/ParametricOutput">
-    <member type="SALOME_TYPES/ValueList" name="outputValues"></member>
+    <member type="SALOME_TYPES/TimeSequence" name="outputValues"></member>
     <member type="SALOME_TYPES/ParameterList" name="specificOutputInfos"></member>
     <member type="long" name="returnCode"></member>
     <member type="string" name="errorMessage"></member>
index e29795b9f5e715167f8c1946a1fa4acf4359f054..af765ad99d8f0ef12f23dcf1b30e0bc9e7977145 100644 (file)
@@ -48,21 +48,23 @@ class OptimizerHooks:
     #print data.flatten()
     #print data.flatten().shape
 
-    parameter_1D = pilot.SequenceAny_New(self.optim_algo.runtime.getTypeCode("double"))
-    parameter_2D = pilot.SequenceAny_New(parameter_1D.getType())
-    parameters_3D = pilot.SequenceAny_New(parameter_2D.getType())
+    variable          = pilot.SequenceAny_New(self.optim_algo.runtime.getTypeCode("double"))
+    variable_sequence = pilot.SequenceAny_New(variable.getType())
+    state_sequence    = pilot.SequenceAny_New(variable_sequence.getType())
+    time_sequence     = pilot.SequenceAny_New(state_sequence.getType())
 
     print "Input Data", data
     if isinstance(data, type((1,2))):
-      self.add_parameters(data[0], parameter_2D)
-      self.add_parameters(data[1], parameter_2D, Output=True)
+      self.add_parameters(data[0], variable_sequence)
+      self.add_parameters(data[1], variable_sequence, Output=True) # Output == Y
     else:
-      self.add_parameters(data, parameter_2D)
-    parameters_3D.pushBack(parameter_2D)
-    sample.setEltAtRank("inputValues", parameters_3D)
+      self.add_parameters(data, variable_sequence)
+    state_sequence.pushBack(variable_sequence)
+    time_sequence.pushBack(state_sequence)
+    sample.setEltAtRank("inputValues", time_sequence)
     return sample
 
-  def add_parameters(self, data, parameter_2D, Output=False):
+  def add_parameters(self, data, variable_sequence, Output=False):
     param = pilot.SequenceAny_New(self.optim_algo.runtime.getTypeCode("double"))
     elt_list = 0 # index dans la liste des arguments
     val_number = 0 # nbre dans l'argument courant
@@ -78,7 +80,7 @@ class OptimizerHooks:
       # Test si l'argument est ok
       if val_end != -1:
         if val_number == val_end:
-          parameter_2D.pushBack(param)
+          variable_sequence.pushBack(param)
           param = pilot.SequenceAny_New(self.optim_algo.runtime.getTypeCode("double"))
           val_number = 0
           elt_list += 1
@@ -93,7 +95,7 @@ class OptimizerHooks:
             else:
               break
     if val_end == -1:
-      parameter_2D.pushBack(param)
+      variable_sequence.pushBack(param)
 
   def get_data_from_any(self, any_data):
     error = any_data["returnCode"].getIntValue()
@@ -102,9 +104,10 @@ class OptimizerHooks:
 
     data = []
     outputValues = any_data["outputValues"]
-    for param in outputValues[0]:
-      for i in range(param.size()):
-        data.append(param[i].getDoubleValue())
+    print outputValues
+    for variable in outputValues[0][0]:
+      for i in range(variable.size()):
+        data.append(variable[i].getDoubleValue())
 
     matrix = numpy.matrix(data).T
     return matrix
index 3581d9e953b8a782333b9c44cada39192fb11cda..536a0e53df8fb42d25293f0516443db0f74e01ed 100644 (file)
@@ -17,20 +17,23 @@ def FunctionH( X ):
 def AdjointH( (X, Y) ):
     return H.T * Y
 
+print computation["inputValues"][0][0][0]
+print computation["inputValues"][0][0][0][0]
+
 if method == "Direct":
-  data = FunctionH(numpy.matrix(computation["inputValues"][0][0]).T)
+  data = FunctionH(numpy.matrix(computation["inputValues"][0][0][0]).T)
 
 if method == "Tangent":
-  data = FunctionH(numpy.matrix(computation["inputValues"][0][0]).T)
+  data = FunctionH(numpy.matrix(computation["inputValues"][0][0][0]).T)
 
 if method == "Adjoint":
-  data = AdjointH((numpy.matrix(computation["inputValues"][0][0]).T, numpy.matrix(computation["inputValues"][0][1]).T))
+  data = AdjointH((numpy.matrix(computation["inputValues"][0][0][0]).T, numpy.matrix(computation["inputValues"][0][0][1]).T))
 
 
-outputValues = [[[]]]
+outputValues = [[[[]]]]
 it = data.flat
 for val in it:
-  outputValues[0][0].append(val)
+  outputValues[0][0][0].append(val)
 
 print outputValues