Salome HOME
Insertion des frontières dans la création des schémas YACS
authornicolas <nicolas>
Tue, 10 Sep 2013 14:50:33 +0000 (14:50 +0000)
committernicolas <nicolas>
Tue, 10 Sep 2013 14:50:33 +0000 (14:50 +0000)
resources/yacs_01.xml [new file with mode: 0644]
src/HOMARD/YACSDriver.cxx
src/HOMARD/YACSDriver.hxx
src/HOMARD_I/HOMARD_Gen_i.cxx
src/HOMARD_I/HOMARD_Gen_i.hxx

diff --git a/resources/yacs_01.xml b/resources/yacs_01.xml
new file mode 100644 (file)
index 0000000..b327c59
--- /dev/null
@@ -0,0 +1,497 @@
+<?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">
+DataInit_MeshFile
+      </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="Tant_que_le_calcul_n_a_pas_converge">
+      <bloc name="Alternance_Calcul_HOMARD">
+         <inline name="Calcul">
+            <script><code><![CDATA[
+import sys
+import os
+#
+Alternance_Calcul_HOMARD_Calcul
+#
+argu  = ["-v"]
+argu.append("--rep_calc=" + rep_calc)
+argu.append("--numero=%d" % numCalc)
+argu.append("--mesh_file="  + MeshFile)
+#
+LanceCas_A = LanceCas(argu)
+#
+Error, message_erreur, dico_resu = LanceCas_A.calcul ()
+#
+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
+MeshName = " "
+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 maillage n'a pas ete defini, on arrete :
+#
+    if dico_resu.has_key("MeshName") :
+        MeshName = dico_resu["MeshName"]
+    else :
+        MessInfo = "Le maillage n'a pas ete defini"
+        Error = -2
+        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 = -3
+        break
+#
+# Si le critere est respecte, on arrete :
+#
+    if dico_resu.has_key("V00") :
+        valeur_v = dico_resu["V00"]
+        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 = -4
+        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="MeshName" type="string"/>
+            <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="HOMARD_Init_ensuite">
+                           <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="HOMARD_Init_au_debut">
+                           <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
+HOMARD_Init_au_debut_Case_Options
+# 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>
+HOMARD_Init_au_debut
+                           <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
+HOMARD_Exec_DirName
+#
+# Hypothese
+# =========
+# . Nom de l'hypothese
+# --------------------
+HypoName = Hypo.GetName()
+#
+# . Options
+# ---------
+HOMARD_Exec_Hypo_Options
+#
+# 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
+MeshName = dico_resu["MeshName"]
+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_HOMARD_Init_ensuite.LastIteration</fromnode> <fromport>return</fromport>
+                     <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
+                  </datalink>
+                  <datalink control="false">
+                     <fromnode>HOMARD_Initialisation.p1_HOMARD_Init_au_debut.Case_Options</fromnode> <fromport>Iter0</fromport>
+                     <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
+                  </datalink>
+                  <datalink control="false">
+                     <fromnode>HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis</fromnode> <fromport>return</fromport>
+                     <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
+                  </datalink>
+                  <datalink control="false">
+                     <fromnode>HOMARD_Initialisation.p1_HOMARD_Init_au_debut.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>MeshName</fromport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode> <toport>MeshName</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.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>Tant_que_le_calcul_n_a_pas_converge</tonode> </control>
+   <control> <fromnode>Tant_que_le_calcul_n_a_pas_converge</fromnode> <tonode>Bilan</tonode> </control>
+   <datalink control="false">
+      <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> <toport>condition</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> <toport>condition</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
+      <tonode>Bilan</tonode> <toport>MessInfo</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
+      <tonode>Bilan</tonode> <toport>MessInfo</toport>
+   </datalink>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode><toport>CaseName</toport>
+      <value><string>Calcul</string></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration</tonode><toport>CaseName</toport>
+      <value><string>Calcul</string></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis</tonode><toport>HypoName</toport>
+      <value><string>Hypo</string></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis</tonode><toport>HypoName</toport>
+      <value><string>Hypo</string></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode><toport>condition</toport>
+      <value><boolean>true</boolean></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
+      <value><int>0</int></value>
+   </parameter>
+PARAMETRES
+   <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="Tant_que_le_calcul_n_a_pas_converge" x="4" y="103" width="569" height="514" expanded="1" expx="4" expy="103" expWidth="569" expHeight="514" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.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="Tant_que_le_calcul_n_a_pas_converge.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="Tant_que_le_calcul_n_a_pas_converge.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="Tant_que_le_calcul_n_a_pas_converge.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="Tant_que_le_calcul_n_a_pas_converge.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="Tant_que_le_calcul_n_a_pas_converge.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="Tant_que_le_calcul_n_a_pas_converge.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="Tant_que_le_calcul_n_a_pas_converge.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="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut" 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="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.Case_Options" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="322" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite" 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="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration" x="0" y="0" width="158" height="36" expanded="1" expx="4" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis" x="0" y="0" width="158" height="36" expanded="1" expx="163" expy="32" expWidth="158" expHeight="36" shownState="2"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.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>
index f48fb7e734bae2fc805a6e64b04d700c371a2260..a8202e39eb00adfabd806d58e6fc2a8aa5b59f4f 100644 (file)
@@ -35,6 +35,7 @@ YACSDriver::YACSDriver(const std::string YACSFile, const std::string DirName):
   _YACSFile( "" ), _DirName( "" ),
   _Texte( "" ),
   _Texte_parametres( "" ),
+  _noeud_1( "CreateHypothesis" ),
   _bLu( false )
 {
   MESSAGE("YACSFile = "<<YACSFile<<", DirName ="<<DirName);
@@ -104,22 +105,22 @@ void YACSDriver::Texte_HOMARD_Init_au_debut_Case_Options( const std::string pyth
 //===============================================================================
 // La description des zones
 // ZoneType : le type de la zone
-// pythonZone : le python correspondant a la zone
+// pythonStructure : le python correspondant a la zone
 // methode : methode associee a la creation de la zone
 // ZoneName : nom de la zone
-// noeud_1 : noeud de depart
 //===============================================================================
-std::string YACSDriver::Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std::string pythonZone, const std::string methode, const std::string ZoneName, const std::string noeud_1 )
+std::string YACSDriver::Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName )
 {
-  MESSAGE("Texte_HOMARD_Init_au_debut_Zone, ZoneType = "<<ZoneType<<", pythonZone = "<<pythonZone);
-  MESSAGE("methode = "<<methode<<", ZoneName = "<<ZoneName<<", noeud_1 = "<<noeud_1 );
+  MESSAGE("Texte_HOMARD_Init_au_debut_Zone, ZoneType = "<<ZoneType<<", pythonStructure = "<<pythonStructure);
+  MESSAGE("methode = "<<methode<<", ZoneName = "<<ZoneName );
 //
 // 1. Le nom du noeud
   std::string noeud_2 = methode + "_" + ZoneName ;
   std::string node = "Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut." ;
   node += noeud_2 ;
 // 2. Texte de controle
-  std::string texte_control = Texte_control (noeud_1, noeud_2) ;
+  std::string texte_control = Texte_control (_noeud_1, noeud_2) ;
+  _noeud_1 = noeud_2 ;
 // 3. Definition du service
   _Texte += "                           <service name=\"" + noeud_2 + "\">\n" ;
   _Texte += "                              <node>Etude_Initialisation.SetCurrentStudy</node>\n" ;
@@ -131,9 +132,9 @@ std::string YACSDriver::Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std
 // 4.2. Les valeurs numeriques
 //      ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl
 // 4.2.1. Decodage des valeurs
-// La chaine pythonZone est de ce genre :
+// La chaine pythonStructure est de ce genre :
 //   CreateZoneBox( "Zone_1", 0.144, 0.216, 0.096, 0.1464, 0.076, 0.12)
-  std::string ligne = pythonZone ;
+  std::string ligne = pythonStructure ;
 // On commence par ne garder que ce qui suit la premiere virgule
   ligne = GetStringInTexte( ligne, ",", 1 );
 // On boucle pour isoler toutes les chaines dans les virgules
@@ -264,6 +265,156 @@ std::string YACSDriver::Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std
 //
 }
 //===============================================================================
+// La description des frontieres
+// BoundaryType : le type de la frontiere
+// pythonStructure : le python correspondant a la frontiere
+// methode : methode associee a la creation de la frontiere
+// BoundaryName : nom de la frontiere
+//===============================================================================
+std::string YACSDriver::Texte_HOMARD_Init_au_debut_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName )
+{
+  MESSAGE("Texte_HOMARD_Init_au_debut_Boundary, BoundaryType = "<<BoundaryType<<", pythonStructure = "<<pythonStructure);
+  MESSAGE("methode = "<<methode<<", BoundaryName = "<<BoundaryName );
+//
+// 1. Le nom du noeud
+  std::string noeud_2 = methode + "_" + BoundaryName ;
+  std::string node = "Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut." ;
+  node += noeud_2 ;
+// 2. Texte de controle
+  std::string texte_control = Texte_control (_noeud_1, noeud_2) ;
+  _noeud_1 = noeud_2 ;
+// 3. Definition du service
+  _Texte += "                           <service name=\"" + noeud_2 + "\">\n" ;
+  _Texte += "                              <node>Etude_Initialisation.SetCurrentStudy</node>\n" ;
+  _Texte += "                              <method>" + methode + "</method>\n" ;
+// 4. Les inports
+// 4.1. Le nom de la zone
+  _Texte += Texte_inport( "string", "BoundaryName" ) ;
+  TexteParametre( node, "BoundaryName", "string", BoundaryName ) ;
+// 4.2. Les valeurs numeriques
+//      ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl
+// 4.2.1. Decodage des valeurs
+// La chaine pythonStructure est de ce genre :
+//   CreateBoundaryCylinder('cyl_2', 17.5, -2.5, -12.5, -100., -75., -25., 50.)
+//   CreateBoundaryDi("intersection", "PIQUAGE", "/scratch/D68518/Salome/script/sfr_2d_piquage.fr.med")
+  std::string ligne = pythonStructure ;
+// On commence par ne garder que ce qui suit la premiere virgule
+  ligne = GetStringInTexte( ligne, ",", 1 );
+// On boucle pour isoler toutes les chaines dans les virgules
+  std::string lignebis ;
+  std::string x0, x1, x2, x3, x4, x5, x6, x7  ;
+  int iaux = 0  ;
+  while ( ligne != lignebis )
+  {
+    lignebis = GetStringInTexte ( ligne, ",", 0 ) ;
+//     MESSAGE("lignebis = "<<lignebis );
+    if      ( iaux == 0 ) { x0 = lignebis ; }
+    else if ( iaux == 1 ) { x1 = lignebis ; }
+    else if ( iaux == 2 ) { x2 = lignebis ; }
+    else if ( iaux == 3 ) { x3 = lignebis ; }
+    else if ( iaux == 4 ) { x4 = lignebis ; }
+    else if ( iaux == 5 ) { x5 = lignebis ; }
+    else if ( iaux == 6 ) { x6 = lignebis ; }
+    ligne = GetStringInTexte( ligne, ",", 1 );
+    iaux += 1 ;
+  }
+// La derniere valeur est toujours mise dans x7
+  x7 = GetStringInTexte ( ligne, ")", 0 ) ;
+  MESSAGE("coor = "<< 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 ) ;
+    _Texte += Texte_inport( "string", "FileName" ) ;
+    TexteParametre( node, "FileName", "string", BoundaryName ) ;
+  }
+// 4.2. Cas du cylindre (1)
+  else if ( BoundaryType == 1 )
+  {
+    _Texte += Texte_inport( "double", "Xcentre" ) ;
+    _Texte += Texte_inport( "double", "Ycentre" ) ;
+    _Texte += Texte_inport( "double", "Zcentre" ) ;
+    _Texte += Texte_inport( "double", "Xaxis" ) ;
+    _Texte += Texte_inport( "double", "Yaxis" ) ;
+    _Texte += Texte_inport( "double", "Zaxis" ) ;
+    _Texte += Texte_inport( "double", "Radius" ) ;
+    TexteParametre( node, "Xcentre", "double", x0 ) ;
+    TexteParametre( node, "Ycentre", "double", x1 ) ;
+    TexteParametre( node, "Zcentre", "double", x2 ) ;
+    TexteParametre( node, "Xaxis", "double", x3 ) ;
+    TexteParametre( node, "Yaxis", "double", x4 ) ;
+    TexteParametre( node, "Zaxis", "double", x5 ) ;
+    TexteParametre( node, "Radius", "double", x7 ) ;
+  }
+//
+// 4.2. Cas de la sphere (2)
+  else if ( BoundaryType == 2 )
+  {
+    _Texte += Texte_inport( "double", "Xcentre" ) ;
+    _Texte += Texte_inport( "double", "Ycentre" ) ;
+    _Texte += Texte_inport( "double", "Zcentre" ) ;
+    _Texte += Texte_inport( "double", "Radius" ) ;
+    TexteParametre( node, "Xcentre", "double", x0 ) ;
+    TexteParametre( node, "Ycentre", "double", x1 ) ;
+    TexteParametre( node, "Zcentre", "double", x2 ) ;
+    TexteParametre( node, "Radius", "double", x7 ) ;
+  }
+//
+// 4.2. Cas d un cone defini par un axe et un angle
+  else if ( BoundaryType == 3 )
+  {
+    _Texte += Texte_inport( "double", "Xaxis" ) ;
+    _Texte += Texte_inport( "double", "Yaxis" ) ;
+    _Texte += Texte_inport( "double", "Zaxis" ) ;
+    _Texte += Texte_inport( "double", "Angle" ) ;
+    _Texte += Texte_inport( "double", "Xcentre" ) ;
+    _Texte += Texte_inport( "double", "Ycentre" ) ;
+    _Texte += Texte_inport( "double", "Zcentre" ) ;
+    TexteParametre( node, "Xaxis", "double", x0 ) ;
+    TexteParametre( node, "Yaxis", "double", x1 ) ;
+    TexteParametre( node, "Zaxis", "double", x2 ) ;
+    TexteParametre( node, "Angle", "double", x3 ) ;
+    TexteParametre( node, "Xcentre", "double", x4 ) ;
+    TexteParametre( node, "Ycentre", "double", x5 ) ;
+    TexteParametre( node, "Zcentre", "double", x7 ) ;
+  }
+//
+// 4.2. Cas d un cone defini par les 2 rayons
+  else if ( BoundaryType == 4 )
+  {
+    _Texte += Texte_inport( "double", "Xcentre1" ) ;
+    _Texte += Texte_inport( "double", "Ycentre1" ) ;
+    _Texte += Texte_inport( "double", "Zcentre1" ) ;
+    _Texte += Texte_inport( "double", "Radius1" ) ;
+    _Texte += Texte_inport( "double", "Xcentre2" ) ;
+    _Texte += Texte_inport( "double", "Ycentre2" ) ;
+    _Texte += Texte_inport( "double", "Zcentre2" ) ;
+    _Texte += Texte_inport( "double", "Radius2" ) ;
+    TexteParametre( node, "Xcentre1", "double", x0 ) ;
+    TexteParametre( node, "Ycentre1", "double", x1 ) ;
+    TexteParametre( node, "Zcentre1", "double", x2 ) ;
+    TexteParametre( node, "Radius1", "double", x3 ) ;
+    TexteParametre( node, "Xcentre2", "double", x4 ) ;
+    TexteParametre( node, "Ycentre2", "double", x5 ) ;
+    TexteParametre( node, "Zcentre2", "double", x6 ) ;
+    TexteParametre( node, "Radius2", "double", x7 ) ;
+  }
+//
+// 4.2. Erreur
+  else
+  { ASSERT("Type de frontiere inconnu." == 0); }
+
+//
+// 5. La fin
+  _Texte += "                              <outport name=\"return\" type=\"HOMARD_Boundary\"/>\n" ;
+  _Texte += "                           </service>\n" ;
+//
+  return texte_control ;
+//
+}
+//===============================================================================
 // Controle des enchainements de noeud dans le noeud HOMARD_Init_au_debut
 //===============================================================================
   std::string YACSDriver::Texte_HOMARD_Init_au_debut_control()
