#include "SALOME_Component.idl"
#include "SALOMEDS.idl"
#include "SALOME_Exception.idl"
+#include "SALOME_Parametric.idl"
module GENERICSOLVER_ORB
{
-
- typedef sequence<double> Value;
- typedef sequence<string> VarList;
- typedef sequence<Value> ValueList;
-
- struct InputDescription {
- VarList inputVarList;
- VarList outputVarList;
- ValueList inputValues;
- };
-
interface DEVIATION_Gen : Engines::Component, SALOMEDS::Driver
{
* of the output variables.
* @param outputValues the result of the computation
*/
- void Exec(in InputDescription inputDesc, out ValueList outputValues)
+ void Exec(in SALOME_Parametric::ParametricInput paramInput,
+ out SALOME_Parametric::ParametricOutput paramOutput)
raises (SALOME::SALOME_Exception);
/**
<type-list>
<sequence name="Point" content="double"/>
<objref name="pyobj" id="python:obj:1.0"/>
-
- <sequence content="double" name="GENERICSOLVER_ORB/Value"></sequence>
- <sequence content="string" name="GENERICSOLVER_ORB/VarList"></sequence>
- <sequence content="GENERICSOLVER_ORB/Value" name="GENERICSOLVER_ORB/ValueList"></sequence>
- <struct name="GENERICSOLVER_ORB/InputDescription">
- <member type="GENERICSOLVER_ORB/VarList" name="inputVarList"></member>
- <member type="GENERICSOLVER_ORB/VarList" name="outputVarList"></member>
- <member type="GENERICSOLVER_ORB/ValueList" name="inputValues"></member>
+ <struct name="SALOME_Parametric/Parameter">
+ <member type="string" name="name"></member>
+ <member type="string" name="value"></member>
+ </struct>
+ <sequence content="SALOME_Parametric/Parameter" name="SALOME_Parametric/ParameterList"></sequence>
+ <sequence content="double" name="Value1D"></sequence>
+ <sequence content="Value1D" name="SALOME_Parametric/Value"></sequence>
+ <sequence content="string" name="SALOME_Parametric/VarList"></sequence>
+ <sequence content="SALOME_Parametric/Value" name="SALOME_Parametric/ValueList"></sequence>
+ <struct name="SALOME_Parametric/ParametricInput">
+ <member type="SALOME_Parametric/VarList" name="inputVarList"></member>
+ <member type="SALOME_Parametric/VarList" name="outputVarList"></member>
+ <member type="SALOME_Parametric/ValueList" name="inputValues"></member>
+ <member type="SALOME_Parametric/ParameterList" name="specificParameters"></member>
+ </struct>
+ <struct name="SALOME_Parametric/ParametricOutput">
+ <member type="SALOME_Parametric/ValueList" name="outputValues"></member>
+ <member type="SALOME_Parametric/ParameterList" name="specificOutputInfos"></member>
+ <member type="long" name="returnCode"></member>
+ <member type="string" name="errorMessage"></member>
</struct>
- </type-list>
+ </type-list>
<!-- Component list -->
<component-list>
<!-- service-connexion -->
<inParameter-list>
<inParameter>
- <inParameter-name>inputDesc</inParameter-name>
- <inParameter-type>GENERICSOLVER_ORB/InputDescription</inParameter-type>
+ <inParameter-name>paramInput</inParameter-name>
+ <inParameter-type>SALOME_Parametric/ParametricInput</inParameter-type>
</inParameter>
</inParameter-list>
<outParameter-list>
<outParameter>
- <outParameter-name>outputValues</outParameter-name>
- <outParameter-type>GENERICSOLVER_ORB/ValueList</outParameter-type>
+ <outParameter-name>paramOutput</outParameter-name>
+ <outParameter-type>SALOME_Parametric/ParametricOutput</outParameter-type>
</outParameter>
</outParameter-list>
</component-service>
import SALOME_ComponentPy
import SALOME_DriverPy
import SALOME
+import SALOME_Parametric
from salome.kernel.logger import Logger
from salome.kernel import termcolor
except:
self._raiseSalomeError()
- def Exec(self, inputDesc):
+ def Exec(self, paramInput):
"""
This method is an example for the execution of a computation component for
use with OpenTURNS in SALOME 5.1.5 and later (for YACS integration)
"""
try:
logger.info("Exec: " + self._containerName + ' ; ' + self._instanceName)
- logger.debug("inputVarList: %s" % inputDesc.inputVarList)
- logger.debug("outputVarList: %s" % inputDesc.outputVarList)
- logger.debug("inputValues: %s" % inputDesc.inputValues)
- if len(inputDesc.inputValues) != len(inputDesc.inputVarList):
+ logger.debug("inputVarList: %s" % paramInput.inputVarList)
+ logger.debug("outputVarList: %s" % paramInput.outputVarList)
+ logger.debug("inputValues: %s" % paramInput.inputValues)
+ if len(paramInput.inputValues) != len(paramInput.inputVarList):
raise Exception("Size mismatch between inputVarList and point to evaluate")
evalPoint = self.deterministicValues
- for i in range(len(inputDesc.inputVarList)):
- evalPoint[inputDesc.inputVarList[i]] = inputDesc.inputValues[i][0]
+ for i in range(len(paramInput.inputVarList)):
+ evalPoint[paramInput.inputVarList[i]] = paramInput.inputValues[i][0][0]
logger.debug("evalPoint = %s" % evalPoint)
resDict = {}
resDict["dev"] = self.BeamModel(**evalPoint)
outputValues = []
- for outputVar in inputDesc.outputVarList:
- outputValues.append([resDict[outputVar]])
- logger.debug("outputValues: %s" % outputValues)
- return outputValues
+ for outputVar in paramInput.outputVarList:
+ outputValues.append([[resDict[outputVar]]])
+ logger.debug("paramOutput: %s" % outputValues)
+ return SALOME_Parametric.ParametricOutput(outputValues,
+ specificOutputInfos = [],
+ returnCode = 0,
+ errorMessage = "")
except:
self._raiseSalomeError()