- 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(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 paramInput.outputVarList:
- outputValues.append([[resDict[outputVar]]])
- logger.debug("paramOutput: %s" % outputValues)
- return SALOME_TYPES.ParametricOutput(outputValues,
- specificOutputInfos = [],
- returnCode = 0,
- errorMessage = "")
+
+ inputDict = create_input_dict(self.deterministicValues, paramInput)
+ logger.debug("inputDict = %s" % inputDict)
+
+ # Test for an invalid parameter and return an error in this case
+ if inputDict["L"] <= 0:
+ return create_error_parametric_output("Invalid value: L must be positive")
+
+ outputDict = {}
+ outputDict["dev"] = self.BeamModel(**inputDict)
+
+ paramOutput = create_normal_parametric_output(outputDict, paramInput)
+ logger.debug("outputValues: %s" % paramOutput.outputValues)
+ return paramOutput