This box is type PresetNode's elementary node. Its only function is to initialize the variable MeshFile that contains the name of the file of the initial mesh.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 38-42
Etude_Initialisation
The python node StudyCreation initialize the SALOME study that is given through the output:
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 44-62
The service SetCurrentStudy connects this study to an instance of HOMARD.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 63-68
This box is a node python that takes in input a character string, MessInfo. If everything passed well, this message is empty. A window QT appears to confirm the convergence. If there was a problem, the message contains messages emitted during the calculations. The window QT shows this message.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 406-419
This box is a node python that is going to drive the calculation. In input, we find the number of the calculation (0 at first) and the name of the file which contains the mesh on which to calculate. In output, we find an integer which represents the error on this calculation (0 so everything goes well) and a dictionary python gathering the results of the calculation. The body of the node is established by the launch of a script python that activates the calculation.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 77-103
In this example, we must define:
This box begins by creating the case HOMARD by calling the CreateCase service.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 208-215
The name of the case CaseName is imposed on "Calcul". The name of the case MeshName is imposed on "BOX". The parameters of input FileName arise from the output of the previous calculation. The parameter of output is an instance of case.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 443-446
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 483-486
-The options of this case must be now given. It is made by the node python CaseOptions. It is imperative to give the directory of calculation. We shall look at the description of the functions in:ref: ' tui_create_case '. In output, we get back the instance of the iteration corresponding to the initial state of the case.
+The options of this case must be now given. It is made by the node python CaseOptions. It is imperative to give the directory of calculation. We shall look at the description of the functions in :ref:`tui_create_case`. In output, we get back the instance of the iteration corresponding to the initial state of the case.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 216-228
-Finally, a hypothesis is created by calling the CreateHypothèse service. The parameter of output is an instance of hypothese.
+Finally, a hypothesis is created by calling the CreateHypothese service. The parameter of output is an instance of hypothese.
Homard_Exec
^^^^^^^^^^^
The directory of calculation is recovered. The name of the mesh is given.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 245-250
../..
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 325-333
The hypothesis transmitted in input parameter characterized (look :ref:`tui_create_hypothese`) :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 254-278
It is necessary to establish a name for the future iteration. To make sure that the name was never used, one installs a mechanism of incremental naming starting from the name of the initial iteration. As this initial name is the name of the initial mesh, one obtains a succession of names in the form: M_001, M_002, M_003, etc
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 280-290
The iteration is supplemented : hypothesis, future mesh, field (look :ref:`tui_create_iteration`) :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 292-311
The iteration is calculated. If it were correct, variable OK equals 1: one will be able to continue the execution of the scheme. If there were a problem, variable OK equals 0 to mean that calculation must stop; an error message then is given.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 313-324
After this execution, the process leaves the Adaptation_HOMARD node, then Adaptation node. One arrives then at the node of analysis.
The Arret_boucle block is present to only make forward variables because the input parameters of the nodes must always be filled. It is a very simple python:
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 173-184
Analyse
The Analyse block is a script python which ensures the complete control of the process by examining the causes of possible error successively.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 104-116
../..
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 162-170
One starts by analyzing the return of the computer code:
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 118-123
Checking of the presence of the name of the result file in the dictionary of the results:
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 125-132
Checking of convergence. That supposes that the value to be tested is present in the dictionary under the key 'V_TEST'. Here, one set up a test on the variation of the value of one calculation at the other. With the first passage, nothing is tested. In the following passing, one tests if the relative variation is lower than 1 thousandths. One could have set up an absolute test if one had recovered a total level of error for example.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 134-152
Lastly, it is checked that a maximum nomber of adaptations is not exceeded:
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.en.xml
:lines: 154-159
Use this scheme
***************
To reproduce this example, download:
- * :download:`the scheme <../files/yacs_01.xml>`
+ * :download:`the scheme <../files/yacs_01.en.xml>`
* :download:`an example of python script <../files/yacs_script.py>`
It should be adapted to simulation considered. In particular, it is necessary:
--- /dev/null
+<?xml version='1.0' encoding='iso-8859-1' ?>
+<proc name="HOMARD">
+ <property name="DefaultStudyID" value="1"/>
+ <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
+ <type name="string" kind="string"/>
+ <struct name="Engines/dataref">
+ <member name="ref" type="string"/>
+ </struct>
+ <objref name="HOMARD_Boundary" id="IDL:HOMARD/HOMARD_Boundary:1.0"/>
+ <objref name="HOMARD_Cas" id="IDL:HOMARD/HOMARD_Cas:1.0"/>
+ <objref name="HOMARD_Hypothesis" id="IDL:HOMARD/HOMARD_Hypothesis:1.0"/>
+ <objref name="HOMARD_Iteration" id="IDL:HOMARD/HOMARD_Iteration:1.0"/>
+ <objref name="HOMARD_Zone" id="IDL:HOMARD/HOMARD_Zone:1.0"/>
+ <objref name="Study" id="IDL:SALOMEDS/Study:1.0"/>
+ <type name="bool" kind="bool"/>
+ <sequence name="boolvec" content="bool"/>
+ <type name="double" kind="double"/>
+ <sequence name="dblevec" content="double"/>
+ <objref name="file" id="file"/>
+ <type name="int" kind="int"/>
+ <sequence name="intvec" content="int"/>
+ <struct name="stringpair">
+ <member name="name" type="string"/>
+ <member name="value" type="string"/>
+ </struct>
+ <sequence name="propvec" content="stringpair"/>
+ <objref name="pyobj" id="python:obj:1.0"/>
+ <sequence name="seqboolvec" content="boolvec"/>
+ <sequence name="seqdblevec" content="dblevec"/>
+ <sequence name="seqint" content="int"/>
+ <sequence name="seqintvec" content="intvec"/>
+ <sequence name="stringvec" content="string"/>
+ <sequence name="seqstringvec" content="stringvec"/>
+ <container name="DefaultContainer">
+ <property name="container_name" value="FactoryServer"/>
+ <property name="name" value="localhost"/>
+ </container>
+ <datanode name="DataInit">
+ <parameter name="MeshFile" type="string">
+ <value><string>/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/maill.00.med</string></value>
+ </parameter>
+ </datanode>
+ <bloc name="Etude_Initialisation">
+ <inline name="StudyCreation">
+ <script><code><![CDATA[
+import orbmodule
+import SALOMEDS_idl
+
+import HOMARD
+import HOMARD_Gen_idl
+import HOMARD_Cas_idl
+import HOMARD_Iteration_idl
+import HOMARD_Hypothesis_idl
+import HOMARD_Zone_idl
+import HOMARD_Boundary_idl
+
+clt = orbmodule.client()
+StudyManager = clt.Resolve("/myStudyManager")
+NewStudy = StudyManager.NewStudy("my_homard_study")
+]]></code></script>
+ <outport name="NewStudy" type="Study"/>
+ </inline>
+ <service name="SetCurrentStudy">
+ <component>HOMARD</component>
+ <load container="DefaultContainer"/>
+ <method>SetCurrentStudy</method>
+ <inport name="theStudy" type="Study"/>
+ </service>
+ <control> <fromnode>StudyCreation</fromnode> <tonode>SetCurrentStudy</tonode> </control>
+ <datalink control="false">
+ <fromnode>StudyCreation</fromnode> <fromport>NewStudy</fromport>
+ <tonode>SetCurrentStudy</tonode> <toport>theStudy</toport>
+ </datalink>
+ </bloc>
+ <while name="Boucle_de_convergence">
+ <bloc name="Alternance_Calcul_HOMARD">
+ <inline name="Calcul">
+ <script><code><![CDATA[
+import sys
+import os
+#
+rep_calc = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+rep_script = os.path.dirname("/scratch/D68518/Salome/HOMARD_SALOME/HOMARD_SRC/doc/files/ScriptAster.py")
+sys.path.append(rep_script)
+from ScriptAster import Script
+#
+argu = ["-v"]
+argu.append("--rep_calc=" + rep_calc)
+argu.append("--num=%d" % numCalc)
+argu.append("--mesh_file=" + MeshFile)
+#
+Script_A = Script(argu)
+#
+Error, message_erreur, dico_resu = Script_A.compute ()
+#
+dico_resu["rep_calc"] = rep_calc
+#
+]]></code></script>
+ <inport name="numCalc" type="int"/>
+ <inport name="MeshFile" type="string"/>
+ <outport name="Error" type="int"/>
+ <outport name="dico_resu" type="pyobj"/>
+ </inline>
+ <inline name="Analyse">
+ <script><code><![CDATA[
+global NumCalc
+global resu1
+# Default values
+NumCalcP1 = NumCalc + 1
+FileName = " "
+#
+NbCalcMax = 5
+#
+MessInfo = None
+Error = 0
+while not Error :
+#
+# If the computation failed, stop:
+#
+ if ErrCalc :
+ MessInfo = "Computation error # %d" % ErrCalc
+ Error = abs(ErrCalc)
+ break
+#
+# If the file is not defined, stop:
+#
+ if dico_resu.has_key("FileName") :
+ FileName = dico_resu["FileName"]
+ else :
+ MessInfo = "The file for the mesh is not defined."
+ Error = -2
+ break
+#
+# If the criterion is satisfied, stop:
+#
+ if dico_resu.has_key("V_TEST") :
+ valeur_v = dico_resu["V_TEST"]
+ if NumCalc == 0 :
+ resu1 = [valeur_v]
+ else :
+ resu1.append(valeur_v)
+ if NumCalc > 2 :
+ solu_m1 = resu1[-2]
+ rap = ( resu1[-1] - solu_m1 ) / solu_m1
+ if abs(rap) < 0.001 :
+ MessInfo = ""
+ Error = -9999
+ break
+ else :
+ MessInfo = "The value for the test is not available."
+ Error = -3
+ break
+#
+# If the maximum number of adaptations is reached, stop:
+#
+ if NumCalc > NbCalcMax :
+ MessInfo = "The maximum number of adaptations is reached: %d" % NbCalcMax
+ Error = -1
+ break
+#
+ break
+]]></code></script>
+ <inport name="NumCalc" type="int"/>
+ <inport name="ErrCalc" type="int"/>
+ <inport name="dico_resu" type="pyobj"/>
+ <outport name="Error" type="int"/>
+ <outport name="NumCalcP1" type="int"/>
+ <outport name="FileName" type="string"/>
+ <outport name="MessInfo" type="string"/>
+ </inline>
+ <switch name="Adaptation" select="0">
+ <default>
+ <bloc name="Arret_boucle">
+ <inline name="Arret">
+ <script><code><![CDATA[
+OK = 0
+MeshFile = " "
+]]></code></script>
+ <inport name="MessInfo" type="string"/>
+ <outport name="OK" type="bool"/>
+ <outport name="MeshFile" type="string"/>
+ <outport name="MessInfo" type="string"/>
+ </inline>
+ </bloc>
+ </default>
+ <case id="0">
+ <bloc name="Adaptation_HOMARD">
+ <switch name="HOMARD_Initialisation" select="0">
+ <default>
+ <bloc name="Iter_n">
+ <service name="LastIteration">
+ <node>Etude_Initialisation.SetCurrentStudy</node>
+ <method>LastIteration</method>
+ <inport name="CaseName" type="string"/>
+ <outport name="return" type="HOMARD_Iteration"/>
+ </service>
+ <service name="GetHypothesis">
+ <node>Etude_Initialisation.SetCurrentStudy</node>
+ <method>GetHypothesis</method>
+ <inport name="HypoName" type="string"/>
+ <outport name="return" type="HOMARD_Hypothesis"/>
+ </service>
+ <control> <fromnode>LastIteration</fromnode> <tonode>GetHypothesis</tonode> </control>
+ </bloc>
+ </default>
+ <case id="1">
+ <bloc name="Iter_1">
+ <service name="CreateCase">
+ <node>Etude_Initialisation.SetCurrentStudy</node>
+ <method>CreateCase</method>
+ <inport name="CaseName" type="string"/>
+ <inport name="MeshName" type="string"/>
+ <inport name="FileName" type="string"/>
+ <outport name="return" type="HOMARD_Cas"/>
+ </service>
+ <inline name="Case_Options">
+ <script><code><![CDATA[
+import os
+# Directory for the adaptation
+DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/HOMARD"
+Case.SetDirName(DirName)
+Case.SetConfType(1)
+# Associated iteration #0
+Iter0 = Case.GetIter0()
+]]></code></script>
+ <inport name="Case" type="HOMARD_Cas"/>
+ <outport name="Iter0" type="HOMARD_Iteration"/>
+ </inline>
+ <service name="CreateHypothesis">
+ <node>Etude_Initialisation.SetCurrentStudy</node>
+ <method>CreateHypothesis</method>
+ <inport name="HypoName" type="string"/>
+ <outport name="return" type="HOMARD_Hypothesis"/>
+ </service>
+ <control> <fromnode>CreateCase</fromnode> <tonode>Case_Options</tonode> </control>
+ <control> <fromnode>Case_Options</fromnode> <tonode>CreateHypothesis</tonode> </control>
+
+ <datalink control="false">
+ <fromnode>CreateCase</fromnode> <fromport>return</fromport>
+ <tonode>Case_Options</tonode> <toport>Case</toport>
+ </datalink>
+ </bloc>
+ </case>
+ </switch>
+ <inline name="HOMARD_Exec">
+ <script><code><![CDATA[
+import os
+# Directory for the computation
+DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+MeshName = "BOX"
+#
+# Hypothesis
+# ==========
+# . Name of the hypothesis
+# ------------------------
+HypoName = Hypo.GetName()
+#
+# . Options
+# ---------
+# . Type of adaptation: refinement and unrefinement driven by a field
+Hypo.SetAdapRefinUnRef(1, 1, 1)
+# . Name of the field
+Hypo.SetField("ERREUR")
+# . Values over meshes
+Hypo.SetUseField(0)
+# . Compoment
+Hypo.AddComp("ERTABS")
+# . Driving options
+Hypo.SetRefinThr(4, 3)
+Hypo.SetUnRefThr(4, 4)
+#
+# . Interpolation
+Hypo.SetTypeFieldInterp(2)
+Hypo.AddFieldInterp("TEMPERATURE")
+#
+# . Minimum limit size of the meshes
+aux = 0.0015
+Hypo.SetDiamMin(aux)
+#
+# Name of the next iteration
+# ==========================
+# . Name of the previous iteration
+LastIterName = LastIter.GetName()
+aux = '%03d' % NumAdapt
+# . At iteration #1, addition
+if NumAdapt == 1 :
+ IterName = LastIterName + "_" + aux
+# . Then, substitution
+else :
+ IterName = LastIterName[:-3] + aux
+#
+# Creation of the iteration
+# =========================
+Iter = LastIter.NextIteration(IterName)
+#
+# Options of the iteration
+# ========================
+# . Association de l'hypothese
+Iter.AssociateHypo(HypoName)
+#
+# . The name of the next mesh
+Iter.SetMeshName(MeshName)
+#
+# . The file of the next mesh
+aux = '%02d' % NumAdapt
+MeshFile = os.path.join (DirName, "maill."+aux+".med")
+Iter.SetMeshFile(MeshFile)
+#
+# . The file for the fields
+FileName = dico_resu["FileName"]
+Iter.SetFieldFile(FileName)
+#
+# Calculation
+# ===========
+Error = Iter.Compute(1,1)
+#
+# The loops stops if problem
+# ==========================
+if Error :
+ OK = 0
+ MessInfo = "Error in HOMARD in the adaptation # %d" % NumAdapt
+else :
+ OK = 1
+ MessInfo = " "
+]]></code></script>
+ <inport name="NumAdapt" type="int"/>
+ <inport name="LastIter" type="HOMARD_Iteration"/>
+ <inport name="Hypo" type="HOMARD_Hypothesis"/>
+ <inport name="dico_resu" type="pyobj"/>
+ <outport name="OK" type="bool"/>
+ <outport name="MessInfo" type="string"/>
+ <outport name="MeshFile" type="string"/>
+ </inline>
+ <control> <fromnode>HOMARD_Initialisation</fromnode> <tonode>HOMARD_Exec</tonode> </control>
+ <datalink control="false">
+ <fromnode>HOMARD_Initialisation.default_Iter_n.LastIteration</fromnode> <fromport>return</fromport>
+ <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>HOMARD_Initialisation.p1_Iter_1.Case_Options</fromnode> <fromport>Iter0</fromport>
+ <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>HOMARD_Initialisation.default_Iter_n.GetHypothesis</fromnode> <fromport>return</fromport>
+ <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</fromnode> <fromport>return</fromport>
+ <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
+ </datalink>
+ </bloc>
+ </case>
+ </switch>
+ <control> <fromnode>Calcul</fromnode> <tonode>Analyse</tonode> </control>
+ <control> <fromnode>Analyse</fromnode> <tonode>Adaptation</tonode> </control>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>Error</fromport>
+ <tonode>Adaptation</tonode> <toport>select</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Calcul</tonode> <toport>numCalc</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode> <toport>select</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode> <toport>FileName</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Adaptation.default_Arret_boucle.Arret</tonode> <toport>MessInfo</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Calcul</fromnode> <fromport>Error</fromport>
+ <tonode>Analyse</tonode> <toport>ErrCalc</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
+ <tonode>Analyse</tonode> <toport>dico_resu</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dico_resu</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MeshFile</fromport>
+ <tonode>Calcul</tonode> <toport>MeshFile</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MeshFile</fromport>
+ <tonode>Calcul</tonode> <toport>MeshFile</toport>
+ </datalink>
+ </bloc>
+ <datalink control="false">
+ <fromnode>Alternance_Calcul_HOMARD.Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Alternance_Calcul_HOMARD.Analyse</tonode> <toport>NumCalc</toport>
+ </datalink>
+ </while>
+ <inline name="Bilan">
+ <script><code><![CDATA[
+from PyQt4 import QtGui
+import sys
+app = QtGui.QApplication(sys.argv)
+MessageBoxTitle = "Bilan"
+if MessInfo == "" :
+ MessInfo = "The convergence is reached."
+ QtGui.QMessageBox.information(None, MessageBoxTitle, MessInfo)
+else :
+ QtGui.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
+]]></code></script>
+ <inport name="MessInfo" type="string"/>
+ </inline>
+ <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
+ <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Boucle_de_convergence</tonode> </control>
+ <control> <fromnode>Boucle_de_convergence</fromnode> <tonode>Bilan</tonode> </control>
+ <datalink control="false">
+ <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
+ <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
+ <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Bilan</tonode> <toport>MessInfo</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Bilan</tonode> <toport>MessInfo</toport>
+ </datalink>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>CaseName</toport>
+ <value><string>Calcul</string></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration</tonode><toport>CaseName</toport>
+ <value><string>Calcul</string></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
+ <value><string>Hypo</string></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
+ <value><string>Hypo</string></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence</tonode><toport>condition</toport>
+ <value><boolean>true</boolean></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>MeshName</toport>
+ <value><string>BOX</string></value>
+ </parameter>
+
+ <presentation name="__ROOT__" x="0" y="0" width="704" height="977" expanded="1" expx="0" expy="0" expWidth="704" expHeight="977" shownState="0"/>
+ <presentation name="DataInit" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+ <presentation name="Etude_Initialisation" x="175" y="32" width="158" height="38" expanded="0" expx="175" expy="32" expWidth="162.5" expHeight="40.5" shownState="1"/>
+ <presentation name="Etude_Initialisation.StudyCreation" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Etude_Initialisation.SetCurrentStudy" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence" x="4" y="103" width="569" height="514" expanded="1" expx="4" expy="103" expWidth="569" expHeight="514" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD" x="4" y="59" width="561" height="451" expanded="1" expx="10" expy="59" expWidth="561" expHeight="451" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse" x="181" y="32" width="158" height="171" expanded="1" expx="181" expy="32" expWidth="158" expHeight="171" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation" x="4" y="204" width="553" height="243" expanded="1" expx="4" expy="204" expWidth="553" expHeight="243" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD" x="202" y="59" width="347" height="180" expanded="1" expx="202" expy="59" expWidth="347" expHeight="180" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation" x="4" y="32" width="158" height="65" expanded="0" expx="4" expy="32" expWidth="167" expHeight="67.5" shownState="1"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="59" expWidth="162.5" expHeight="40.5" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.Case_Options" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="322" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="1639.5" expWidth="162.5" expHeight="40.5" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec" x="185" y="32" width="158" height="144" expanded="1" expx="185" expy="32" expWidth="158" expHeight="144" shownState="0"/>
+ <presentation name="Bilan" x="350" y="32" width="158" height="63" expanded="1" expx="350" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+</proc>
+
--- /dev/null
+<?xml version='1.0' encoding='iso-8859-1' ?>
+<proc name="HOMARD">
+ <property name="DefaultStudyID" value="1"/>
+ <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
+ <type name="string" kind="string"/>
+ <struct name="Engines/dataref">
+ <member name="ref" type="string"/>
+ </struct>
+ <objref name="HOMARD_Boundary" id="IDL:HOMARD/HOMARD_Boundary:1.0"/>
+ <objref name="HOMARD_Cas" id="IDL:HOMARD/HOMARD_Cas:1.0"/>
+ <objref name="HOMARD_Hypothesis" id="IDL:HOMARD/HOMARD_Hypothesis:1.0"/>
+ <objref name="HOMARD_Iteration" id="IDL:HOMARD/HOMARD_Iteration:1.0"/>
+ <objref name="HOMARD_Zone" id="IDL:HOMARD/HOMARD_Zone:1.0"/>
+ <objref name="Study" id="IDL:SALOMEDS/Study:1.0"/>
+ <type name="bool" kind="bool"/>
+ <sequence name="boolvec" content="bool"/>
+ <type name="double" kind="double"/>
+ <sequence name="dblevec" content="double"/>
+ <objref name="file" id="file"/>
+ <type name="int" kind="int"/>
+ <sequence name="intvec" content="int"/>
+ <struct name="stringpair">
+ <member name="name" type="string"/>
+ <member name="value" type="string"/>
+ </struct>
+ <sequence name="propvec" content="stringpair"/>
+ <objref name="pyobj" id="python:obj:1.0"/>
+ <sequence name="seqboolvec" content="boolvec"/>
+ <sequence name="seqdblevec" content="dblevec"/>
+ <sequence name="seqint" content="int"/>
+ <sequence name="seqintvec" content="intvec"/>
+ <sequence name="stringvec" content="string"/>
+ <sequence name="seqstringvec" content="stringvec"/>
+ <container name="DefaultContainer">
+ <property name="container_name" value="FactoryServer"/>
+ <property name="name" value="localhost"/>
+ </container>
+ <datanode name="DataInit">
+ <parameter name="MeshFile" type="string">
+ <value><string>/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/maill.00.med</string></value>
+ </parameter>
+ </datanode>
+ <bloc name="Etude_Initialisation">
+ <inline name="StudyCreation">
+ <script><code><![CDATA[
+import orbmodule
+import SALOMEDS_idl
+
+import HOMARD
+import HOMARD_Gen_idl
+import HOMARD_Cas_idl
+import HOMARD_Iteration_idl
+import HOMARD_Hypothesis_idl
+import HOMARD_Zone_idl
+import HOMARD_Boundary_idl
+
+clt = orbmodule.client()
+StudyManager = clt.Resolve("/myStudyManager")
+NewStudy = StudyManager.NewStudy("my_homard_study")
+]]></code></script>
+ <outport name="NewStudy" type="Study"/>
+ </inline>
+ <service name="SetCurrentStudy">
+ <component>HOMARD</component>
+ <load container="DefaultContainer"/>
+ <method>SetCurrentStudy</method>
+ <inport name="theStudy" type="Study"/>
+ </service>
+ <control> <fromnode>StudyCreation</fromnode> <tonode>SetCurrentStudy</tonode> </control>
+ <datalink control="false">
+ <fromnode>StudyCreation</fromnode> <fromport>NewStudy</fromport>
+ <tonode>SetCurrentStudy</tonode> <toport>theStudy</toport>
+ </datalink>
+ </bloc>
+ <while name="Boucle_de_convergence">
+ <bloc name="Alternance_Calcul_HOMARD">
+ <inline name="Calcul">
+ <script><code><![CDATA[
+import sys
+import os
+#
+rep_calc = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+rep_script = os.path.dirname("/scratch/D68518/Salome/HOMARD_SALOME/HOMARD_SRC/doc/files/ScriptAster.py")
+sys.path.append(rep_script)
+from ScriptAster import Script
+#
+argu = ["-v"]
+argu.append("--rep_calc=" + rep_calc)
+argu.append("--num=%d" % numCalc)
+argu.append("--mesh_file=" + MeshFile)
+#
+Script_A = Script(argu)
+#
+Error, message_erreur, dico_resu = Script_A.compute ()
+#
+dico_resu["rep_calc"] = rep_calc
+#
+]]></code></script>
+ <inport name="numCalc" type="int"/>
+ <inport name="MeshFile" type="string"/>
+ <outport name="Error" type="int"/>
+ <outport name="dico_resu" type="pyobj"/>
+ </inline>
+ <inline name="Analyse">
+ <script><code><![CDATA[
+global NumCalc
+global resu1
+# Valeurs par defaut
+NumCalcP1 = NumCalc + 1
+FileName = " "
+#
+NbCalcMax = 5
+#
+MessInfo = None
+Error = 0
+while not Error :
+#
+# Si le calcul a fini en erreur, on arrete :
+#
+ if ErrCalc :
+ MessInfo = "Erreur de calcul numero %d" % ErrCalc
+ Error = abs(ErrCalc)
+ break
+#
+# Si le fichier n'a pas ete defini, on arrete :
+#
+ if dico_resu.has_key("FileName") :
+ FileName = dico_resu["FileName"]
+ else :
+ MessInfo = "Le fichier du maillage n'a pas ete defini"
+ Error = -2
+ break
+#
+# Si le critere est respecte, on arrete :
+#
+ if dico_resu.has_key("V_TEST") :
+ valeur_v = dico_resu["V_TEST"]
+ if NumCalc == 0 :
+ resu1 = [valeur_v]
+ else :
+ resu1.append(valeur_v)
+ if NumCalc > 2 :
+ solu_m1 = resu1[-2]
+ rap = ( resu1[-1] - solu_m1 ) / solu_m1
+ if abs(rap) < 0.001 :
+ MessInfo = ""
+ Error = -9999
+ break
+ else :
+ MessInfo = "La valeur a tester n'a pas ete fournie"
+ Error = -3
+ break
+#
+# Si on depasse le maximum, on arrete :
+#
+ if NumCalc > NbCalcMax :
+ MessInfo = "La limite en nombre de calculs a ete atteinte : %d" % NbCalcMax
+ Error = -1
+ break
+#
+ break
+]]></code></script>
+ <inport name="NumCalc" type="int"/>
+ <inport name="ErrCalc" type="int"/>
+ <inport name="dico_resu" type="pyobj"/>
+ <outport name="Error" type="int"/>
+ <outport name="NumCalcP1" type="int"/>
+ <outport name="FileName" type="string"/>
+ <outport name="MessInfo" type="string"/>
+ </inline>
+ <switch name="Adaptation" select="0">
+ <default>
+ <bloc name="Arret_boucle">
+ <inline name="Arret">
+ <script><code><![CDATA[
+OK = 0
+MeshFile = " "
+]]></code></script>
+ <inport name="MessInfo" type="string"/>
+ <outport name="OK" type="bool"/>
+ <outport name="MeshFile" type="string"/>
+ <outport name="MessInfo" type="string"/>
+ </inline>
+ </bloc>
+ </default>
+ <case id="0">
+ <bloc name="Adaptation_HOMARD">
+ <switch name="HOMARD_Initialisation" select="0">
+ <default>
+ <bloc name="Iter_n">
+ <service name="LastIteration">
+ <node>Etude_Initialisation.SetCurrentStudy</node>
+ <method>LastIteration</method>
+ <inport name="CaseName" type="string"/>
+ <outport name="return" type="HOMARD_Iteration"/>
+ </service>
+ <service name="GetHypothesis">
+ <node>Etude_Initialisation.SetCurrentStudy</node>
+ <method>GetHypothesis</method>
+ <inport name="HypoName" type="string"/>
+ <outport name="return" type="HOMARD_Hypothesis"/>
+ </service>
+ <control> <fromnode>LastIteration</fromnode> <tonode>GetHypothesis</tonode> </control>
+ </bloc>
+ </default>
+ <case id="1">
+ <bloc name="Iter_1">
+ <service name="CreateCase">
+ <node>Etude_Initialisation.SetCurrentStudy</node>
+ <method>CreateCase</method>
+ <inport name="CaseName" type="string"/>
+ <inport name="MeshName" type="string"/>
+ <inport name="FileName" type="string"/>
+ <outport name="return" type="HOMARD_Cas"/>
+ </service>
+ <inline name="Case_Options">
+ <script><code><![CDATA[
+import os
+# Repertoire d'adaptation
+DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/HOMARD"
+Case.SetDirName(DirName)
+Case.SetConfType(1)
+# Iteration 0 associee
+Iter0 = Case.GetIter0()
+]]></code></script>
+ <inport name="Case" type="HOMARD_Cas"/>
+ <outport name="Iter0" type="HOMARD_Iteration"/>
+ </inline>
+ <service name="CreateHypothesis">
+ <node>Etude_Initialisation.SetCurrentStudy</node>
+ <method>CreateHypothesis</method>
+ <inport name="HypoName" type="string"/>
+ <outport name="return" type="HOMARD_Hypothesis"/>
+ </service>
+ <control> <fromnode>CreateCase</fromnode> <tonode>Case_Options</tonode> </control>
+ <control> <fromnode>Case_Options</fromnode> <tonode>CreateHypothesis</tonode> </control>
+
+ <datalink control="false">
+ <fromnode>CreateCase</fromnode> <fromport>return</fromport>
+ <tonode>Case_Options</tonode> <toport>Case</toport>
+ </datalink>
+ </bloc>
+ </case>
+ </switch>
+ <inline name="HOMARD_Exec">
+ <script><code><![CDATA[
+import os
+# Repertoire d'execution
+DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
+MeshName = "BOX"
+#
+# Hypothese
+# =========
+# . Nom de l'hypothese
+# --------------------
+HypoName = Hypo.GetName()
+#
+# . Options
+# ---------
+# . Le mode d'adaptation : raffinement et deraffinement selon un champ
+Hypo.SetAdapRefinUnRef(1, 1, 1)
+# . Nom du champ
+Hypo.SetField("ERREUR")
+# . Valeurs prises par maille
+Hypo.SetUseField(0)
+# . Composante
+Hypo.AddComp("ERTABS")
+# . Mode de pilotage
+Hypo.SetRefinThr(4, 3)
+Hypo.SetUnRefThr(4, 4)
+#
+# . Interpolation
+Hypo.SetTypeFieldInterp(2)
+Hypo.AddFieldInterp("TEMPERATURE")
+#
+# . Taille de maille limite
+aux = 0.0015
+Hypo.SetDiamMin(aux)
+#
+# Nom de la future iteration
+# ==========================
+# . Nom de l'iteration precedente
+LastIterName = LastIter.GetName()
+aux = '%03d' % NumAdapt
+# . A l'iteration 1, on complete
+if NumAdapt == 1 :
+ IterName = LastIterName + "_" + aux
+# . Ensuite, on substitue
+else :
+ IterName = LastIterName[:-3] + aux
+#
+# Creation de l'iteration
+# =======================
+Iter = LastIter.NextIteration(IterName)
+#
+# Options de l'iteration
+# ======================
+# . Association de l'hypothese
+Iter.AssociateHypo(HypoName)
+#
+# . Le nom du futur maillage
+Iter.SetMeshName(MeshName)
+#
+# . Le fichier du futur maillage
+aux = '%02d' % NumAdapt
+MeshFile = os.path.join (DirName, "maill."+aux+".med")
+Iter.SetMeshFile(MeshFile)
+#
+# . Le fichier contenant les champs
+FileName = dico_resu["FileName"]
+Iter.SetFieldFile(FileName)
+#
+# Calcul
+# ======
+Error = Iter.Compute(1,1)
+#
+# Arret de la boucle si erreur
+# ============================
+if Error :
+ OK = 0
+ MessInfo = "Erreur dans HOMARD pour l'adaptation numero %d" % NumAdapt
+else :
+ OK = 1
+ MessInfo = " "
+]]></code></script>
+ <inport name="NumAdapt" type="int"/>
+ <inport name="LastIter" type="HOMARD_Iteration"/>
+ <inport name="Hypo" type="HOMARD_Hypothesis"/>
+ <inport name="dico_resu" type="pyobj"/>
+ <outport name="OK" type="bool"/>
+ <outport name="MessInfo" type="string"/>
+ <outport name="MeshFile" type="string"/>
+ </inline>
+ <control> <fromnode>HOMARD_Initialisation</fromnode> <tonode>HOMARD_Exec</tonode> </control>
+ <datalink control="false">
+ <fromnode>HOMARD_Initialisation.default_Iter_n.LastIteration</fromnode> <fromport>return</fromport>
+ <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>HOMARD_Initialisation.p1_Iter_1.Case_Options</fromnode> <fromport>Iter0</fromport>
+ <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>HOMARD_Initialisation.default_Iter_n.GetHypothesis</fromnode> <fromport>return</fromport>
+ <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</fromnode> <fromport>return</fromport>
+ <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
+ </datalink>
+ </bloc>
+ </case>
+ </switch>
+ <control> <fromnode>Calcul</fromnode> <tonode>Analyse</tonode> </control>
+ <control> <fromnode>Analyse</fromnode> <tonode>Adaptation</tonode> </control>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>Error</fromport>
+ <tonode>Adaptation</tonode> <toport>select</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Calcul</tonode> <toport>numCalc</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode> <toport>select</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode> <toport>FileName</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Analyse</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Adaptation.default_Arret_boucle.Arret</tonode> <toport>MessInfo</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Calcul</fromnode> <fromport>Error</fromport>
+ <tonode>Analyse</tonode> <toport>ErrCalc</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
+ <tonode>Analyse</tonode> <toport>dico_resu</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
+ <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dico_resu</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MeshFile</fromport>
+ <tonode>Calcul</tonode> <toport>MeshFile</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MeshFile</fromport>
+ <tonode>Calcul</tonode> <toport>MeshFile</toport>
+ </datalink>
+ </bloc>
+ <datalink control="false">
+ <fromnode>Alternance_Calcul_HOMARD.Analyse</fromnode> <fromport>NumCalcP1</fromport>
+ <tonode>Alternance_Calcul_HOMARD.Analyse</tonode> <toport>NumCalc</toport>
+ </datalink>
+ </while>
+ <inline name="Bilan">
+ <script><code><![CDATA[
+from PyQt4 import QtGui
+import sys
+app = QtGui.QApplication(sys.argv)
+MessageBoxTitle = "Bilan"
+if MessInfo == "" :
+ MessInfo = "Le calcul est converge."
+ QtGui.QMessageBox.information(None, MessageBoxTitle, MessInfo)
+else :
+ QtGui.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
+]]></code></script>
+ <inport name="MessInfo" type="string"/>
+ </inline>
+ <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
+ <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Boucle_de_convergence</tonode> </control>
+ <control> <fromnode>Boucle_de_convergence</fromnode> <tonode>Bilan</tonode> </control>
+ <datalink control="false">
+ <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
+ <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
+ <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Bilan</tonode> <toport>MessInfo</toport>
+ </datalink>
+ <datalink control="false">
+ <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
+ <tonode>Bilan</tonode> <toport>MessInfo</toport>
+ </datalink>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>CaseName</toport>
+ <value><string>Calcul</string></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration</tonode><toport>CaseName</toport>
+ <value><string>Calcul</string></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
+ <value><string>Hypo</string></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
+ <value><string>Hypo</string></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence</tonode><toport>condition</toport>
+ <value><boolean>true</boolean></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
+ <value><int>0</int></value>
+ </parameter>
+ <parameter>
+ <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>MeshName</toport>
+ <value><string>BOX</string></value>
+ </parameter>
+
+ <presentation name="__ROOT__" x="0" y="0" width="704" height="977" expanded="1" expx="0" expy="0" expWidth="704" expHeight="977" shownState="0"/>
+ <presentation name="DataInit" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+ <presentation name="Etude_Initialisation" x="175" y="32" width="158" height="38" expanded="0" expx="175" expy="32" expWidth="162.5" expHeight="40.5" shownState="1"/>
+ <presentation name="Etude_Initialisation.StudyCreation" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Etude_Initialisation.SetCurrentStudy" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence" x="4" y="103" width="569" height="514" expanded="1" expx="4" expy="103" expWidth="569" expHeight="514" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD" x="4" y="59" width="561" height="451" expanded="1" expx="10" expy="59" expWidth="561" expHeight="451" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse" x="181" y="32" width="158" height="171" expanded="1" expx="181" expy="32" expWidth="158" expHeight="171" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation" x="4" y="204" width="553" height="243" expanded="1" expx="4" expy="204" expWidth="553" expHeight="243" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD" x="202" y="59" width="347" height="180" expanded="1" expx="202" expy="59" expWidth="347" expHeight="180" shownState="0"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation" x="4" y="32" width="158" height="65" expanded="0" expx="4" expy="32" expWidth="167" expHeight="67.5" shownState="1"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="59" expWidth="162.5" expHeight="40.5" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.Case_Options" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="322" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="1639.5" expWidth="162.5" expHeight="40.5" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+ <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec" x="185" y="32" width="158" height="144" expanded="1" expx="185" expy="32" expWidth="158" expHeight="144" shownState="0"/>
+ <presentation name="Bilan" x="350" y="32" width="158" height="63" expanded="1" expx="350" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+</proc>
+
+++ /dev/null
-<?xml version='1.0' encoding='iso-8859-1' ?>
-<proc name="HOMARD">
- <property name="DefaultStudyID" value="1"/>
- <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
- <type name="string" kind="string"/>
- <struct name="Engines/dataref">
- <member name="ref" type="string"/>
- </struct>
- <objref name="HOMARD_Boundary" id="IDL:HOMARD/HOMARD_Boundary:1.0"/>
- <objref name="HOMARD_Cas" id="IDL:HOMARD/HOMARD_Cas:1.0"/>
- <objref name="HOMARD_Hypothesis" id="IDL:HOMARD/HOMARD_Hypothesis:1.0"/>
- <objref name="HOMARD_Iteration" id="IDL:HOMARD/HOMARD_Iteration:1.0"/>
- <objref name="HOMARD_Zone" id="IDL:HOMARD/HOMARD_Zone:1.0"/>
- <objref name="Study" id="IDL:SALOMEDS/Study:1.0"/>
- <type name="bool" kind="bool"/>
- <sequence name="boolvec" content="bool"/>
- <type name="double" kind="double"/>
- <sequence name="dblevec" content="double"/>
- <objref name="file" id="file"/>
- <type name="int" kind="int"/>
- <sequence name="intvec" content="int"/>
- <struct name="stringpair">
- <member name="name" type="string"/>
- <member name="value" type="string"/>
- </struct>
- <sequence name="propvec" content="stringpair"/>
- <objref name="pyobj" id="python:obj:1.0"/>
- <sequence name="seqboolvec" content="boolvec"/>
- <sequence name="seqdblevec" content="dblevec"/>
- <sequence name="seqint" content="int"/>
- <sequence name="seqintvec" content="intvec"/>
- <sequence name="stringvec" content="string"/>
- <sequence name="seqstringvec" content="stringvec"/>
- <container name="DefaultContainer">
- <property name="container_name" value="FactoryServer"/>
- <property name="name" value="localhost"/>
- </container>
- <datanode name="DataInit">
- <parameter name="MeshFile" type="string">
- <value><string>/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/maill.00.med</string></value>
- </parameter>
- </datanode>
- <bloc name="Etude_Initialisation">
- <inline name="StudyCreation">
- <script><code><![CDATA[
-import orbmodule
-import SALOMEDS_idl
-
-import HOMARD
-import HOMARD_Gen_idl
-import HOMARD_Cas_idl
-import HOMARD_Iteration_idl
-import HOMARD_Hypothesis_idl
-import HOMARD_Zone_idl
-import HOMARD_Boundary_idl
-
-clt = orbmodule.client()
-StudyManager = clt.Resolve("/myStudyManager")
-NewStudy = StudyManager.NewStudy("my_homard_study")
-]]></code></script>
- <outport name="NewStudy" type="Study"/>
- </inline>
- <service name="SetCurrentStudy">
- <component>HOMARD</component>
- <load container="DefaultContainer"/>
- <method>SetCurrentStudy</method>
- <inport name="theStudy" type="Study"/>
- </service>
- <control> <fromnode>StudyCreation</fromnode> <tonode>SetCurrentStudy</tonode> </control>
- <datalink control="false">
- <fromnode>StudyCreation</fromnode> <fromport>NewStudy</fromport>
- <tonode>SetCurrentStudy</tonode> <toport>theStudy</toport>
- </datalink>
- </bloc>
- <while name="Boucle_de_convergence">
- <bloc name="Alternance_Calcul_HOMARD">
- <inline name="Calcul">
- <script><code><![CDATA[
-import sys
-import os
-#
-rep_calc = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
-rep_script = os.path.dirname("/scratch/D68518/Salome/HOMARD_SALOME/HOMARD_SRC/doc/files/ScriptAster.py")
-sys.path.append(rep_script)
-from ScriptAster import Script
-#
-argu = ["-v"]
-argu.append("--rep_calc=" + rep_calc)
-argu.append("--num=%d" % numCalc)
-argu.append("--mesh_file=" + MeshFile)
-#
-Script_A = Script(argu)
-#
-Error, message_erreur, dico_resu = Script_A.compute ()
-#
-dico_resu["rep_calc"] = rep_calc
-#
-]]></code></script>
- <inport name="numCalc" type="int"/>
- <inport name="MeshFile" type="string"/>
- <outport name="Error" type="int"/>
- <outport name="dico_resu" type="pyobj"/>
- </inline>
- <inline name="Analyse">
- <script><code><![CDATA[
-global NumCalc
-global resu1
-# Valeurs par defaut
-NumCalcP1 = NumCalc + 1
-FileName = " "
-#
-NbCalcMax = 5
-#
-MessInfo = None
-Error = 0
-while not Error :
-#
-# Si le calcul a fini en erreur, on arrete :
-#
- if ErrCalc :
- MessInfo = "Erreur de calcul numero %d" % ErrCalc
- Error = abs(ErrCalc)
- break
-#
-# Si le fichier n'a pas ete defini, on arrete :
-#
- if dico_resu.has_key("FileName") :
- FileName = dico_resu["FileName"]
- else :
- MessInfo = "Le fichier du maillage n'a pas ete defini"
- Error = -2
- break
-#
-# Si le critere est respecte, on arrete :
-#
- if dico_resu.has_key("V_TEST") :
- valeur_v = dico_resu["V_TEST"]
- if NumCalc == 0 :
- resu1 = [valeur_v]
- else :
- resu1.append(valeur_v)
- if NumCalc > 2 :
- solu_m1 = resu1[-2]
- rap = ( resu1[-1] - solu_m1 ) / solu_m1
- if abs(rap) < 0.001 :
- MessInfo = ""
- Error = -9999
- break
- else :
- MessInfo = "La valeur a tester n'a pas ete fournie"
- Error = -3
- break
-#
-# Si on depasse le maximum, on arrete :
-#
- if NumCalc > NbCalcMax :
- MessInfo = "La limite en nombre de calculs a ete atteinte : %d" % NbCalcMax
- Error = -1
- break
-#
- break
-]]></code></script>
- <inport name="NumCalc" type="int"/>
- <inport name="ErrCalc" type="int"/>
- <inport name="dico_resu" type="pyobj"/>
- <outport name="Error" type="int"/>
- <outport name="NumCalcP1" type="int"/>
- <outport name="FileName" type="string"/>
- <outport name="MessInfo" type="string"/>
- </inline>
- <switch name="Adaptation" select="0">
- <default>
- <bloc name="Arret_boucle">
- <inline name="Arret">
- <script><code><![CDATA[
-OK = 0
-MeshFile = " "
-]]></code></script>
- <inport name="MessInfo" type="string"/>
- <outport name="OK" type="bool"/>
- <outport name="MeshFile" type="string"/>
- <outport name="MessInfo" type="string"/>
- </inline>
- </bloc>
- </default>
- <case id="0">
- <bloc name="Adaptation_HOMARD">
- <switch name="HOMARD_Initialisation" select="0">
- <default>
- <bloc name="Iter_n">
- <service name="LastIteration">
- <node>Etude_Initialisation.SetCurrentStudy</node>
- <method>LastIteration</method>
- <inport name="CaseName" type="string"/>
- <outport name="return" type="HOMARD_Iteration"/>
- </service>
- <service name="GetHypothesis">
- <node>Etude_Initialisation.SetCurrentStudy</node>
- <method>GetHypothesis</method>
- <inport name="HypoName" type="string"/>
- <outport name="return" type="HOMARD_Hypothesis"/>
- </service>
- <control> <fromnode>LastIteration</fromnode> <tonode>GetHypothesis</tonode> </control>
- </bloc>
- </default>
- <case id="1">
- <bloc name="Iter_1">
- <service name="CreateCase">
- <node>Etude_Initialisation.SetCurrentStudy</node>
- <method>CreateCase</method>
- <inport name="CaseName" type="string"/>
- <inport name="MeshName" type="string"/>
- <inport name="FileName" type="string"/>
- <outport name="return" type="HOMARD_Cas"/>
- </service>
- <inline name="Case_Options">
- <script><code><![CDATA[
-import os
-# Repertoire d'execution
-DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/HOMARD"
-Case.SetDirName(DirName)
-Case.SetConfType(1)
-# Iteration 0 associee
-Iter0 = Case.GetIter0()
-]]></code></script>
- <inport name="Case" type="HOMARD_Cas"/>
- <outport name="Iter0" type="HOMARD_Iteration"/>
- </inline>
- <service name="CreateHypothesis">
- <node>Etude_Initialisation.SetCurrentStudy</node>
- <method>CreateHypothesis</method>
- <inport name="HypoName" type="string"/>
- <outport name="return" type="HOMARD_Hypothesis"/>
- </service>
- <control> <fromnode>CreateCase</fromnode> <tonode>Case_Options</tonode> </control>
- <control> <fromnode>Case_Options</fromnode> <tonode>CreateHypothesis</tonode> </control>
-
- <datalink control="false">
- <fromnode>CreateCase</fromnode> <fromport>return</fromport>
- <tonode>Case_Options</tonode> <toport>Case</toport>
- </datalink>
- </bloc>
- </case>
- </switch>
- <inline name="HOMARD_Exec">
- <script><code><![CDATA[
-import os
-# Repertoire d'execution
-DirName = "/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther"
-MeshName = "BOX"
-#
-# Hypothese
-# =========
-# . Nom de l'hypothese
-# --------------------
-HypoName = Hypo.GetName()
-#
-# . Options
-# ---------
-# . Le mode d'adaptation : raffinement selon un champ
-Hypo.SetAdapRefinUnRef(1, 1, 1)
-# . Nom du champ
-Hypo.SetField("ERREUR")
-# . Valeurs prises par maille
-Hypo.SetUseField(0)
-# . Composante
-Hypo.AddComp("ERTABS")
-# . Mode de pilotage
-Hypo.SetRefinThr(4, 3)
-Hypo.SetUnRefThr(4, 4)
-#
-# . Interpolation
-Hypo.SetTypeFieldInterp(2)
-Hypo.AddFieldInterp("TEMPERATURE")
-#
-# . Taille de maille limite
-aux = 0.0015
-Hypo.SetDiamMin(aux)
-#
-# Nom de la future iteration
-# ==========================
-# . Nom de l'iteration precedente
-LastIterName = LastIter.GetName()
-aux = '%03d' % NumAdapt
-# . A l'iteration 1, on complete
-if NumAdapt == 1 :
- IterName = LastIterName + "_" + aux
-# . Ensuite, on substitue
-else :
- IterName = LastIterName[:-3] + aux
-#
-# Creation de l'iteration
-# =======================
-Iter = LastIter.NextIteration(IterName)
-#
-# Options de l'iteration
-# ======================
-# . Association de l'hypothese
-Iter.AssociateHypo(HypoName)
-#
-# . Le nom du futur maillage
-Iter.SetMeshName(MeshName)
-#
-# . Le fichier du futur maillage
-aux = '%02d' % NumAdapt
-MeshFile = os.path.join (DirName, "maill."+aux+".med")
-Iter.SetMeshFile(MeshFile)
-#
-# . Le fichier contenant les champs
-FileName = dico_resu["FileName"]
-Iter.SetFieldFile(FileName)
-#
-# Calcul
-# ======
-Error = Iter.Compute(1,1)
-#
-# Arret de la boucle si erreur
-# ============================
-if Error :
- OK = 0
- MessInfo = "Erreur dans HOMARD pour l'adaptation numero %d" % NumAdapt
-else :
- OK = 1
- MessInfo = " "
-]]></code></script>
- <inport name="NumAdapt" type="int"/>
- <inport name="LastIter" type="HOMARD_Iteration"/>
- <inport name="Hypo" type="HOMARD_Hypothesis"/>
- <inport name="dico_resu" type="pyobj"/>
- <outport name="OK" type="bool"/>
- <outport name="MessInfo" type="string"/>
- <outport name="MeshFile" type="string"/>
- </inline>
- <control> <fromnode>HOMARD_Initialisation</fromnode> <tonode>HOMARD_Exec</tonode> </control>
- <datalink control="false">
- <fromnode>HOMARD_Initialisation.default_Iter_n.LastIteration</fromnode> <fromport>return</fromport>
- <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
- </datalink>
- <datalink control="false">
- <fromnode>HOMARD_Initialisation.p1_Iter_1.Case_Options</fromnode> <fromport>Iter0</fromport>
- <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
- </datalink>
- <datalink control="false">
- <fromnode>HOMARD_Initialisation.default_Iter_n.GetHypothesis</fromnode> <fromport>return</fromport>
- <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
- </datalink>
- <datalink control="false">
- <fromnode>HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</fromnode> <fromport>return</fromport>
- <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
- </datalink>
- </bloc>
- </case>
- </switch>
- <control> <fromnode>Calcul</fromnode> <tonode>Analyse</tonode> </control>
- <control> <fromnode>Analyse</fromnode> <tonode>Adaptation</tonode> </control>
- <datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>Error</fromport>
- <tonode>Adaptation</tonode> <toport>select</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
- <tonode>Calcul</tonode> <toport>numCalc</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
- <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode> <toport>select</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
- <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
- <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode> <toport>FileName</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Analyse</fromnode> <fromport>MessInfo</fromport>
- <tonode>Adaptation.default_Arret_boucle.Arret</tonode> <toport>MessInfo</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Calcul</fromnode> <fromport>Error</fromport>
- <tonode>Analyse</tonode> <toport>ErrCalc</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
- <tonode>Analyse</tonode> <toport>dico_resu</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
- <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dico_resu</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MeshFile</fromport>
- <tonode>Calcul</tonode> <toport>MeshFile</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MeshFile</fromport>
- <tonode>Calcul</tonode> <toport>MeshFile</toport>
- </datalink>
- </bloc>
- <datalink control="false">
- <fromnode>Alternance_Calcul_HOMARD.Analyse</fromnode> <fromport>NumCalcP1</fromport>
- <tonode>Alternance_Calcul_HOMARD.Analyse</tonode> <toport>NumCalc</toport>
- </datalink>
- </while>
- <inline name="Bilan">
- <script><code><![CDATA[
-from PyQt4 import QtGui
-import sys
-app = QtGui.QApplication(sys.argv)
-MessageBoxTitle = "Bilan"
-if MessInfo == "" :
- MessInfo = "Le calcul est converge."
- QtGui.QMessageBox.information(None, MessageBoxTitle, MessInfo)
-else :
- QtGui.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
-]]></code></script>
- <inport name="MessInfo" type="string"/>
- </inline>
- <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
- <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Boucle_de_convergence</tonode> </control>
- <control> <fromnode>Boucle_de_convergence</fromnode> <tonode>Bilan</tonode> </control>
- <datalink control="false">
- <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
- <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
- <tonode>Boucle_de_convergence</tonode> <toport>condition</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
- <tonode>Bilan</tonode> <toport>MessInfo</toport>
- </datalink>
- <datalink control="false">
- <fromnode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
- <tonode>Bilan</tonode> <toport>MessInfo</toport>
- </datalink>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>CaseName</toport>
- <value><string>Calcul</string></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
- <value><int>0</int></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
- <value><int>0</int></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
- <value><int>0</int></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration</tonode><toport>CaseName</toport>
- <value><string>Calcul</string></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis</tonode><toport>HypoName</toport>
- <value><string>Hypo</string></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis</tonode><toport>HypoName</toport>
- <value><string>Hypo</string></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence</tonode><toport>condition</toport>
- <value><boolean>true</boolean></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
- <value><int>0</int></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
- <value><int>0</int></value>
- </parameter>
- <parameter>
- <tonode>Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase</tonode><toport>MeshName</toport>
- <value><string>BOX</string></value>
- </parameter>
-
- <presentation name="__ROOT__" x="0" y="0" width="704" height="977" expanded="1" expx="0" expy="0" expWidth="704" expHeight="977" shownState="0"/>
- <presentation name="DataInit" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
- <presentation name="Etude_Initialisation" x="175" y="32" width="158" height="38" expanded="0" expx="175" expy="32" expWidth="162.5" expHeight="40.5" shownState="1"/>
- <presentation name="Etude_Initialisation.StudyCreation" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
- <presentation name="Etude_Initialisation.SetCurrentStudy" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
- <presentation name="Boucle_de_convergence" x="4" y="103" width="569" height="514" expanded="1" expx="4" expy="103" expWidth="569" expHeight="514" shownState="0"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD" x="4" y="59" width="561" height="451" expanded="1" expx="10" expy="59" expWidth="561" expHeight="451" shownState="0"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Calcul" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Analyse" x="181" y="32" width="158" height="171" expanded="1" expx="181" expy="32" expWidth="158" expHeight="171" shownState="0"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation" x="4" y="204" width="553" height="243" expanded="1" expx="4" expy="204" expWidth="553" expHeight="243" shownState="0"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD" x="202" y="59" width="347" height="180" expanded="1" expx="202" expy="59" expWidth="347" expHeight="180" shownState="0"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation" x="4" y="32" width="158" height="65" expanded="0" expx="4" expy="32" expWidth="167" expHeight="67.5" shownState="1"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="59" expWidth="162.5" expHeight="40.5" shownState="2"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateCase" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.Case_Options" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1.CreateHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="322" expy="32" expWidth="158" expHeight="36" shownState="2"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n" x="0" y="0" width="162.5" height="40.5" expanded="1" expx="4" expy="1639.5" expWidth="162.5" expHeight="40.5" shownState="2"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.LastIteration" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_Iter_n.GetHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
- <presentation name="Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec" x="185" y="32" width="158" height="144" expanded="1" expx="185" expy="32" expWidth="158" expHeight="144" shownState="0"/>
- <presentation name="Bilan" x="350" y="32" width="158" height="63" expanded="1" expx="350" expy="32" expWidth="158" expHeight="63" shownState="0"/>
-</proc>
-
Cette boîte est un noeud élémentaire de type PresetNode. Sa seule fonction est d'initialiser la variable MeshFile qui contient le nom du fichier du maillage initial.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 38-42
Etude_Initialisation
Le noeud python StudyCreation sert à initialiser l'étude SALOME qui est fournie en sortie :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 44-62
Le service SetCurrentStudy affecte cette étude à une instance de HOMARD.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 63-68
Cette boîte est un noeud python qui prend en entrée une chaîne de caractères, MessInfo. Si tout s'est bien passé, ce message est vide. Une fenêtre QT apparaît pour confirmer la convergence. S'il y a eu un problème, le message contient les messages émis au cours des calculs. La fenêtre QT affiche ce message.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 406-419
Cette boîte est un noeud python qui va piloter le calcul. En entrée, on trouve le numéro du calcul (0 au départ) et le nom du fichier qui contient le maillage sur lequel calculer. En sortie, on trouve un entier qui représente l'erreur sur ce calcul (0 si tout va bien) et un dictionnaire python rassemblant les résultats du calcul. Le corps du noeud est constitué par le lancement d'un script python qui active le calcul.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 77-103
Dans cet exemple, il faut définir :
Cette boîte commence par créer le cas HOMARD en appelant le service CreateCase.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 208-215
Le nom du cas CaseName est imposé à "Calcul". Le paramètre d'entrée MeshName est imposé à "BOX". Le paramètre d'entrée FileName est issu de la sortie du calcul précédent. Le paramètre de sortie est une instance de cas.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 443-446
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 483-486
Les options de ce cas doivent maintenant être renseignées. C'est fait par le noeud python CaseOptions. Il est impératif de renseigner le répertoire de calcul. On regardera la description des fonctions dans :ref:`tui_create_case`. En sortie, on récupère l'instance de l'itération correspondant à l'état initial du cas.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 216-228
-Enfin, une hypothèse est créée en appelant le service CreateHypothèse. Le paramètre de sortie est une instance d'hypothèse.
+Enfin, une hypothèse est créée en appelant le service CreateHypothese. Le paramètre de sortie est une instance d'hypothèse.
Homard_Exec
^^^^^^^^^^^
Le répertoire de calcul est récupéré. Le nom du maillage est rappelé.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 245-250
../..
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 325-333
L'hypothèse transmise en paramètre d'entrée est caractérisée (voir :ref:`tui_create_hypothese`) :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 254-278
Il faut établir un nom pour la future itération. Pour s'assurer que le nom n'a jamais été utilisé, on met en place un mécanisme de nommage incrémental à partir du nom de l'itération initiale. Comme ce nom initial est le nom du maillage initial, on obtient une succession de noms sous la forme : M_001, M_002, M_003, etc.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 280-290
L'itération est complétée : hypothèse, futur maillage, champ (voir :ref:`tui_create_iteration`) :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 292-311
L'itération est calculée. Si tout s'est bien passé, la variable OK vaut 1 : on pourra continuer l'exécution du schéma. S'il y a eu un problème, la variable OK vaut 0 pour signifier que le calcul doit s'arrêter ; on donne alors un message d'erreur.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 313-324
Après cette exécution, le processus sort du noeud Adaptation_HOMARD, puis du noeud Adaptation. On arrive alors au noeud d'analyse.
Le bloc Arret_boucle n'est présent que pour faire transiter des variables car les paramètres d'entrée des noeuds doivent toujours être remplis. C'est un python très simple :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 173-184
Analyse
Le bloc Analyse est un script python qui assure le contrôle complet du processus en examinant successivement les causes d'erreur possible.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 104-116
../..
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 162-170
On commence par analyser le retour du code de calcul :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 118-123
Vérification de la présence du nom du fichier de résultats dans le dictionnaire des résultats :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 125-132
Vérification de la convergence. Cela suppose que la valeur à tester est présente dans le dictionnaire sous la clé 'V_TEST'. Ici, on a mis en place un test sur la variation de la valeur d'un calcul à l'autre. Au premier passage, on ne teste rien. Aux passages suivants, on teste si la variation relative est inférieure à 1 millième. On aurait pu mettre en place un test absolu si on avait récupéré un niveau global d'erreur par exemple.
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 134-152
Enfin, on vérifie que l'on ne dépasse pas un nombre maximal d'adaptations :
-.. literalinclude:: ../files/yacs_01.xml
+.. literalinclude:: ../files/yacs_01.fr.xml
:lines: 154-159
Utiliser ce schéma
******************
Pour reproduire cet exemple, on pourra télécharger :
- * :download:`le schéma <../files/yacs_01.xml>`
+ * :download:`le schéma <../files/yacs_01.fr.xml>`
* :download:`un exemple de script python <../files/yacs_script.py>`
Il faut l'adapter à la simulation envisagée. En particulier, il faut :
// A.1. Les creations
//
HOMARD_Boundary CreateBoundaryDi (in string BoundaryName, in string MeshName, in string FileName)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Boundary CreateBoundaryCylinder (in string BoundaryName,
in double Xcentre, in double Ycentre, in double Zcentre,
in double Xaxis, in double Yaxis, in double Zaxis,
in double Radius)
- raises (SALOME::SALOME_Exception);
+ raises (SALOME::SALOME_Exception);
HOMARD_Boundary CreateBoundarySphere (in string BoundaryName,
in double Xcentre, in double Ycentre, in double Zcentre,
in double Radius)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Boundary CreateBoundaryConeR (in string BoundaryName,
in double Xcentre1, in double Ycentre1, in double Zcentre1, in double Radius1,
in double Xcentre2, in double Ycentre2, in double Zcentre2, in double Radius2)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Boundary CreateBoundaryConeA (in string BoundaryName,
in double Xaxis, in double Yaxis, in double Zaxis, in double Angle,
in double Xcentre, in double Ycentre, in double Zcentre)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Cas CreateCase(in string CaseName, in string MeshName, in string FileName )
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Cas CreateCaseFromIteration(in string CaseName, in string DirNameStart )
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Cas CreateCaseFromCaseLastIteration(in string CaseName, in string DirNameStart )
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Cas CreateCaseFromCaseIteration(in string CaseName, in string DirNameStart, in long Number )
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Hypothesis CreateHypothesis(in string HypoName )
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Zone CreateZoneBox (in string ZoneName,
in double Xmini, in double Xmaxi,
in double Ymini, in double Ymaxi,
in double Zmini, in double Zmaxi)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Zone CreateZoneBox2D (in string ZoneName,
in double Umini, in double Umaxi,
in double Vmini, in double Vmaxi,
in long Orient)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Zone CreateZoneCylinder (in string ZoneName,
in double Xcentre, in double Ycentre, in double Zcentre,
in double Xaxis, in double Yaxis, in double Zaxis,
in double Radius, in double Height)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Zone CreateZoneDisk (in string ZoneName,
in double Ucentre, in double Vcentre,
in double Radius, in long Orient)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Zone CreateZoneDiskWithHole (in string ZoneName,
in double Ucentre, in double Vcentre,
in double Radius, in double InternalRadius,
in long Orient)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Zone CreateZonePipe (in string ZoneName,
in double Xcentre, in double Ycentre, in double Zcentre,
in double Xaxis, in double Yaxis, in double Zaxis,
in double Radius, in double Height, in double InternalRadius)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
HOMARD_Zone CreateZoneSphere (in string ZoneName,
in double Xcentre, in double Ycentre, in double Zcentre,
in double Radius)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
//
// A.2. Les informations
//
listeYACSs GetAllYACSsName() raises (SALOME::SALOME_Exception);
listeZones GetAllZonesName() raises (SALOME::SALOME_Exception);
- void MeshInfo(in string CaseName, in string MeshName, in string FileName, in string DirName, in long Qual, in long Diam, in long Conn, in long Tail, in long Inte )
- raises (SALOME::SALOME_Exception);
+ void MeshInfo(in string CaseName, in string MeshName, in string FileName, in string DirName, in long Qual, in long Diam, in long Conn, in long Tail, in long Inte )
+ raises(SALOME::SALOME_Exception);
HOMARD_Iteration LastIteration(in string CaseName) raises (SALOME::SALOME_Exception);
//
// A.3. L'etude
//
- void SetCurrentStudy(in SALOMEDS::Study theStudy) raises (SALOME::SALOME_Exception);
+ void SetCurrentStudy(in SALOMEDS::Study theStudy) raises (SALOME::SALOME_Exception);
SALOMEDS::Study GetCurrentStudy() raises (SALOME::SALOME_Exception);
- long GetCurrentStudyID() raises (SALOME::SALOME_Exception);
+ long GetCurrentStudyID() raises (SALOME::SALOME_Exception);
//
// B. Les methodes qui suivent n'apparaissent pas dans le composant HOMARD dans YACS
// L'utilisateur ne devrait pas les connaitre (ni s'en servir, a fortiori)
//
- HOMARD_Iteration CreateIteration(in string IterName, in string PreviousIterName )
- raises (SALOME::SALOME_Exception);
+ HOMARD_Iteration CreateIteration(in string IterName, in string PreviousIterName )
+ raises(SALOME::SALOME_Exception);
//
void InvalideBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception);
void InvalideHypo (in string HypoName) raises (SALOME::SALOME_Exception);
void InvalideIter (in string IterName) raises (SALOME::SALOME_Exception);
void InvalideIterOption (in string IterName, in long Option)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
void InvalideZone (in string ZoneName) raises (SALOME::SALOME_Exception);
long DeleteBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception);
long DeleteCase(in string CaseName, in long Option)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
long DeleteHypo(in string HypoName) raises (SALOME::SALOME_Exception);
long DeleteIteration(in string IterName, in long Option)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
long DeleteIterationOption(in string IterName, in long Option1, in long Option2)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
long DeleteYACS(in string YacsName, in long Option) raises (SALOME::SALOME_Exception);
long DeleteZone (in string ZoneName) raises (SALOME::SALOME_Exception);
//
void AssociateIterHypo(in string IterName, in string HypoName)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
//
void AssociateHypoZone(in string HypoName, in string ZoneName, in long TypeUse)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
void DissociateHypoZone(in string HypoName, in string ZoneName)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
long Compute (in string IterName, in long CleanOption, in long modeHOMARD, in long Option1, in long Option2)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
//
string CreateDirNameIter(in string NomDir, in long option )
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
boolean VerifieDir (in string IterName) raises (SALOME::SALOME_Exception);
//
- void PublishFileUnderIteration(in string IterName, in string FileName, in string Comment)
- raises (SALOME::SALOME_Exception);
- void PublishBoundaryUnderCase(in string CaseName, in string BoundaryName);
- void PublishResultInSmesh(in string FileName, in long Option)
- raises (SALOME::SALOME_Exception);
+ void PublishFileUnderIteration(in string IterName, in string FileName, in string Comment)
+ raises(SALOME::SALOME_Exception);
+ void PublishBoundaryUnderCase(in string CaseName, in string BoundaryName)
+ raises(SALOME::SALOME_Exception);
+ void PublishResultInSmesh(in string FileName, in long Option)
+ raises(SALOME::SALOME_Exception);
//
HOMARD_YACS CreateYACSSchema(in string YACSName, in string CaseName, in string ScriptFile, in string DirName, in string MeshFile)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
long YACSWrite (in string YACSName) raises (SALOME::SALOME_Exception);
long YACSWriteOnFile (in string YACSName, in string YACSFile)
- raises (SALOME::SALOME_Exception);
+ raises(SALOME::SALOME_Exception);
+//
+ void SetLanguageShort (in string LanguageShort) raises (SALOME::SALOME_Exception);
+ string GetLanguageShort () raises (SALOME::SALOME_Exception);
};
};
whatis.png \
write.png \
yacs.png \
- yacs_01.xml \
+ yacs_01.fr.xml \
+ yacs_01.en.xml \
zone_boxdxyz.png \
zone_boxdxyz_2.png \
zone_icone.png \
<inline name="Case_Options">
<script><code><![CDATA[
import os
-# Repertoire d'execution
+# Repertoire d'adaptation
Iter_1_Case_Options
# Iteration 0 associee
Iter0 = Case.GetIter0()
}
// La derniere valeur est toujours mise dans x7
x7 = GetStringInTexte ( ligne, ")", 0 ) ;
- MESSAGE("coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6<<",x7"<<x7);
+ MESSAGE("Valeurs = "<< x0<<", "<<x1<< ", "<< x2<< ", "<< x3<<", "<<x4<<", "<<x5<<", "<<x6<<", x7"<<x7);
//
// 4.2. Cas d une frontiere discrete (0)
if (BoundaryType == 0) // Cas d une frontiere discrete
{
_Texte += Texte_inport( "string", "MeshName" ) ;
- TexteParametre( node, "MeshName", "string", BoundaryName ) ;
+ TexteParametre( node, "MeshName", "string", x0 ) ;
_Texte += Texte_inport( "string", "FileName" ) ;
- TexteParametre( node, "FileName", "string", BoundaryName ) ;
+ TexteParametre( node, "FileName", "string", x7 ) ;
}
// 4.2. Cas du cylindre (1)
else if ( BoundaryType == 1 )
//================================================
// function : createMenus
-// Verifier l'avant dernier nombre passe en parametre
//================================================
void HOMARDGUI::createMenus(){
MESSAGE("createMenus")
createMenu( 1401, HOMARD_Id, -1 ); // Création d'un schéma YACS
createMenu( separator(), HOMARD_Id,-1);
//
-/*// La langue des preferences
+// La langue des preferences
SUIT_ResourceMgr* resMgr = getApp()->resourceMgr();
- QString langue = resMgr->stringValue("language", "language", "en");
- MESSAGE("langue " << langue.toStdString().c_str() );*/
+ _LanguageShort = resMgr->stringValue("language", "language", "en");
+ MESSAGE("_LanguageShort " << _LanguageShort.toStdString().c_str() );
+//
+ SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( application() );
+ HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app);
+ homardGen->SetLanguageShort(_LanguageShort.toStdString().c_str());
}
//================================================
int anId;
QString _ObjectName;
+ QString _LanguageShort ;
};
#endif
return theStudy->studyDS();
}
-
//================================================================
// Function : GetActiveStudy
// Returne un pointeur sur l'etude active
SCRUTE(it.Value()->getEntry());
};
return mySelected;
-
}
//================================================================
return aList.Extent() > 0 ? aList.Last() : Handle(SALOME_InteractiveObject)();
}
-//================================================================
-// Function : isXmgrace
-// Retourne vrai si le fichier associe est de type ASCII
-//================================================================
-bool HOMARD_UTILS::isXmgrace(_PTR(SObject) MonObj)
-{
- _PTR(GenericAttribute) anAttr;
- if (!MonObj->FindAttribute(anAttr, "AttributeComment")) return false;
- _PTR(AttributeComment) aFileComment (anAttr);
- std::string Type = aFileComment->Value();
- if (QString(Type.c_str()) == QString("HomardOuputQual")) return true;
- return false;
-}
//================================================================
// Retourne vrai si l objet est du type voulu
// . Dans le cas d'un cas, d'une hypothese, d'une zone, on se contente
}
//=========================================================================================================
-void HOMARD_UTILS::PushOnHelp(QString monFichierAide, QString contexte)
+void HOMARD_UTILS::PushOnHelp(QString monFichierAide, QString contexte, QString LanguageShort)
{
MESSAGE("Debut de PushOnHelp avec monFichierAide = "<< monFichierAide.toStdString().c_str());
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
HOMARDGUI* aHomardGUI = dynamic_cast<HOMARDGUI*>( app->module( "Homard" ) );
// Repertoire de reference de la documentation
QString rep = aHomardGUI ? app->moduleName(aHomardGUI->moduleName()) : QString("") ;
- // Recherche de la langue
+ // WARNING/ATTENTION : si on savait recuperer la langue depuis les preferences, on ne fera pas le passage par argument
// SUIT_ResourceMgr* resMgr = getApp()->resourceMgr();
// SUIT_ResourceMgr* resMgr = myModule->getApp()->resourceMgr();
// QString langue = resMgr->stringValue("language", "language", "en");
- QString langue = "fr" ;
- MESSAGE(". langue " << langue.toStdString().c_str()) ;
+// QString langue = "fr" ;
+ MESSAGE(". LanguageShort " << LanguageShort.toStdString().c_str()) ;
// Complement du fichier
- QString fichier = QString(langue+"/"+monFichierAide) ;
+ QString fichier = QString(LanguageShort+"/"+monFichierAide) ;
MESSAGE(". Appel de onHelpContextModule avec :");
MESSAGE(" rep = "<< rep.toStdString().c_str());
MESSAGE(" fichier = "<< fichier.toStdString().c_str());
// Function returns the last selected object in the list
// of selected objects
- bool isXmgrace(_PTR(SObject) MonObj);
bool isBoundaryAn(_PTR(SObject) MonObj);
bool isBoundaryDi(_PTR(SObject) MonObj);
bool isCase(_PTR(SObject) MonObj);
bool isFileType(_PTR(SObject) MonObj, QString TypeFile);
bool isObject(_PTR(SObject) MonObj, QString TypeObject, int option );
- void PushOnHelp(QString monFichierAide, QString contexte);
+ void PushOnHelp(QString monFichierAide, QString contexte, QString LanguageShort);
extern SALOME_ListIO mySelected;
}
void MonCreateBoundaryAn::PushOnHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre") ) ;
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("un-cylindre"), QString(LanguageShort));
}
// -----------------------------------
void MonCreateBoundaryDi::PushOnHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort));
}
// ------------------------------------------------------------------------
void MonCreateBoundaryDi::AssocieLesGroupes()
void MonCreateCase::PushOnHelp()
//-------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort));
}
// ---------------------------------
void MonCreateCase::SetNewName()
void MonCreateCase::PushBoundaryDiHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete") ) ;
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-discrete"), QString(LanguageShort));
}
// ------------------------------------------------------------------------
void MonCreateCase::SetBoundaryA()
void MonCreateCase::PushBoundaryAnHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-analytique") ) ;
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_boundary.html"), QString("frontiere-analytique"), QString(LanguageShort));
}
// ------------------------------------------------------------------------
void MonCreateCase::CaseNameChanged()
void MonCreateHypothesis::PushOnHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort));
}
// -------------------------------------------------
void MonCreateHypothesis::SetNewName()
void MonCreateIteration::PushOnHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_iteration.html"), QString(""), QString(LanguageShort));
}
// ------------------------------------------------------------------------
void MonCreateIteration::SetIterParentName()
void MonCreateListGroup::PushOnHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_hypothese.html"), QString(""), QString(LanguageShort));
}
// ------------------------------------------------------------------------
void MonCreateListGroup::InitGroupes()
void MonCreateYACS::PushOnHelp()
//-------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("yacs.html"), QString(""), QString(LanguageShort));
}
// -------------------------------------------------
void MonCreateYACS::SetNewName()
void MonCreateZone::PushOnHelp()
// ------------------------------------------------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString("") ) ;
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_zone.html"), QString(""), QString(LanguageShort));
}
// -----------------------------------
void MonIterInfo::PushOnHelp()
//-------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"), QString(""));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_mesh_info.html"), QString(""), QString(LanguageShort));
}
// ------------------------------------------------------------------------
void MonIterInfo::SetBlockSize()
void MonMeshInfo::PushOnHelp()
//-------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort));
}
// ---------------------------------
void MonMeshInfo::SetNewCaseName()
void MonPursueIteration::PushOnHelp()
//-------------------------------
{
- HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""));
+ char* LanguageShort = myHomardGen->GetLanguageShort();
+ HOMARD_UTILS::PushOnHelp(QString("gui_create_case.html"), QString(""), QString(LanguageShort));
}
// ---------------------------------
void MonPursueIteration::SetNewCaseName()
_tag_hypo = 0 ;
_tag_yacs = 0 ;
_tag_zone = 0 ;
+ _Langue = "Francais" ;
+ _LangueShort = "fr" ;
}
//=================================
/*!
// E. Les donnees de l'execution HOMARD
// E.1. L'objet du texte du fichier de configuration
HomardDriver* myDriver = new HomardDriver(siter, siterp1);
- std::string Langue = "Francais" ;
- myDriver->TexteInit(DirCompute, LogFile, Langue);
+ myDriver->TexteInit(DirCompute, LogFile, _Langue);
// E.2. Le maillage associe a l'iteration
const char* NomMesh = myIteration->GetMeshName();
if ( modeHOMARD == 1 )
{
std::stringstream saux0 ;
- Commentaire = "Iteration" ;
- Commentaire += " " + siter ;
+ Commentaire = "Mesh" ;
+ Commentaire += " " + siterp1 ;
PublishFileUnderIteration(NomIteration, MeshFile, Commentaire.c_str());
if ( Option2 % 2 == 0 ) { PublishResultInSmesh(MeshFile, 1); }
}
//=============================================================================
void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName)
{
- MESSAGE (" DeleteResultInSmesh pour le maillage " << MeshName << " dans le fichier " << NomFich );
+ MESSAGE ("DeleteResultInSmesh pour le maillage " << MeshName << " dans le fichier " << NomFich );
if (CORBA::is_nil(myCurrentStudy))
{
SALOME::ExceptionStruct es;
}
}
}
-
+ return ;
}
//=============================================================================
void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire)
{
-// MESSAGE (" PublishFileUnderIteration pour l'iteration " << NomIter << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
+// MESSAGE ("PublishFileUnderIteration pour l'iteration " << NomIter << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIter];
SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
//=============================================================================
void HOMARD_Gen_i::PublishFileUnderYACS(const char* nomYACS, const char* NomFich, const char* Commentaire)
{
-// MESSAGE (" PublishFileUnderYACS pour le schema " << nomYACS << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
+// MESSAGE ("PublishFileUnderYACS pour le schema " << nomYACS << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[nomYACS];
SALOMEDS::SObject_var aYACSSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
throw SALOME::SALOME_Exception(es);
return 0;
}
- YACSFile_base += "/share/salome/resources/homard/yacs_01.xml" ;
+ YACSFile_base += "/share/salome/resources/homard/yacs_01." + _LangueShort + ".xml" ;
+// if ( _Langue ==
MESSAGE("YACSFile_base ="<<YACSFile_base);
// G. Lecture du schema de reference et insertion des donnees propres au fil de la rencontre des mots-cles
const char* theURL,
CORBA::Boolean isMultiFile)
{
- MESSAGE (" Save for theURL = "<< theURL);
+ MESSAGE ("Save for theURL = "<< theURL);
SALOMEDS::TMPFile_var aStreamFile;
// get temporary directory name
const char* theURL,
CORBA::Boolean isMultiFile)
{
- MESSAGE (" Load pour theURL = "<< theURL);
+ MESSAGE ("Load pour theURL = "<< theURL);
SALOMEDS::Study_var aStudy = theComponent->GetStudy();
// set current study
std::string yacsSignature = HOMARD::GetSignature(HOMARD::YACS);
if (line.substr(0, bounSignature.size()) == bounSignature) {
// re-create boundary
- MESSAGE (" Recreation de la frontiere" );
+ MESSAGE ("Recreation de la frontiere" );
HOMARD::HOMARD_Boundary_var aBoundary = newBoundary();
PortableServer::ServantBase_var aServant = GetServant(aBoundary);
HOMARD_Boundary_i* aBoundaryServant = dynamic_cast<HOMARD_Boundary_i*>(aServant.in());
}
else if (line.substr(0, caseSignature.size()) == caseSignature) {
// re-create case
- MESSAGE (" Recreation du cas" );
+ MESSAGE ("Recreation du cas" );
HOMARD::HOMARD_Cas_var aCase = newCase();
PortableServer::ServantBase_var aServant = GetServant(aCase);
HOMARD_Cas_i* aCaseServant = dynamic_cast<HOMARD_Cas_i*>(aServant.in());
}
else if (line.substr(0, hypoSignature.size()) == hypoSignature) {
// re-create hypothesis
- MESSAGE (" Recreation de l hypothese" );
+ MESSAGE ("Recreation de l hypothese" );
HOMARD::HOMARD_Hypothesis_var aHypo = newHypothesis();
PortableServer::ServantBase_var aServant = GetServant(aHypo);
HOMARD_Hypothesis_i* aHypoServant = dynamic_cast<HOMARD_Hypothesis_i*>(aServant.in());
}
else if (line.substr(0, iterSignature.size()) == iterSignature) {
// re-create iteration
- MESSAGE (" Recreation de l iteration" );
+ MESSAGE ("Recreation de l iteration" );
HOMARD::HOMARD_Iteration_var aIter = newIteration();
PortableServer::ServantBase_var aServant = GetServant(aIter);
HOMARD_Iteration_i* aIterServant = dynamic_cast<HOMARD_Iteration_i*>(aServant.in());
}
}
else if (line.substr(0, zoneSignature.size()) == zoneSignature) {
- MESSAGE (" Recreation de la zone" );
+ MESSAGE ("Recreation de la zone" );
// re-create zone
HOMARD::HOMARD_Zone_var aZone = newZone();
PortableServer::ServantBase_var aServant = GetServant(aZone);
}
}
else if (line.substr(0, zoneSignature.size()) == yacsSignature) {
- MESSAGE (" Recreation du schema YACS" );
+ MESSAGE ("Recreation du schema YACS" );
// re-create YACS
HOMARD::HOMARD_YACS_var aYACS = newYACS();
PortableServer::ServantBase_var aServant = GetServant(aYACS);
#endif
}
//===============================================================================
-// Recuperation de la chaine de caracteres par rapport l'apparition d'un texte
+// Recuperation de la chaine de caracteres par rapport a l'apparition d'un texte
// ligne : la ligne a manipuler
// texte : le texte a reperer
// option : 0 : la chaine avant le texte
if ( option == 0 ) { chaine = ligne.substr( 0, position ) ; }
else { chaine = ligne.substr( position+1 ) ; }
}
-// Conversion de type
return chaine ;
//
}
+// //===============================================================================
+// // Langue de SALOME
+// //===============================================================================
+void HOMARD_Gen_i::SetLanguageShort(const char* LanguageShort)
+{
+ MESSAGE ("SetLanguageShort pour LanguageShort = " << LanguageShort );
+ _LangueShort = LanguageShort ;
+ if ( _LangueShort == "fr" ) { _Langue = "Francais" ; }
+ else { _Langue = "English" ; }
+ return ;
+}
+char* HOMARD_Gen_i::GetLanguageShort()
+{
+// MESSAGE ("GetLanguageShort");
+ return CORBA::string_dup( _LangueShort.c_str() );
+}
//=============================================================================
extern "C"
SALOMEDS::Study_ptr GetCurrentStudy();
void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
CORBA::Long GetCurrentStudyID();
+ void IsValidStudy();
// Liens entre structures
void InvalideBoundary(const char* nomBoundary);
std::string YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver);
std::string YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, YACSDriver* myDriver);
- void IsValidStudy();
+// Divers
+ void SetLanguageShort(const char* LanguageShort);
+ char* GetLanguageShort();
+
// ---------------------------------------------------------------
// next functions are inherited from SALOMEDS::Driver interface
int _tag_hypo ;
int _tag_yacs ;
int _tag_zone ;
+ std::string _Langue ;
+ std::string _LangueShort ;
};