Salome HOME
Correction pour les types des schémas.
authornicolas <nicolas>
Tue, 24 Sep 2013 14:26:53 +0000 (14:26 +0000)
committernicolas <nicolas>
Tue, 24 Sep 2013 14:26:53 +0000 (14:26 +0000)
Complément de documentation.

14 files changed:
doc/en/index.rst
doc/files/licence.en.txt [new file with mode: 0644]
doc/files/licence.fr.txt [new file with mode: 0644]
doc/files/yacs_script.py
doc/fr/index.rst
doc/licence.txt [deleted file]
src/HOMARD/HOMARD_YACS.cxx
src/HOMARDGUI/CreateHypothesis.h
src/HOMARDGUI/CreateHypothesis.ui
src/HOMARDGUI/MonCreateYACS.cxx
src/HOMARDGUI/MonCreateYACS.h
src/HOMARD_I/HOMARD_Gen_i.cxx
tests/test_2.py
tests/test_3.py

index ea2d33085145f823a68a30cd2311e5c43fb790a6..d574023a8fc82c3ef8df70a4c0d41bf13a19e5c9 100644 (file)
@@ -37,19 +37,19 @@ Licence
 
 The licence for this module is the GNU Lesser General Public License (Lesser GPL), as stated here and in the source files.
 
-.. literalinclude:: ../licence.txt
+.. literalinclude:: ../files/licence.en.txt
 
 In addition, we expect that all publications describing work using this software, or all commercial products using it, quote at least one of the references given below:
 
+    * G. Nicolas and T. Fouquet, Adaptive Mesh Refinement for Conformal Hexahedral Meshes, *Finite
+      Elements in Analysis and Design*, Vol. 67, pp. 1-12, 2013, doi:10.1016/j.finel.2012.11.008
+
     * *HOMARD, a SALOME module for Mesh Adaptation*,
       http://www.salome-platform.org/
 
     * *SALOME The Open Source Integration Platform for Numerical Simulation*,
       http://www.salome-platform.org/
 
-    * G. Nicolas and T. Fouquet, Adaptive Mesh Refinement for Conformal Hexahedral Meshes, *Finite
-      Elements in Analysis and Design*, Vol. 67, pp. 1-12, 2013, doi:10.1016/j.finel.2012.11.008
-
 The documentation of the module is also covered by the licence and the requirement of quoting.
 
 Index and tables
diff --git a/doc/files/licence.en.txt b/doc/files/licence.en.txt
new file mode 100644 (file)
index 0000000..c9ab5a8
--- /dev/null
@@ -0,0 +1,20 @@
+    <HOMARD, a SALOME module for Mesh Adaptation>
+
+    Copyright (C) 1996-2013 EDF R&D
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
diff --git a/doc/files/licence.fr.txt b/doc/files/licence.fr.txt
new file mode 100644 (file)
index 0000000..c9ab5a8
--- /dev/null
@@ -0,0 +1,20 @@
+    <HOMARD, a SALOME module for Mesh Adaptation>
+
+    Copyright (C) 1996-2013 EDF R&D
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
index f911f6ab9967869a660aa24e1cf76e02ba0726a6..fc742e32f5a6cae378115a0479512bb1e7438cc2 100755 (executable)
@@ -3,7 +3,7 @@
 """
 Lancement d'un calcul ASTER
 """
-__revision__ = "V5.3"
+__revision__ = "V5.4"
 #
 import sys
 import os
@@ -67,7 +67,7 @@ Aucune option supplementaire.
 
 Arguments optionnels :
 
---wait=attente : temps d'attente en secondes entre deux examens de l'etat d'un calcul batch ; si absent, on prend 10.
+--wait=wait : temps d'attente en secondes entre deux examens de l'etat d'un calcul batch ; si absent, on prend 10.
 
 -dump : produit le fichier dump du fichier med de resultats ; par defaut, pas de dump.
 
@@ -1175,18 +1175,21 @@ Affichage de resultats selon les cas
       chaine = "V_TEST"
       nuocc = 1
       erreur, message_erreur, info = self.post_aster_1 ( nomfic, chaine, nuocc )
-      if erreur :
+      if ( erreur > 0 ) :
         break
       self.message_info += info[:-1]
 #
 # 1.2. Details
 #
