From 12b85cd9ba544095fc7c78d848cd3715f7317966 Mon Sep 17 00:00:00 2001 From: nicolas Date: Tue, 24 Sep 2013 14:26:53 +0000 Subject: [PATCH] =?utf8?q?Correction=20pour=20les=20types=20des=20sch?= =?utf8?q?=C3=83=C2=A9mas.=20Compl=C3=83=C2=A9ment=20de=20documentation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- doc/en/index.rst | 8 +-- doc/{licence.txt => files/licence.en.txt} | 0 doc/files/licence.fr.txt | 20 +++++++ doc/files/yacs_script.py | 73 ++++++++++++++--------- doc/fr/index.rst | 8 +-- src/HOMARD/HOMARD_YACS.cxx | 4 +- src/HOMARDGUI/CreateHypothesis.h | 4 +- src/HOMARDGUI/CreateHypothesis.ui | 2 +- src/HOMARDGUI/MonCreateYACS.cxx | 24 ++++++-- src/HOMARDGUI/MonCreateYACS.h | 4 +- src/HOMARD_I/HOMARD_Gen_i.cxx | 1 - tests/test_2.py | 1 + tests/test_3.py | 3 +- 13 files changed, 101 insertions(+), 51 deletions(-) rename doc/{licence.txt => files/licence.en.txt} (100%) create mode 100644 doc/files/licence.fr.txt diff --git a/doc/en/index.rst b/doc/en/index.rst index ea2d3308..d574023a 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -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/licence.txt b/doc/files/licence.en.txt similarity index 100% rename from doc/licence.txt rename to doc/files/licence.en.txt diff --git a/doc/files/licence.fr.txt b/doc/files/licence.fr.txt new file mode 100644 index 00000000..c9ab5a80 --- /dev/null +++ b/doc/files/licence.fr.txt @@ -0,0 +1,20 @@ + + + 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/yacs_script.py b/doc/files/yacs_script.py index f911f6ab..fc742e32 100755 --- a/doc/files/yacs_script.py +++ b/doc/files/yacs_script.py @@ -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] diff --git a/doc/fr/index.rst b/doc/fr/index.rst index ebe30178..f670d358 100644 --- a/doc/fr/index.rst +++ b/doc/fr/index.rst @@ -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/src/HOMARD/HOMARD_YACS.cxx b/src/HOMARD/HOMARD_YACS.cxx index 9931af09..b8eb074d 100644 --- a/src/HOMARD/HOMARD_YACS.cxx +++ b/src/HOMARD/HOMARD_YACS.cxx @@ -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 ); diff --git a/src/HOMARDGUI/CreateHypothesis.h b/src/HOMARDGUI/CreateHypothesis.h index e46f4442..60afee80 100644 --- a/src/HOMARDGUI/CreateHypothesis.h +++ b/src/HOMARDGUI/CreateHypothesis.h @@ -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); diff --git a/src/HOMARDGUI/CreateHypothesis.ui b/src/HOMARDGUI/CreateHypothesis.ui index db00adef..5163e918 100644 --- a/src/HOMARDGUI/CreateHypothesis.ui +++ b/src/HOMARDGUI/CreateHypothesis.ui @@ -821,7 +821,7 @@ - 5 + 7 diff --git a/src/HOMARDGUI/MonCreateYACS.cxx b/src/HOMARDGUI/MonCreateYACS.cxx index 8b596bdd..bff7b2b8 100644 --- a/src/HOMARDGUI/MonCreateYACS.cxx +++ b/src/HOMARDGUI/MonCreateYACS.cxx @@ -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 ; } diff --git a/src/HOMARDGUI/MonCreateYACS.h b/src/HOMARDGUI/MonCreateYACS.h index 2f1d8843..c7930682 100644 --- a/src/HOMARDGUI/MonCreateYACS.h +++ b/src/HOMARDGUI/MonCreateYACS.h @@ -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(); diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 3c4deb67..82d78b0c 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -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 diff --git a/tests/test_2.py b/tests/test_2.py index c3408c95..1f6dae83 100644 --- a/tests/test_2.py +++ b/tests/test_2.py @@ -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 : diff --git a/tests/test_3.py b/tests/test_3.py index 90dd3952..cb73983c 100644 --- a/tests/test_3.py +++ b/tests/test_3.py @@ -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 -- 2.39.2