index b95cf1ffebd061f938f3adbc6358ef2e37f6044a..1c565bdabaa5155beefb5df79b28ef1284ed008a 100644 (file)
@@ -35,7 +35,8 @@ public:
   void        Texte_DataInit_MeshFile( const std::string Meshfile ) ;
   void        Texte_Alternance_Calcul_HOMARD_Calcul( const std::string FileName ) ;
   void        Texte_HOMARD_Init_au_debut_Case_Options( const std::string pythonCas ) ;
-  std::string Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std::string pythonZone, const std::string methode, const std::string ZoneName, const std::string noeud_1 ) ;
+  std::string Texte_HOMARD_Init_au_debut_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName ) ;
+  std::string Texte_HOMARD_Init_au_debut_Zone( int ZoneType, const std::string pythonStructure, const std::string methode, const std::string ZoneName ) ;
   std::string Texte_HOMARD_Init_au_debut_control() ;
   std::string Texte_control( const std::string noeud_1, const std::string noeud_2 ) ;
   std::string Texte_inport( const std::string inport_type, const std::string inport_nom ) ;
@@ -47,10 +48,11 @@ public:
   //
 
 public:
-  std::string _YACSFile;
-  std::string _DirName;
-  std::string _Texte;
-  std::string _Texte_parametres;
+  std::string _YACSFile ;
+  std::string _DirName ;
+  std::string _Texte ;
+  std::string _Texte_parametres ;
+  std::string _noeud_1 ;
   bool _bLu;
 
 private :