-      info = info.replace(chaine, " ")
-      laux = info[:-1].split()
-      aux = laux[0]
-      if ( "D" in aux ) :
-        aux = aux.replace("D", "E")
-      dico_resu[chaine] = float(aux)
+      if ( erreur == 0 ) :
+        info = info.replace(chaine, " ")
+        laux = info[:-1].split()
+        aux = laux[0]
+        if ( "D" in aux ) :
+          aux = aux.replace("D", "E")
+        dico_resu[chaine] = float(aux)
+      else :
+        erreur = 0
 #
 # 2. Exploration du fichier mess
 # 2.1. Que chercher ?
@@ -1201,27 +1204,30 @@ Affichage de resultats selon les cas
         else :
           nuocc = 1
         erreur, message_erreur, info = self.post_aster_1 ( nomfic, chaine, nuocc )
-        if erreur :
+        if ( erreur > 0 ) :
           break
         self.message_info += info[:-1]
 #
 # 2.3. Details
 #
-        if chaine == "INSTANT" :
-          l_aux = info[:-1].split()
-          lg_aux = len(l_aux)
-          for iaux in range(lg_aux) :
-            if ( "ORDRE" in l_aux[iaux] ) :
-              if l_aux[iaux+1] == ":" :
-                jaux = iaux+2
-              else :
-                jaux = iaux+1
-              ordre = int(l_aux[jaux])
-              dico_resu["ORDRE"] = ordre
-              dico_resu["PAS_DE_TEMPS"] = ordre
-        elif chaine in ( "NOMBRE DE NOEUDS", "NOMBRE DE MAILLES" ) :
-          l_aux = info[:-1].split(chaine)
-          dico_resu[chaine] = int(l_aux[1])
+        if ( erreur == 0 ) :
+          if chaine == "INSTANT" :
+            l_aux = info[:-1].split()
+            lg_aux = len(l_aux)
+            for iaux in range(lg_aux) :
+              if ( "ORDRE" in l_aux[iaux] ) :
+                if l_aux[iaux+1] == ":" :
+                  jaux = iaux+2
+                else :
+                  jaux = iaux+1
+                ordre = int(l_aux[jaux])
+                dico_resu["ORDRE"] = ordre
+                dico_resu["PAS_DE_TEMPS"] = ordre
+          elif chaine in ( "NOMBRE DE NOEUDS", "NOMBRE DE MAILLES" ) :
+            l_aux = info[:-1].split(chaine)
+            dico_resu[chaine] = int(l_aux[1])
+        else :
+          erreur = 0
 #
       if erreur :
         break
@@ -1253,9 +1259,17 @@ Decodage de fichier
 nomfic = nom du fichier a decoder
 chaine = chaine a chercher
 nuocc = numero de l'occurence a chercher, 0 si toutes
