1 # Copyright (C) 2010-2013 EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 # Author: André Ribes, andre.ribes@edf.fr, EDF R&D
24 sys.path.insert(0, init_data['SOURCES_ROOT'])
25 import test_aster_zzzz159a_aster_functions as Code_Aster
27 # Configuration du module
28 Code_Aster.debug = init_data["debug"]
29 Code_Aster.ASTER_ROOT = init_data["ASTER_ROOT"]
30 Code_Aster.SOURCES_ROOT = init_data['SOURCES_ROOT']
31 Code_Aster.export = init_data["export"]
32 Code_Aster.calcul = init_data["calcul"]
33 Code_Aster.parametres = init_data["parametres"]
34 Code_Aster.python_version = init_data["python_version"]
38 for param in computation["specificParameters"]:
39 if param["name"] == "method":
40 method = param["value"]
42 # Extraction des données et remise en forme (normalement à faire
44 # On sait qu'on a trois variables
47 input_data.append(computation["inputValues"][0][0][i][0])
49 if method == "Adjoint":
50 input_data = (input_data, [])
53 input_data[1].append(computation["inputValues"][0][0][3][i])
55 input_data[1].append(computation["inputValues"][0][0][4][i-11])
58 result["specificOutputInfos"] = []
59 result["returnCode"] = 0
60 result["errorMessage"] = ""
62 outputValues = [[[[]]]]
63 if method == "Direct":
64 output_data = Code_Aster.Calcul_Aster_Ponctuel(input_data)
65 outputValues[0][0] = [[],[]]
68 outputValues[0][0][0].append(output_data[i])
70 outputValues[0][0][1].append(output_data[i])
72 if method == "Tangent":
73 output_data = Code_Aster.Calcul_Aster_Ponctuel(input_data)
74 outputValues[0][0] = [[],[]]
77 outputValues[0][0][0].append(output_data[i])
79 outputValues[0][0][1].append(output_data[i])
81 if method == "Adjoint":
82 output_data = Code_Aster.Calcul_Aster_Adjoint(input_data)
83 outputValues[0][0] = [[],[],[]]
84 outputValues[0][0][0].append(output_data[0])
85 outputValues[0][0][1].append(output_data[1])
86 outputValues[0][0][2].append(output_data[2])
88 result["outputValues"] = outputValues
90 print "Computation end"