index d99eb184b2947ba19586431db766dfaa6d900ba0..0e161e0873f49b883e1aa96f4dd9b8d70c37a6fe 100755 (executable)
@@ -2777,7 +2777,7 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
     std::list<std::string>::const_iterator it = ListeBoundaryTraitees.begin();
     while (it != ListeBoundaryTraitees.end())
     {
-      MESSAGE ( "... BoundaryNameTraitee = " << *it);
+      MESSAGE ( "..... BoundaryNameTraitee = " << *it);
       if ( BoundaryName == *it ) { A_faire = 0 ; }
       it++;
     }
@@ -3540,17 +3540,13 @@ CORBA::Long HOMARD_Gen_i::WriteYACSSchema (const char* nomCas, const char* Scrip
       {
         myDriver->Texte_python( pythonHypo, 3, "Hypo" ) ;
       }
-      // F.1.7. Zones : les creations
-      else if ( mot_cle == "HOMARD_Init_au_debut_Zone" )
+      // F.1.7. Zones et frontieres : les creations
+      else if ( mot_cle == "HOMARD_Init_au_debut" )
       {
-        std::string saux ;
-        if ( TypeAdap == 0 )
-        { YACSDriverTexteZone( myHypo, myDriver ) ; }
-        else
-        {
-          saux = myDriver->Texte_HOMARD_Init_au_debut_control();
-          myDriver->TexteAdd(saux);
-        }
+        std::string texte_control = myDriver->Texte_HOMARD_Init_au_debut_control() ;
+        if ( TypeAdap == 0 ) { texte_control += YACSDriverTexteZone( myHypo, myDriver ) ; }
+        texte_control += YACSDriverTexteBoundary( myCase, myDriver ) ;
+        myDriver->TexteAdd(texte_control);
       }
       // F.1.8. Zones : les parametres
       else if ( mot_cle == "PARAMETRES" )
@@ -3584,18 +3580,15 @@ CORBA::Long HOMARD_Gen_i::WriteYACSSchema (const char* nomCas, const char* Scrip
 //=============================================================================
 // Ecriture d'un schema YACS : ecriture des zones associees a une hypothese
 //=============================================================================
-void HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver)
+std::string HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver)
 {
   MESSAGE ( "YACSDriverTexteZone" );
   // A. Les zones associees a cette hypothese
   HOMARD::listeZonesHypo* ListZone = myHypo->GetZones();
   int numberOfZonesx2 = ListZone->length();
 
-  // B. Initialisation du texte de controle
-  std::string texte_control = myDriver->Texte_HOMARD_Init_au_debut_control() ;
-
-  // C. Parcours des zones
-  std::string noeud = "CreateHypothesis" ;
+  // B. Parcours des zones
+  std::string texte_control ;
   for (int iaux = 0; iaux< numberOfZonesx2; iaux++)
   {
     // 1. Reperage de la zone
@@ -3607,33 +3600,88 @@ void HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YAC
     //    La premiere ligne est un commentaire a eliminer
     //    La seconde ligne est l'instruction a proprement parler ; on ne garde que ce qui suit le "."
     CORBA::String_var dumpCorbaZone = myZone->GetDumpPython();
-    std::string pythonZone_0 = dumpCorbaZone.in();
-    MESSAGE ("pythonZone_0 :"<<pythonZone_0);
-    std::istringstream tout (pythonZone_0) ;
+    std::string pythonStructure_0 = dumpCorbaZone.in();
+    MESSAGE ("pythonStructure_0 :"<<pythonStructure_0);
+    std::istringstream tout (pythonStructure_0) ;
     std::string ligne ;
-    std::string pythonZone ;
+    std::string pythonStructure ;
     while ( std::getline( tout, ligne ) )
-    { pythonZone = GetStringInTexte ( ligne, ".", 1 ) ; }
-    MESSAGE ("pythonZone :\n"<<pythonZone);
+    { pythonStructure = GetStringInTexte ( ligne, ".", 1 ) ; }
+    MESSAGE ("pythonStructure :\n"<<pythonStructure);
     // 3. Decodage du nom du service
-    std::string methode = GetStringInTexte ( pythonZone, "(", 0 ) ;
+    std::string methode = GetStringInTexte ( pythonStructure, "(", 0 ) ;
     MESSAGE ( "... methode = " << methode);
     // 4. Mise en place des instructions
     int ZoneType = myZone->GetType();
     MESSAGE ( "... ZoneType = " << ZoneType);
-    std::string texte_control_zone ;
-    texte_control_zone = myDriver->Texte_HOMARD_Init_au_debut_Zone(ZoneType, pythonZone, methode, ZoneName, noeud );
-    texte_control += texte_control_zone ;
+    std::string texte_control_0 ;
+    texte_control_0 = myDriver->Texte_HOMARD_Init_au_debut_Zone(ZoneType, pythonStructure, methode, ZoneName );
+    texte_control += texte_control_0 ;
     // 5. Decalage
-    noeud = methode + "_" + ZoneName ;
     iaux += 1 ;
   }
 
-  // D. Ajout du texte de controle
-  MESSAGE ( "... texte_control =\n" << texte_control);
-  myDriver->TexteAdd(texte_control) ;
+  return texte_control ;
+}
+//=============================================================================
+// Ecriture d'un schema YACS : ecriture des frontieres associees au cas
+//=============================================================================
+std::string HOMARD_Gen_i::YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, YACSDriver* myDriver)
+{
+  MESSAGE ( "YACSDriverTexteBoundary" );
+  // A. Les frontieres associees au cas
+  HOMARD::ListBoundaryGroupType* ListBoundaryGroupType = myCase->GetBoundaryGroup();
+  int numberOfitems = ListBoundaryGroupType->length();
 
-  return ;
+  // B. Parcours des frontieres
+  std::string texte_control ;
+  std::list<std::string>  ListeBoundaryTraitees ;
+  for (int NumBoundary = 0; NumBoundary< numberOfitems; NumBoundary=NumBoundary+2)
+  {
+    std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]);
+    MESSAGE ( "... BoundaryName = " << BoundaryName);
+    // Attention a n'ecrire la definition qu'une seule fois car elle peut se trouver
+    // plusieurs fois dans la definition du cas, d'ou la liste ListeBoundaryTraitees
+    int A_faire = 1 ;
+    std::list<std::string>::const_iterator it = ListeBoundaryTraitees.begin();
+    while (it != ListeBoundaryTraitees.end())
+    {
+      MESSAGE ( "..... BoundaryNameTraitee = " << *it);
+      if ( BoundaryName == *it ) { A_faire = 0 ; }
+      it++;
+    }
+    if ( A_faire == 1 )
+    {
+    // 1. Caracteristiques de la frontiere
+      HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName];
+      ASSERT(!CORBA::is_nil(myBoundary));
+      // 2. Les instructions python associees a la frontiere
+      //    La premiere ligne est un commentaire a eliminer
+      //    La seconde ligne est l'instruction a proprement parler ; on ne garde que ce qui suit le "."
+      CORBA::String_var dumpCorbaBoundary = myBoundary->GetDumpPython();
+      std::string pythonStructure_0 = dumpCorbaBoundary.in();
+      MESSAGE ("pythonStructure_0 :"<<pythonStructure_0);
+      std::istringstream tout (pythonStructure_0) ;
+      std::string ligne ;
+      std::string pythonStructure ;
+      while ( std::getline( tout, ligne ) )
+      { pythonStructure = GetStringInTexte ( ligne, ".", 1 ) ; }
+      MESSAGE ("pythonStructure :\n"<<pythonStructure);
+      // 3. Decodage du nom du service
+      std::string methode = GetStringInTexte ( pythonStructure, "(", 0 ) ;
+      MESSAGE ( "... methode = " << methode);
+      // 4. Mise en place des instructions
+      int BoundaryType = myBoundary->GetType();
+      MESSAGE ( "... BoundaryType = " << BoundaryType);
+      std::string texte_control_0 ;
+      texte_control_0 = myDriver->Texte_HOMARD_Init_au_debut_Boundary(BoundaryType, pythonStructure, methode, BoundaryName );
+      texte_control += texte_control_0 ;
+      // 5. Memorisation du traitement
+      ListeBoundaryTraitees.push_back( BoundaryName );
+    }
+  }
+
+  return texte_control ;
 }
 //
 //=============================================================================
index 509e07dab8d561f1b66ec24f1c7455d266940c99..f0606137a39ac0d14a0eaae4082b2cc66368c1eb 100644 (file)
@@ -183,7 +183,8 @@ public:
 
 // YACS
   CORBA::Long                     WriteYACSSchema (const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile);
-  void                            YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver);
+  std::string                     YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver);
+  std::string                     YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, YACSDriver* myDriver);
 
   void                            IsValidStudy();