+Retour :
+codret = 0 : tout va bien
+         1 : le fichier de resultats est absent
+        -1 : la chaine est absente
+message_erreur = "" : tout va bien
+               != "" si probleme
+info = la ou les lignes recherchees
     """
 #
     messages_erreur = { 0 : None,
+                       -1 : "La chaine est absente.",
                         1 : "Ce fichier est inconnu." }
 #
     nom_fonction = __name__ + "/post_aster_1"
@@ -1263,7 +1277,7 @@ nuocc = numero de l'occurence a chercher, 0 si toutes
     if self.verbose_max :
       print blabla, "chaine =", chaine, ", nuocc =", nuocc
 #
-    erreur = 0
+    erreur = -1
     message_erreur = " "
     info = ""
 #
@@ -1298,12 +1312,13 @@ nuocc = numero de l'occurence a chercher, 0 si toutes
             iaux += 1
             if ( ( nuocc == 0 ) or ( iaux == nuocc ) ) :
               info += ligne
+              erreur = 0
 #
       break
 #
-    if self.verbose_max :
-      print blabla
-      print ". erreur :", erreur
+    if ( self.verbose_max or ( erreur>0 ) ) :
+      print blabla, "chaine =", chaine, ", nuocc =", nuocc
+      print ". erreur =", erreur
 #
     if erreur :
       message_erreur = messages_erreur[erreur]
index ebe30178408df2b7a3d3f7964eacc22079f2f39e..f670d3584928343e01f91414e3ad6f0bda733b76 100644 (file)
@@ -37,19 +37,19 @@ Licence
 
 La licence pour ce module est la GNU Lesser General Public License (Lesser GPL), tel qu'il est déclaré ici et dans les fichiers source.
 
-.. literalinclude:: ../licence.txt
+.. literalinclude:: ../files/licence.fr.txt
 
 En complément, nous souhaitons que toute publication décrivant un travail utilisant ce module, ou tout produit commercial l'utilisant, cite au moins l'une des références ci-dessous :
 
+    * G. Nicolas and T. Fouquet, Adaptive Mesh Refinement for Conformal Hexahedral Meshes, *Finite
+      Elements in Analysis and Design*, Vol. 67, pp. 1-12, 2013, doi:10.1016/j.finel.2012.11.008
+
     * *HOMARD, a SALOME module for Mesh Adaptation*,
       http://www.salome-platform.org/
 
     * *SALOME The Open Source Integration Platform for Numerical Simulation*,
       http://www.salome-platform.org/
 
-    * G. Nicolas and T. Fouquet, Adaptive Mesh Refinement for Conformal Hexahedral Meshes, *Finite
-      Elements in Analysis and Design*, Vol. 67, pp. 1-12, 2013, doi:10.1016/j.finel.2012.11.008
-
 La documentation de ce module est aussi couverte par la licence et l'obligation de citation.
 
 Index et tables
diff --git a/doc/licence.txt b/doc/licence.txt
deleted file mode 100644 (file)
index c9ab5a8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-    <HOMARD, a SALOME module for Mesh Adaptation>
-
-    Copyright (C) 1996-2013 EDF R&D
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-    See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
index 9931af09d0b5b3be42ca762b5d6fc703b5af5122..b8eb074dbbf219da5166f55e7d1c6523ff61578d 100644 (file)
@@ -83,8 +83,8 @@ std::string HOMARD_YACS::GetDumpPython() const
 // Le type de schema
   aScript << "\t" << _Name << ".SetType(" << _Type << ")\n";
 
-// L'ecriture eventuelle du schema
-  aScript << "\t#" << _Name << ".Write()\n";
+// L'ecriture du schema
+  aScript << "\tcodret = " << _Name << ".Write()\n";
 
   MESSAGE (". Fin de l ecriture du schema " << _Name );
 
index e46f4442d9c51718165650ee296122f7c35903f0..60afee80e8f4fd33359b65ea68dfbb5488cdc0f3 100644 (file)
@@ -1,7 +1,7 @@
 /********************************************************************************
 ** Form generated from reading UI file 'CreateHypothesis.ui'
 **
-** Created: Tue Sep 17 14:10:20 2013
+** Created: Tue Sep 24 14:35:06 2013
 **      by: Qt User Interface Compiler version 4.6.3
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
@@ -651,7 +651,7 @@ public:
 
         doubleSpinBoxDiamMin = new QDoubleSpinBox(GBAdvancedOptions);
         doubleSpinBoxDiamMin->setObjectName(QString::fromUtf8("doubleSpinBoxDiamMin"));
-        doubleSpinBoxDiamMin->setDecimals(5);
+        doubleSpinBoxDiamMin->setDecimals(7);
 
         gridLayout_1->addWidget(doubleSpinBoxDiamMin, 0, 1, 1, 1);
 
index db00adef079944ecbd550d907a88cbc98e887d1c..5163e918992b65e293730968ec75a7797e494540 100644 (file)
       <item row="0" column="1">
        <widget class="QDoubleSpinBox" name="doubleSpinBoxDiamMin">
         <property name="decimals">
-         <number>5</number>
+         <number>7</number>
         </property>
        </widget>
       </item>
index 8b596bddc53b2075ab3c743f68cdb5eab2366950..bff7b2b8424b4d70adc91719ce8eafb21b98fa41 100644 (file)
@@ -41,7 +41,10 @@ MonCreateYACS::MonCreateYACS (bool modal, HOMARD::HOMARD_Gen_var myHomardGen0, Q
   _aCaseName(CaseName),
   _aScriptFile(""),
   _aDirName(""),
-  _aMeshFile("")
+  _aMeshFile(""),
+  _Type(1)
+  // La valeur de _Type doit etre la meme que celle dans HOMARD_Gen_i::CreateYACSSchema
+  // et doit correspondre aux defauts des boutons
   {
 //     MESSAGE("Debut du constructeur de MonCreateYACS");
     myHomardGen=HOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
@@ -93,8 +96,8 @@ void MonCreateYACS::InitConnect()
     connect( PBDir,          SIGNAL(pressed()), this, SLOT(SetDirName()));
     connect( PBMeshFile,     SIGNAL(pressed()), this, SLOT(SetMeshFile()));
 
-    connect( RBConstant,     SIGNAL(clicked()), this, SLOT(SetType(1)));
-    connect( RBVariable,     SIGNAL(clicked()), this, SLOT(SetType(2)));
+    connect( RBConstant,     SIGNAL(clicked()), this, SLOT(SetConstant()));
+    connect( RBVariable,     SIGNAL(clicked()), this, SLOT(SetVariable()));
 
     connect( buttonOk,       SIGNAL(pressed()), this, SLOT(PushOnOK()));
     connect( buttonApply,    SIGNAL(pressed()), this, SLOT(PushOnApply()));
@@ -213,7 +216,10 @@ bool MonCreateYACS:: CreateOrUpdate()
 
   // Ecriture du fichier
   if ( bOK )
-  { aYACS->Write() ; }
+  {
+    int codret = aYACS->Write() ;
+    if ( codret != 0 ) { bOK = false ; }
+  }
 
   return bOK;
 }
@@ -292,8 +298,14 @@ void MonCreateYACS::SetMeshFile()
   LEMeshFile->setText(fileName);
 }
 // ------------------------------------------------------------------------
-void MonCreateYACS::SetType(int Type)
+void MonCreateYACS::SetConstant()
+// ------------------------------------------------------------------------
+{
+  _Type = 1 ;
+}
+// ------------------------------------------------------------------------
+void MonCreateYACS::SetVariable()
 // ------------------------------------------------------------------------
 {
-  _Type=Type;
+  _Type = 2 ;
 }
index 2f1d8843874e5da111ec79ea6998f986500e9c2d..c793068205aedd56ab1b0e9b3509c3bc710ed77a 100644 (file)
@@ -66,7 +66,9 @@ class MonCreateYACS : public QDialog, public Ui_CreateYACS
     virtual void SetScriptFile();
     virtual void SetMeshFile();
 
-    virtual void SetType(int Type);
+//     virtual void SetType(int Type);
+    virtual void SetConstant();
+    virtual void SetVariable();
 
     virtual void PushOnOK();
     virtual bool PushOnApply();
index 3c4deb67df72af779f186e2250b542c483d3b9d7..82d78b0c8915adc65d0b7a07090967fc6f9208cd 100755 (executable)
@@ -3727,7 +3727,6 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* YACSF
   std::string Iter1Name = std::string((*maListe)[0]);
   MESSAGE ("... Iter1Name = " << Iter1Name);
   HOMARD::HOMARD_Iteration_var Iter1 = GetIteration(Iter1Name.c_str()) ;
-  MESSAGE (". Iter1 = " << Iter1);
 
   // E. L'hypothese pour passer de l'iteration initiale a la suivante
   // E.1. La structure
index c3408c95b0dac8a43127a9f9a0834479e43a3ef6..1f6dae839987c65799a8d713f6b8f3dc926dda70 100644 (file)
@@ -140,6 +140,7 @@ Copyright EDF-R&D 2010, 2013
     ScriptFile = os.path.normpath(ScriptFile)
     DirName = Rep_Test_Resu
     YACS_2 = Case_2.CreateYACSSchema("YACS_2", ScriptFile, DirName, MeshFile)
+    YACS_2.SetType(1)
     filexml = os.path.join(Rep_Test_Resu, 'YACS_2.xml')
     error = YACS_2.WriteOnFile(filexml)
     if error :
index 90dd3952bfda9a4580c1646d5ee018b877dfa21f..cb73983cd0dd893c554b900228ecd947dd8bcac4 100644 (file)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Copyright EDF-R&D 2011, 2013
 Test test_3
 """
-__revision__ = "V1.9"
+__revision__ = "V1.10"
 
 #========================================================================
 Test_Name = "test_3"
@@ -154,6 +154,7 @@ Copyright EDF-R&D 2010, 2013
       YACSName = "YACS_3"
       print "-------- Creation of the schema", YACSName
       YACS_3 = Case_3.CreateYACSSchema(YACSName, ScriptFile, DirName, MeshFile)
+      YACS_3.SetType(2)
       error = YACS_3.Write()
       if error :
         error = 10*num + 5