From: gdd Date: Mon, 23 Apr 2012 14:59:32 +0000 (+0000) Subject: Update from G. Nicolas X-Git-Tag: TRIPOLI_323~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b813021827bcf78ec21523c8542e418689870d6;p=modules%2Fhomard.git Update from G. Nicolas --- diff --git a/doc/gui_usage.rst b/doc/gui_usage.rst index b75a22df..81e7bf59 100644 --- a/doc/gui_usage.rst +++ b/doc/gui_usage.rst @@ -1,3 +1,5 @@ +.. _gui_usage: + Mode d'emploi pour l'interface graphique ======================================== .. index:: single: cas diff --git a/doc/images/intro_31.png b/doc/images/intro_31.png new file mode 100644 index 00000000..175264e0 Binary files /dev/null and b/doc/images/intro_31.png differ diff --git a/doc/images/intro_32.png b/doc/images/intro_32.png new file mode 100644 index 00000000..f4022ca2 Binary files /dev/null and b/doc/images/intro_32.png differ diff --git a/doc/images/intro_33.png b/doc/images/intro_33.png new file mode 100644 index 00000000..a0bd05e2 Binary files /dev/null and b/doc/images/intro_33.png differ diff --git a/doc/images/intro_34.png b/doc/images/intro_34.png new file mode 100644 index 00000000..94866890 Binary files /dev/null and b/doc/images/intro_34.png differ diff --git a/doc/images/intro_35.png b/doc/images/intro_35.png new file mode 100644 index 00000000..72871479 Binary files /dev/null and b/doc/images/intro_35.png differ diff --git a/doc/images/intro_36.png b/doc/images/intro_36.png new file mode 100644 index 00000000..2d363dad Binary files /dev/null and b/doc/images/intro_36.png differ diff --git a/doc/images/intro_37.png b/doc/images/intro_37.png new file mode 100644 index 00000000..c6f7943d Binary files /dev/null and b/doc/images/intro_37.png differ diff --git a/doc/images/intro_38.png b/doc/images/intro_38.png new file mode 100644 index 00000000..2d29392c Binary files /dev/null and b/doc/images/intro_38.png differ diff --git a/doc/images/intro_39.png b/doc/images/intro_39.png new file mode 100644 index 00000000..ad542ba7 Binary files /dev/null and b/doc/images/intro_39.png differ diff --git a/doc/images/intro_40.png b/doc/images/intro_40.png new file mode 100644 index 00000000..36c447a0 Binary files /dev/null and b/doc/images/intro_40.png differ diff --git a/doc/intro.rst b/doc/intro.rst index ec755610..a40df798 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -1,6 +1,10 @@ +.. _gui_intro: Introduction ============ + +Présentation générale +""""""""""""""""""""" Le logiciel HOMARD est destiné à adapter les maillages dans le cadre des codes de calculs par éléments ou volumes finis. Ce logiciel, réalisé par EDF R&D, procède par raffinement et déraffinement des maillages bidimensionnels ou tridimensionnels. Il est conçu pour être utilisé indépendamment du code de calcul auquel il est couplé. Raffiner le maillage signifie découper des mailles désignées selon des indications founies par l'utilisateur. Déraffiner le maillage signifie revenir en arrière sur des découpages précédemment réalisés : ainsi, en aucun cas HOMARD ne peut simplifier un maillage existant qui aura été créé trop fin. Le déraffinement prend toute son importance dans les calculs quand la zone d'intérêt se déplace au cours du calcul pour ne plus tenir compte de raffinements précédemment réalisés et qui deviennent inutiles. On en trouvera une illustration au bas de cette page. @@ -43,7 +47,8 @@ Des variantes de ce sch Quelques illustrations de maillage adaptés -========================================== +"""""""""""""""""""""""""""""""""""""""""" +.. index:: single: illustration +---------------------------------------------------------------+ +---------------------------------------------------------------+ @@ -78,6 +83,68 @@ Quelques illustrations de maillage adapt | | +---------------------------------------------------------------+ +Démarrage rapide +"""""""""""""""" +.. index:: single: démarrage +.. index:: single: exemple + +L'ensemble des options de pilotage du module HOMARD dans Salome est décrit dans le :ref:`gui_usage`. Mais on trouvera ici le B.A. BA pour découvrir l'utilisation de HOMARD à partir d'un exemple simple. Imaginons que l'on a effectué un calcul de thermique sur un maillage donné. On a récupéré en sortie de ce calcul un fichier au format MED, contenant le maillage et le champ des températures aux noeuds. On aimerait adapter le maillage de telle sorte que l'écart de température entre deux noeuds voisins soit inférieur à une valeur donnée. + +La première action nécessite de lancer le module HOMARD, en créant une nouvelle étude, selon le principe qui a été retenu pour tous les autres modules de Salome. + +.. image:: images/homard_1.png + :align: center + +Une fois le module HOMARD activé, on crée un cas par le choix "*Nouveau cas*" dans le menu HOMARD. La fenêtre suivante apparaît : + +.. image:: images/intro_31.png + :align: center + +Il faut fournir deux informations : le répertoire qui contiendra les fichiers produits par les adaptations successives et le fichier issu du calcul que l'on vient de faire. On valide par "Appliquer et fermer". + +.. image:: images/intro_32.png + :align: center + +L'arbre d'études est enrichi de ce cas. On déplie le cas jusqu'à afficher le maillage correspondant à l'itération 0. On désigne cette itération initiale et on demande une nouvelle itération par "*Nouvelle itération*" dans le menu HOMARD ou à la souris. La fenêtre suivante apparaît : + +.. image:: images/intro_33.png + :align: center + +On désigne le fichier issu du calcul que l'on vient de faire et qui contient le champ de température. C'est le même que celui qui a été donné dans la définition du cas. + +.. image:: images/intro_34.png + :align: center + +On clique sur "Nouveau" dans la rubrique hypothèse. La fenêtre suivante apparaît : + +.. image:: images/intro_35.png + :align: center +On modifie les options par défaut pour correspondre à notre choix de pilotage de l'adaptation. La sélection d'un pilotage par les saut entre éléments et d'un seuil absolu de 4.0 va demander le découpage de chaque arête de maille où le température varie de plus de 4.0 degrés entre les deux extrémités de l'arête. + +.. image:: images/intro_36.png + :align: center + +On valide par "Appliquer et fermer" cette création d'hypothése, puis la création de la nouvelle itération. On se retrouve avec un arbre d'études enrichi avec la description de l'hypothèse créée et de l'itération à calculer, repérée par une icone "en attente". + +Lancer l'adaptation s'obtient en sélectionnant l'itération à calculer. On choisit ensuite "*Calculer*" dans le menu HOMARD ou à la souris. L'arbre d'études s'enrichit de fichiers d'informations et du nom du fichier au format MED qui contient le nouveau maillage, ``maill.01.med``. On remarque qu'il est placé dans le répertoire qui a été désigné à la création du cas. + +.. image:: images/intro_37.png + :align: center +A ce stade, on va utiliser ce nouveau maillage pour un deuxième calcul, dans les mêmes conditions que le premier. Une fois que ce nouveau calcul est achevé, on peut décider de poursuivre le processus d'adaptation. Pour cela on revient dans Salome et on active le module HOMARD. On désigne l'itération que l'avait calculée précédemment "*Iter_1*" et on demande une nouvelle itération. La fenêtre suivante apparaît : + +.. image:: images/intro_38.png + :align: center + +Comme on continue l'adaptation avec le même critére de saut de température entre noeuds voisins, on garde l'hypothèse "*Hypo_1*". Il suffit de désigner le fichier issu du calcul que l'on vient de faire et qui contient le nouveau champ de température. + +.. image:: images/intro_39.png + :align: center + +Comme précédemment, on lance l'adaptation et on récupère les résultats dans le répertoire du cas, dont le maillage ``maill.02.med``. + +.. image:: images/intro_40.png + :align: center +On peut alors lancer un nouveau calcul sur ce nouveau maillage et poursuiver cette alternance calcul/adaptation jusqu'à l'obtention du résultat attendu. diff --git a/src/HOMARDGUI/CreateHypothesis.h b/src/HOMARDGUI/CreateHypothesis.h index 361e4cfd..e40b04b8 100644 --- a/src/HOMARDGUI/CreateHypothesis.h +++ b/src/HOMARDGUI/CreateHypothesis.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'CreateHypothesis.ui' ** -** Created: Thu Mar 22 13:46:51 2012 +** Created: Wed Apr 11 11:35:26 2012 ** by: Qt User Interface Compiler version 4.6.3 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! @@ -37,7 +37,6 @@ class Ui_CreateHypothesis { public: QGridLayout *gridLayout_3; - QLabel *Name; QLineEdit *LEHypothesisName; QGroupBox *GBTypeAdaptation; QHBoxLayout *hboxLayout; @@ -86,7 +85,7 @@ public: QDoubleSpinBox *SpinBox_CAbs; QRadioButton *RBCNo; QGroupBox *GBAreaManagement; - QGridLayout *gridLayout5; + QGridLayout *gridLayout_4; QTableWidget *TWZone; QSpacerItem *horizontalSpacer; QVBoxLayout *vboxLayout1; @@ -96,8 +95,8 @@ public: QPushButton *PBZoneDelete; QSpacerItem *spacerItem2; QGroupBox *GBField; + QGridLayout *gridLayout5; QGridLayout *gridLayout6; - QGridLayout *gridLayout7; QRadioButton *RBFieldNo; QRadioButton *RBFieldAll; QRadioButton *RBFieldChosen; @@ -116,11 +115,12 @@ public: QRadioButton *RBAIR; QRadioButton *RBAID; QGroupBox *GBButtons; - QGridLayout *gridLayout8; + QGridLayout *gridLayout7; QPushButton *buttonOk; QPushButton *buttonApply; QPushButton *buttonCancel; QPushButton *buttonHelp; + QLabel *Name; void setupUi(QDialog *CreateHypothesis) { @@ -136,11 +136,6 @@ public: CreateHypothesis->setSizeGripEnabled(true); gridLayout_3 = new QGridLayout(CreateHypothesis); gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3")); - Name = new QLabel(CreateHypothesis); - Name->setObjectName(QString::fromUtf8("Name")); - - gridLayout_3->addWidget(Name, 0, 0, 1, 1); - LEHypothesisName = new QLineEdit(CreateHypothesis); LEHypothesisName->setObjectName(QString::fromUtf8("LEHypothesisName")); LEHypothesisName->setMinimumSize(QSize(382, 31)); @@ -476,8 +471,8 @@ public: GBAreaManagement->setObjectName(QString::fromUtf8("GBAreaManagement")); sizePolicy.setHeightForWidth(GBAreaManagement->sizePolicy().hasHeightForWidth()); GBAreaManagement->setSizePolicy(sizePolicy); - gridLayout5 = new QGridLayout(GBAreaManagement); - gridLayout5->setObjectName(QString::fromUtf8("gridLayout5")); + gridLayout_4 = new QGridLayout(GBAreaManagement); + gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); TWZone = new QTableWidget(GBAreaManagement); if (TWZone->columnCount() < 3) TWZone->setColumnCount(3); @@ -494,11 +489,11 @@ public: TWZone->setRowCount(0); TWZone->setColumnCount(3); - gridLayout5->addWidget(TWZone, 0, 0, 1, 1); + gridLayout_4->addWidget(TWZone, 0, 0, 1, 1); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - gridLayout5->addItem(horizontalSpacer, 0, 1, 1, 1); + gridLayout_4->addItem(horizontalSpacer, 0, 1, 1, 1); vboxLayout1 = new QVBoxLayout(); #ifndef Q_OS_MAC @@ -537,49 +532,49 @@ public: vboxLayout1->addItem(spacerItem2); - gridLayout5->addLayout(vboxLayout1, 0, 2, 1, 1); + gridLayout_4->addLayout(vboxLayout1, 0, 2, 1, 1); gridLayout_3->addWidget(GBAreaManagement, 5, 0, 1, 2); GBField = new QGroupBox(CreateHypothesis); GBField->setObjectName(QString::fromUtf8("GBField")); - gridLayout6 = new QGridLayout(GBField); + gridLayout5 = new QGridLayout(GBField); #ifndef Q_OS_MAC - gridLayout6->setSpacing(6); + gridLayout5->setSpacing(6); #endif #ifndef Q_OS_MAC - gridLayout6->setContentsMargins(9, 9, 9, 9); + gridLayout5->setContentsMargins(9, 9, 9, 9); #endif - gridLayout6->setObjectName(QString::fromUtf8("gridLayout6")); - gridLayout7 = new QGridLayout(); + gridLayout5->setObjectName(QString::fromUtf8("gridLayout5")); + gridLayout6 = new QGridLayout(); #ifndef Q_OS_MAC - gridLayout7->setSpacing(6); + gridLayout6->setSpacing(6); #endif #ifndef Q_OS_MAC - gridLayout7->setContentsMargins(0, 0, 0, 0); + gridLayout6->setContentsMargins(0, 0, 0, 0); #endif - gridLayout7->setObjectName(QString::fromUtf8("gridLayout7")); + gridLayout6->setObjectName(QString::fromUtf8("gridLayout6")); RBFieldNo = new QRadioButton(GBField); RBFieldNo->setObjectName(QString::fromUtf8("RBFieldNo")); RBFieldNo->setChecked(true); - gridLayout7->addWidget(RBFieldNo, 0, 0, 1, 1); + gridLayout6->addWidget(RBFieldNo, 0, 0, 1, 1); RBFieldAll = new QRadioButton(GBField); RBFieldAll->setObjectName(QString::fromUtf8("RBFieldAll")); RBFieldAll->setChecked(false); - gridLayout7->addWidget(RBFieldAll, 0, 1, 1, 1); + gridLayout6->addWidget(RBFieldAll, 0, 1, 1, 1); RBFieldChosen = new QRadioButton(GBField); RBFieldChosen->setObjectName(QString::fromUtf8("RBFieldChosen")); RBFieldChosen->setChecked(false); - gridLayout7->addWidget(RBFieldChosen, 0, 2, 1, 1); + gridLayout6->addWidget(RBFieldChosen, 0, 2, 1, 1); - gridLayout6->addLayout(gridLayout7, 0, 0, 1, 1); + gridLayout5->addLayout(gridLayout6, 0, 0, 1, 1); TWField = new QTableWidget(GBField); if (TWField->columnCount() < 2) @@ -590,7 +585,7 @@ public: TWField->setHorizontalHeaderItem(1, __qtablewidgetitem6); TWField->setObjectName(QString::fromUtf8("TWField")); - gridLayout6->addWidget(TWField, 1, 0, 1, 1); + gridLayout5->addWidget(TWField, 1, 0, 1, 1); gridLayout_3->addWidget(GBField, 6, 0, 1, 2); @@ -665,37 +660,42 @@ public: GBButtons = new QGroupBox(CreateHypothesis); GBButtons->setObjectName(QString::fromUtf8("GBButtons")); - gridLayout8 = new QGridLayout(GBButtons); + gridLayout7 = new QGridLayout(GBButtons); #ifndef Q_OS_MAC - gridLayout8->setSpacing(6); + gridLayout7->setSpacing(6); #endif #ifndef Q_OS_MAC - gridLayout8->setContentsMargins(9, 9, 9, 9); + gridLayout7->setContentsMargins(9, 9, 9, 9); #endif - gridLayout8->setObjectName(QString::fromUtf8("gridLayout8")); + gridLayout7->setObjectName(QString::fromUtf8("gridLayout7")); buttonOk = new QPushButton(GBButtons); buttonOk->setObjectName(QString::fromUtf8("buttonOk")); - gridLayout8->addWidget(buttonOk, 0, 0, 1, 1); + gridLayout7->addWidget(buttonOk, 0, 0, 1, 1); buttonApply = new QPushButton(GBButtons); buttonApply->setObjectName(QString::fromUtf8("buttonApply")); - gridLayout8->addWidget(buttonApply, 0, 1, 1, 1); + gridLayout7->addWidget(buttonApply, 0, 1, 1, 1); buttonCancel = new QPushButton(GBButtons); buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); - gridLayout8->addWidget(buttonCancel, 0, 2, 1, 1); + gridLayout7->addWidget(buttonCancel, 0, 2, 1, 1); buttonHelp = new QPushButton(GBButtons); buttonHelp->setObjectName(QString::fromUtf8("buttonHelp")); - gridLayout8->addWidget(buttonHelp, 0, 3, 1, 1); + gridLayout7->addWidget(buttonHelp, 0, 3, 1, 1); gridLayout_3->addWidget(GBButtons, 10, 0, 1, 2); + Name = new QLabel(CreateHypothesis); + Name->setObjectName(QString::fromUtf8("Name")); + + gridLayout_3->addWidget(Name, 0, 0, 1, 1); + LEHypothesisName->raise(); GBTypeAdaptation->raise(); GBUniform->raise(); @@ -717,7 +717,6 @@ public: void retranslateUi(QDialog *CreateHypothesis) { CreateHypothesis->setWindowTitle(QApplication::translate("CreateHypothesis", "Create an hypothesis", 0, QApplication::UnicodeUTF8)); - Name->setText(QApplication::translate("CreateHypothesis", "Name", 0, QApplication::UnicodeUTF8)); GBTypeAdaptation->setTitle(QApplication::translate("CreateHypothesis", "Type of adaptation", 0, QApplication::UnicodeUTF8)); RBUniforme->setText(QApplication::translate("CreateHypothesis", "Uniform", 0, QApplication::UnicodeUTF8)); RBChamp->setText(QApplication::translate("CreateHypothesis", "Driven by a field", 0, QApplication::UnicodeUTF8)); @@ -773,7 +772,7 @@ public: GBAdvancedOptions->setTitle(QApplication::translate("CreateHypothesis", "Advanced options", 0, QApplication::UnicodeUTF8)); TLMinimalDiameter->setText(QApplication::translate("CreateHypothesis", "Minimal diameter", 0, QApplication::UnicodeUTF8)); TLMaximalLevel->setText(QApplication::translate("CreateHypothesis", "Maximal level", 0, QApplication::UnicodeUTF8)); - GBAdapInit->setTitle(QApplication::translate("CreateHypothesis", "Intialization of adaptation", 0, QApplication::UnicodeUTF8)); + GBAdapInit->setTitle(QApplication::translate("CreateHypothesis", "Initialization of adaptation", 0, QApplication::UnicodeUTF8)); RBAIN->setText(QApplication::translate("CreateHypothesis", "Nothing", 0, QApplication::UnicodeUTF8)); RBAIR->setText(QApplication::translate("CreateHypothesis", "Refinement", 0, QApplication::UnicodeUTF8)); RBAID->setText(QApplication::translate("CreateHypothesis", "Coarsening", 0, QApplication::UnicodeUTF8)); @@ -782,6 +781,7 @@ public: buttonApply->setText(QApplication::translate("CreateHypothesis", "Apply", 0, QApplication::UnicodeUTF8)); buttonCancel->setText(QApplication::translate("CreateHypothesis", "Cancel", 0, QApplication::UnicodeUTF8)); buttonHelp->setText(QApplication::translate("CreateHypothesis", "Help", 0, QApplication::UnicodeUTF8)); + Name->setText(QApplication::translate("CreateHypothesis", "Name", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; diff --git a/src/HOMARDGUI/CreateHypothesis.ui b/src/HOMARDGUI/CreateHypothesis.ui index 8c7ec676..686a25ab 100644 --- a/src/HOMARDGUI/CreateHypothesis.ui +++ b/src/HOMARDGUI/CreateHypothesis.ui @@ -26,13 +26,6 @@ true - - - - Name - - - @@ -554,7 +547,7 @@ Zone management - + @@ -800,7 +793,7 @@ - Intialization of adaptation + Initialization of adaptation @@ -876,6 +869,13 @@ + + + + Name + + + LEHypothesisName GBTypeAdaptation diff --git a/src/HOMARDGUI/CreateIteration.h b/src/HOMARDGUI/CreateIteration.h index 36fa710d..c3e48c90 100644 --- a/src/HOMARDGUI/CreateIteration.h +++ b/src/HOMARDGUI/CreateIteration.h @@ -1,10 +1,10 @@ /******************************************************************************** -** Form generated from reading ui file 'CreateIteration.ui' +** Form generated from reading UI file 'CreateIteration.ui' ** -** Created: Thu Sep 1 13:07:29 2011 -** by: Qt User Interface Compiler version 4.2.1 +** Created: Wed Apr 11 11:35:39 2012 +** by: Qt User Interface Compiler version 4.6.3 ** -** WARNING! All changes made in this file will be lost when recompiling ui file! +** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef CREATEITERATION_H @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,8 @@ #include #include +QT_BEGIN_NAMESPACE + class Ui_CreateIteration { public: @@ -75,275 +78,287 @@ public: void setupUi(QWidget *CreateIteration) { - CreateIteration->setObjectName(QString::fromUtf8("CreateIteration")); - gridLayout = new QGridLayout(CreateIteration); - gridLayout->setSpacing(6); - gridLayout->setMargin(9); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - GBField = new QGroupBox(CreateIteration); - GBField->setObjectName(QString::fromUtf8("GBField")); - gridLayout1 = new QGridLayout(GBField); - gridLayout1->setSpacing(6); - gridLayout1->setMargin(9); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); - LEFieldFile = new QLineEdit(GBField); - LEFieldFile->setObjectName(QString::fromUtf8("LEFieldFile")); - LEFieldFile->setMinimumSize(QSize(282, 21)); - - gridLayout1->addWidget(LEFieldFile, 0, 2, 1, 5); + if (CreateIteration->objectName().isEmpty()) + CreateIteration->setObjectName(QString::fromUtf8("CreateIteration")); + CreateIteration->resize(610, 598); + gridLayout = new QGridLayout(CreateIteration); +#ifndef Q_OS_MAC + gridLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + GBField = new QGroupBox(CreateIteration); + GBField->setObjectName(QString::fromUtf8("GBField")); + gridLayout1 = new QGridLayout(GBField); +#ifndef Q_OS_MAC + gridLayout1->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout1->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + LEFieldFile = new QLineEdit(GBField); + LEFieldFile->setObjectName(QString::fromUtf8("LEFieldFile")); + LEFieldFile->setMinimumSize(QSize(282, 21)); - spacerItem = new QSpacerItem(138, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); + gridLayout1->addWidget(LEFieldFile, 0, 2, 1, 5); - gridLayout1->addItem(spacerItem, 1, 3, 1, 4); + spacerItem = new QSpacerItem(138, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); - RBChosen = new QRadioButton(GBField); - RBChosen->setObjectName(QString::fromUtf8("RBChosen")); + gridLayout1->addItem(spacerItem, 1, 3, 1, 4); - gridLayout1->addWidget(RBChosen, 2, 6, 1, 1); + RBChosen = new QRadioButton(GBField); + RBChosen->setObjectName(QString::fromUtf8("RBChosen")); - spacerItem1 = new QSpacerItem(255, 13, QSizePolicy::Expanding, QSizePolicy::Minimum); + gridLayout1->addWidget(RBChosen, 2, 6, 1, 1); - gridLayout1->addItem(spacerItem1, 4, 6, 1, 1); + spacerItem1 = new QSpacerItem(255, 13, QSizePolicy::Expanding, QSizePolicy::Minimum); - SpinBox_Rank = new QSpinBox(GBField); - SpinBox_Rank->setObjectName(QString::fromUtf8("SpinBox_Rank")); - SpinBox_Rank->setMaximum(1010000); - SpinBox_Rank->setMinimum(-1); - SpinBox_Rank->setValue(1); + gridLayout1->addItem(spacerItem1, 4, 6, 1, 1); - gridLayout1->addWidget(SpinBox_Rank, 4, 5, 1, 1); + SpinBox_Rank = new QSpinBox(GBField); + SpinBox_Rank->setObjectName(QString::fromUtf8("SpinBox_Rank")); + SpinBox_Rank->setMaximum(1010000); + SpinBox_Rank->setMinimum(-1); + SpinBox_Rank->setValue(1); - Rank = new QLabel(GBField); - Rank->setObjectName(QString::fromUtf8("Rank")); + gridLayout1->addWidget(SpinBox_Rank, 4, 5, 1, 1); - gridLayout1->addWidget(Rank, 4, 4, 1, 1); + Rank = new QLabel(GBField); + Rank->setObjectName(QString::fromUtf8("Rank")); - spacerItem2 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); + gridLayout1->addWidget(Rank, 4, 4, 1, 1); - gridLayout1->addItem(spacerItem2, 4, 2, 1, 2); + spacerItem2 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); - SpinBox_TimeStep = new QSpinBox(GBField); - SpinBox_TimeStep->setObjectName(QString::fromUtf8("SpinBox_TimeStep")); - SpinBox_TimeStep->setMaximum(100000); - SpinBox_TimeStep->setMinimum(-2); - SpinBox_TimeStep->setValue(-1); + gridLayout1->addItem(spacerItem2, 4, 2, 1, 2); - gridLayout1->addWidget(SpinBox_TimeStep, 4, 1, 1, 1); + SpinBox_TimeStep = new QSpinBox(GBField); + SpinBox_TimeStep->setObjectName(QString::fromUtf8("SpinBox_TimeStep")); + SpinBox_TimeStep->setMaximum(100000); + SpinBox_TimeStep->setMinimum(-2); + SpinBox_TimeStep->setValue(-1); - TimeStep = new QLabel(GBField); - TimeStep->setObjectName(QString::fromUtf8("TimeStep")); + gridLayout1->addWidget(SpinBox_TimeStep, 4, 1, 1, 1); - gridLayout1->addWidget(TimeStep, 4, 0, 1, 1); + TimeStep = new QLabel(GBField); + TimeStep->setObjectName(QString::fromUtf8("TimeStep")); - spacerItem3 = new QSpacerItem(138, 28, QSizePolicy::Minimum, QSizePolicy::Expanding); + gridLayout1->addWidget(TimeStep, 4, 0, 1, 1); - gridLayout1->addItem(spacerItem3, 3, 0, 1, 4); + spacerItem3 = new QSpacerItem(138, 28, QSizePolicy::Minimum, QSizePolicy::Expanding); - RBLast = new QRadioButton(GBField); - RBLast->setObjectName(QString::fromUtf8("RBLast")); + gridLayout1->addItem(spacerItem3, 3, 0, 1, 4); - gridLayout1->addWidget(RBLast, 2, 3, 1, 3); + RBLast = new QRadioButton(GBField); + RBLast->setObjectName(QString::fromUtf8("RBLast")); - RBNo = new QRadioButton(GBField); - RBNo->setObjectName(QString::fromUtf8("RBNo")); - RBNo->setCheckable(true); - RBNo->setChecked(true); + gridLayout1->addWidget(RBLast, 2, 3, 1, 3); - gridLayout1->addWidget(RBNo, 2, 0, 1, 3); + RBNo = new QRadioButton(GBField); + RBNo->setObjectName(QString::fromUtf8("RBNo")); + RBNo->setCheckable(true); + RBNo->setChecked(true); - PushFieldFile = new QPushButton(GBField); - PushFieldFile->setObjectName(QString::fromUtf8("PushFieldFile")); + gridLayout1->addWidget(RBNo, 2, 0, 1, 3); - gridLayout1->addWidget(PushFieldFile, 0, 1, 1, 1); + PushFieldFile = new QPushButton(GBField); + PushFieldFile->setObjectName(QString::fromUtf8("PushFieldFile")); - FieldFile = new QLabel(GBField); - FieldFile->setObjectName(QString::fromUtf8("FieldFile")); + gridLayout1->addWidget(PushFieldFile, 0, 1, 1, 1); - gridLayout1->addWidget(FieldFile, 0, 0, 1, 1); + FieldFile = new QLabel(GBField); + FieldFile->setObjectName(QString::fromUtf8("FieldFile")); + gridLayout1->addWidget(FieldFile, 0, 0, 1, 1); - gridLayout->addWidget(GBField, 6, 0, 1, 4); - Iteration_Name = new QLabel(CreateIteration); - Iteration_Name->setObjectName(QString::fromUtf8("Iteration_Name")); + gridLayout->addWidget(GBField, 6, 0, 1, 4); - gridLayout->addWidget(Iteration_Name, 0, 0, 1, 2); + Iteration_Name = new QLabel(CreateIteration); + Iteration_Name->setObjectName(QString::fromUtf8("Iteration_Name")); - LEIterationName = new QLineEdit(CreateIteration); - LEIterationName->setObjectName(QString::fromUtf8("LEIterationName")); - LEIterationName->setMinimumSize(QSize(290, 21)); - LEIterationName->setMaxLength(200); + gridLayout->addWidget(Iteration_Name, 0, 0, 1, 2); - gridLayout->addWidget(LEIterationName, 0, 2, 1, 2); + LEIterationName = new QLineEdit(CreateIteration); + LEIterationName->setObjectName(QString::fromUtf8("LEIterationName")); + LEIterationName->setMinimumSize(QSize(290, 21)); + LEIterationName->setMaxLength(200); - Iter_Parent = new QLabel(CreateIteration); - Iter_Parent->setObjectName(QString::fromUtf8("Iter_Parent")); + gridLayout->addWidget(LEIterationName, 0, 2, 1, 2); - gridLayout->addWidget(Iter_Parent, 1, 0, 1, 1); + Iter_Parent = new QLabel(CreateIteration); + Iter_Parent->setObjectName(QString::fromUtf8("Iter_Parent")); - spacerItem4 = new QSpacerItem(20, 24, QSizePolicy::Minimum, QSizePolicy::Expanding); + gridLayout->addWidget(Iter_Parent, 1, 0, 1, 1); - gridLayout->addItem(spacerItem4, 1, 1, 1, 1); + spacerItem4 = new QSpacerItem(20, 24, QSizePolicy::Minimum, QSizePolicy::Expanding); - PBIterParent = new QPushButton(CreateIteration); - PBIterParent->setObjectName(QString::fromUtf8("PBIterParent")); - PBIterParent->setEnabled(true); - PBIterParent->setMaximumSize(QSize(50, 27)); + gridLayout->addItem(spacerItem4, 1, 1, 1, 1); - gridLayout->addWidget(PBIterParent, 1, 2, 1, 1); + PBIterParent = new QPushButton(CreateIteration); + PBIterParent->setObjectName(QString::fromUtf8("PBIterParent")); + PBIterParent->setEnabled(true); + PBIterParent->setMaximumSize(QSize(50, 27)); - LEIterationParentName = new QLineEdit(CreateIteration); - LEIterationParentName->setObjectName(QString::fromUtf8("LEIterationParentName")); - LEIterationParentName->setMinimumSize(QSize(0, 21)); - LEIterationParentName->setMaxLength(200); - LEIterationParentName->setReadOnly(true); + gridLayout->addWidget(PBIterParent, 1, 2, 1, 1); - gridLayout->addWidget(LEIterationParentName, 1, 3, 1, 1); + LEIterationParentName = new QLineEdit(CreateIteration); + LEIterationParentName->setObjectName(QString::fromUtf8("LEIterationParentName")); + LEIterationParentName->setMinimumSize(QSize(0, 21)); + LEIterationParentName->setMaxLength(200); + LEIterationParentName->setReadOnly(true); - Mesh_n = new QLabel(CreateIteration); - Mesh_n->setObjectName(QString::fromUtf8("Mesh_n")); + gridLayout->addWidget(LEIterationParentName, 1, 3, 1, 1); - gridLayout->addWidget(Mesh_n, 2, 0, 1, 1); + Mesh_n = new QLabel(CreateIteration); + Mesh_n->setObjectName(QString::fromUtf8("Mesh_n")); - spacerItem5 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding); + gridLayout->addWidget(Mesh_n, 2, 0, 1, 1); - gridLayout->addItem(spacerItem5, 2, 1, 1, 1); + spacerItem5 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding); - LEMeshName_n = new QLineEdit(CreateIteration); - LEMeshName_n->setObjectName(QString::fromUtf8("LEMeshName_n")); - LEMeshName_n->setMinimumSize(QSize(290, 21)); - LEMeshName_n->setMaxLength(32); - LEMeshName_n->setReadOnly(true); + gridLayout->addItem(spacerItem5, 2, 1, 1, 1); - gridLayout->addWidget(LEMeshName_n, 2, 2, 1, 2); + LEMeshName_n = new QLineEdit(CreateIteration); + LEMeshName_n->setObjectName(QString::fromUtf8("LEMeshName_n")); + LEMeshName_n->setMinimumSize(QSize(290, 21)); + LEMeshName_n->setMaxLength(32); + LEMeshName_n->setReadOnly(true); - spacerItem6 = new QSpacerItem(20, 22, QSizePolicy::Minimum, QSizePolicy::Expanding); + gridLayout->addWidget(LEMeshName_n, 2, 2, 1, 2); - gridLayout->addItem(spacerItem6, 3, 1, 1, 1); + spacerItem6 = new QSpacerItem(20, 22, QSizePolicy::Minimum, QSizePolicy::Expanding); - Mesh_np1 = new QLabel(CreateIteration); - Mesh_np1->setObjectName(QString::fromUtf8("Mesh_np1")); + gridLayout->addItem(spacerItem6, 3, 1, 1, 1); - gridLayout->addWidget(Mesh_np1, 4, 0, 1, 2); + Mesh_np1 = new QLabel(CreateIteration); + Mesh_np1->setObjectName(QString::fromUtf8("Mesh_np1")); - LEMeshName_np1 = new QLineEdit(CreateIteration); - LEMeshName_np1->setObjectName(QString::fromUtf8("LEMeshName_np1")); - LEMeshName_np1->setMinimumSize(QSize(290, 21)); - LEMeshName_np1->setMaxLength(32); + gridLayout->addWidget(Mesh_np1, 4, 0, 1, 2); - gridLayout->addWidget(LEMeshName_np1, 4, 2, 1, 2); + LEMeshName_np1 = new QLineEdit(CreateIteration); + LEMeshName_np1->setObjectName(QString::fromUtf8("LEMeshName_np1")); + LEMeshName_np1->setMinimumSize(QSize(290, 21)); + LEMeshName_np1->setMaxLength(32); - spacerItem7 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding); + gridLayout->addWidget(LEMeshName_np1, 4, 2, 1, 2); - gridLayout->addItem(spacerItem7, 5, 1, 1, 1); + spacerItem7 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding); - spacerItem8 = new QSpacerItem(20, 22, QSizePolicy::Minimum, QSizePolicy::Expanding); + gridLayout->addItem(spacerItem7, 5, 1, 1, 1); - gridLayout->addItem(spacerItem8, 7, 1, 1, 1); + spacerItem8 = new QSpacerItem(20, 22, QSizePolicy::Minimum, QSizePolicy::Expanding); - Hypothese = new QGroupBox(CreateIteration); - Hypothese->setObjectName(QString::fromUtf8("Hypothese")); - gridLayout2 = new QGridLayout(Hypothese); - gridLayout2->setSpacing(6); - gridLayout2->setMargin(9); - gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); - CBHypothese = new QComboBox(Hypothese); - CBHypothese->setObjectName(QString::fromUtf8("CBHypothese")); - CBHypothese->setSizeAdjustPolicy(QComboBox::AdjustToContents); + gridLayout->addItem(spacerItem8, 7, 1, 1, 1); - gridLayout2->addWidget(CBHypothese, 0, 0, 1, 1); + Hypothese = new QGroupBox(CreateIteration); + Hypothese->setObjectName(QString::fromUtf8("Hypothese")); + gridLayout2 = new QGridLayout(Hypothese); +#ifndef Q_OS_MAC + gridLayout2->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout2->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); + CBHypothese = new QComboBox(Hypothese); + CBHypothese->setObjectName(QString::fromUtf8("CBHypothese")); + CBHypothese->setSizeAdjustPolicy(QComboBox::AdjustToContents); - spacerItem9 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); + gridLayout2->addWidget(CBHypothese, 0, 0, 1, 1); - gridLayout2->addItem(spacerItem9, 0, 1, 1, 1); + spacerItem9 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); - PBHypoEdit = new QPushButton(Hypothese); - PBHypoEdit->setObjectName(QString::fromUtf8("PBHypoEdit")); + gridLayout2->addItem(spacerItem9, 0, 1, 1, 1); - gridLayout2->addWidget(PBHypoEdit, 0, 2, 1, 1); + PBHypoEdit = new QPushButton(Hypothese); + PBHypoEdit->setObjectName(QString::fromUtf8("PBHypoEdit")); - PBHypoNew = new QPushButton(Hypothese); - PBHypoNew->setObjectName(QString::fromUtf8("PBHypoNew")); + gridLayout2->addWidget(PBHypoEdit, 0, 2, 1, 1); - gridLayout2->addWidget(PBHypoNew, 0, 3, 1, 1); + PBHypoNew = new QPushButton(Hypothese); + PBHypoNew->setObjectName(QString::fromUtf8("PBHypoNew")); + gridLayout2->addWidget(PBHypoNew, 0, 3, 1, 1); - gridLayout->addWidget(Hypothese, 8, 0, 1, 4); - spacerItem10 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding); + gridLayout->addWidget(Hypothese, 8, 0, 1, 4); - gridLayout->addItem(spacerItem10, 9, 0, 1, 1); + spacerItem10 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding); - GroupButtons = new QGroupBox(CreateIteration); - GroupButtons->setObjectName(QString::fromUtf8("GroupButtons")); - gridLayout3 = new QGridLayout(GroupButtons); - gridLayout3->setSpacing(6); - gridLayout3->setMargin(9); - gridLayout3->setObjectName(QString::fromUtf8("gridLayout3")); - buttonOk = new QPushButton(GroupButtons); - buttonOk->setObjectName(QString::fromUtf8("buttonOk")); - buttonOk->setAutoDefault(false); - buttonOk->setDefault(false); + gridLayout->addItem(spacerItem10, 9, 0, 1, 1); - gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); + GroupButtons = new QGroupBox(CreateIteration); + GroupButtons->setObjectName(QString::fromUtf8("GroupButtons")); + gridLayout3 = new QGridLayout(GroupButtons); +#ifndef Q_OS_MAC + gridLayout3->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout3->setContentsMargins(9, 9, 9, 9); +#endif + gridLayout3->setObjectName(QString::fromUtf8("gridLayout3")); + buttonOk = new QPushButton(GroupButtons); + buttonOk->setObjectName(QString::fromUtf8("buttonOk")); + buttonOk->setAutoDefault(false); + buttonOk->setDefault(false); - buttonApply = new QPushButton(GroupButtons); - buttonApply->setObjectName(QString::fromUtf8("buttonApply")); + gridLayout3->addWidget(buttonOk, 0, 0, 1, 1); - gridLayout3->addWidget(buttonApply, 0, 1, 1, 1); + buttonApply = new QPushButton(GroupButtons); + buttonApply->setObjectName(QString::fromUtf8("buttonApply")); - buttonCancel = new QPushButton(GroupButtons); - buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); + gridLayout3->addWidget(buttonApply, 0, 1, 1, 1); - gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); + buttonCancel = new QPushButton(GroupButtons); + buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); - buttonHelp = new QPushButton(GroupButtons); - buttonHelp->setObjectName(QString::fromUtf8("buttonHelp")); + gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); - gridLayout3->addWidget(buttonHelp, 0, 3, 1, 1); + buttonHelp = new QPushButton(GroupButtons); + buttonHelp->setObjectName(QString::fromUtf8("buttonHelp")); + gridLayout3->addWidget(buttonHelp, 0, 3, 1, 1); - gridLayout->addWidget(GroupButtons, 10, 0, 1, 4); + gridLayout->addWidget(GroupButtons, 10, 0, 1, 4); - retranslateUi(CreateIteration); - QSize size(610, 598); - size = size.expandedTo(CreateIteration->minimumSizeHint()); - CreateIteration->resize(size); + retranslateUi(CreateIteration); + CBHypothese->setCurrentIndex(-1); - CBHypothese->setCurrentIndex(-1); - - QMetaObject::connectSlotsByName(CreateIteration); + QMetaObject::connectSlotsByName(CreateIteration); } // setupUi void retranslateUi(QWidget *CreateIteration) { - CreateIteration->setWindowTitle(QApplication::translate("CreateIteration", "Create an iteration", 0, QApplication::UnicodeUTF8)); - GBField->setTitle(QApplication::translate("CreateIteration", "Field information", 0, QApplication::UnicodeUTF8)); - RBChosen->setText(QApplication::translate("CreateIteration", "Chosen time step", 0, QApplication::UnicodeUTF8)); - Rank->setText(QApplication::translate("CreateIteration", "Rank", 0, QApplication::UnicodeUTF8)); - TimeStep->setText(QApplication::translate("CreateIteration", "Time step", 0, QApplication::UnicodeUTF8)); - RBLast->setText(QApplication::translate("CreateIteration", "Last time step", 0, QApplication::UnicodeUTF8)); - RBNo->setText(QApplication::translate("CreateIteration", "No time step", 0, QApplication::UnicodeUTF8)); - PushFieldFile->setText(QString()); - FieldFile->setText(QApplication::translate("CreateIteration", "Field file", 0, QApplication::UnicodeUTF8)); - Iteration_Name->setText(QApplication::translate("CreateIteration", "Iteration Name", 0, QApplication::UnicodeUTF8)); - Iter_Parent->setText(QApplication::translate("CreateIteration", "Previous iteration", 0, QApplication::UnicodeUTF8)); - PBIterParent->setText(QString()); - Mesh_n->setText(QApplication::translate("CreateIteration", "Mesh n", 0, QApplication::UnicodeUTF8)); - Mesh_np1->setText(QApplication::translate("CreateIteration", "Mesh n+1", 0, QApplication::UnicodeUTF8)); - Hypothese->setTitle(QApplication::translate("CreateIteration", "Hypothesis", 0, QApplication::UnicodeUTF8)); - PBHypoEdit->setText(QApplication::translate("CreateIteration", "Edit", 0, QApplication::UnicodeUTF8)); - PBHypoNew->setText(QApplication::translate("CreateIteration", "New", 0, QApplication::UnicodeUTF8)); - GroupButtons->setTitle(QString()); - buttonOk->setText(QApplication::translate("CreateIteration", "OK", 0, QApplication::UnicodeUTF8)); - buttonApply->setText(QApplication::translate("CreateIteration", "Apply", 0, QApplication::UnicodeUTF8)); - buttonCancel->setText(QApplication::translate("CreateIteration", "Cancel", 0, QApplication::UnicodeUTF8)); - buttonHelp->setText(QApplication::translate("CreateIteration", "Help", 0, QApplication::UnicodeUTF8)); - Q_UNUSED(CreateIteration); + CreateIteration->setWindowTitle(QApplication::translate("CreateIteration", "Create an iteration", 0, QApplication::UnicodeUTF8)); + GBField->setTitle(QApplication::translate("CreateIteration", "Field information", 0, QApplication::UnicodeUTF8)); + RBChosen->setText(QApplication::translate("CreateIteration", "Chosen time step", 0, QApplication::UnicodeUTF8)); + Rank->setText(QApplication::translate("CreateIteration", "Rank", 0, QApplication::UnicodeUTF8)); + TimeStep->setText(QApplication::translate("CreateIteration", "Time step", 0, QApplication::UnicodeUTF8)); + RBLast->setText(QApplication::translate("CreateIteration", "Last time step", 0, QApplication::UnicodeUTF8)); + RBNo->setText(QApplication::translate("CreateIteration", "No time step", 0, QApplication::UnicodeUTF8)); + PushFieldFile->setText(QString()); + FieldFile->setText(QApplication::translate("CreateIteration", "Field file", 0, QApplication::UnicodeUTF8)); + Iteration_Name->setText(QApplication::translate("CreateIteration", "Iteration Name", 0, QApplication::UnicodeUTF8)); + Iter_Parent->setText(QApplication::translate("CreateIteration", "Previous iteration", 0, QApplication::UnicodeUTF8)); + PBIterParent->setText(QString()); + Mesh_n->setText(QApplication::translate("CreateIteration", "Mesh n", 0, QApplication::UnicodeUTF8)); + Mesh_np1->setText(QApplication::translate("CreateIteration", "Mesh n+1", 0, QApplication::UnicodeUTF8)); + Hypothese->setTitle(QApplication::translate("CreateIteration", "Hypothesis", 0, QApplication::UnicodeUTF8)); + PBHypoEdit->setText(QApplication::translate("CreateIteration", "Edit", 0, QApplication::UnicodeUTF8)); + PBHypoNew->setText(QApplication::translate("CreateIteration", "New", 0, QApplication::UnicodeUTF8)); + GroupButtons->setTitle(QString()); + buttonOk->setText(QApplication::translate("CreateIteration", "OK", 0, QApplication::UnicodeUTF8)); + buttonApply->setText(QApplication::translate("CreateIteration", "Apply", 0, QApplication::UnicodeUTF8)); + buttonCancel->setText(QApplication::translate("CreateIteration", "Cancel", 0, QApplication::UnicodeUTF8)); + buttonHelp->setText(QApplication::translate("CreateIteration", "Help", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; @@ -352,4 +367,6 @@ namespace Ui { class CreateIteration: public Ui_CreateIteration {}; } // namespace Ui +QT_END_NAMESPACE + #endif // CREATEITERATION_H diff --git a/tests/test_1.py b/tests/test_1.py index d63713ce..a15865f3 100644 --- a/tests/test_1.py +++ b/tests/test_1.py @@ -22,7 +22,7 @@ Python script for HOMARD Copyright EDF-R&D 2010 Test test_1 """ -__revision__ = "V1.5" +__revision__ = "V1.6" ###################################################################################### Test_Name = "test_1" @@ -50,6 +50,10 @@ def homard_exec(theStudy): Python script for HOMARD Copyright EDF-R&D 2010 """ + error = 0 +# + while not error : +# homard.SetCurrentStudy(theStudy) # # Creation of the zones @@ -94,7 +98,10 @@ Copyright EDF-R&D 2010 I1.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.00.med')) I1.SetTimeStepRank(1, 1) homard.AssociateIterHypo('I1', 'a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') - result1 = I1.Compute(1) + error = I1.Compute(1) + if error : + error = 1 + break # Creation of the iteration I2 I2 = homard.CreateIteration('I2', 'I1') @@ -103,15 +110,24 @@ Copyright EDF-R&D 2010 I2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.01.med')) I2.SetTimeStepRank(1, 1) homard.AssociateIterHypo('I2', 'a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') - result2 = I2.Compute(1) + error = I2.Compute(1) + if error : + error = 2 + break # Creation of the iteration I3 I3 = homard.CreateIteration('I3', 'I2') I3.SetMeshName('M3') I3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) homard.AssociateIterHypo('I3', 'Zones_1_et_2') - result3 = I3.Compute(1) - return result1*result2*result3 + error = I3.Compute(1) + if error : + error = 3 + break +# + break +# + return error ###################################################################################### @@ -120,11 +136,11 @@ homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD') # Exec of HOMARD-SALOME # try : - result=homard_exec(salome.myStudy) - if (result != True): - raise Exception('Pb in homard_exec') + error_main = homard_exec(salome.myStudy) + if error_main : + raise Exception('Pb in homard_exec at iteration %d' %error_main ) except : - raise Exception('Pb in homard_exec') + raise Exception('Pb in homard_exec at iteration %d' %error_main ) sys.exit(1) # # Test of the result diff --git a/tests/test_2.py b/tests/test_2.py index 8fb294be..770dd45d 100644 --- a/tests/test_2.py +++ b/tests/test_2.py @@ -22,7 +22,7 @@ Python script for HOMARD Copyright EDF-R&D 2010 Test test_2 """ -__revision__ = "V1.4" +__revision__ = "V1.5" ###################################################################################### Test_Name = "test_2" @@ -50,6 +50,10 @@ def homard_exec(theStudy): Python script for HOMARD Copyright EDF-R&D 2010 """ + error = 0 +# + while not error : +# homard.SetCurrentStudy(theStudy) # # Creation of the boundaries @@ -85,22 +89,34 @@ Copyright EDF-R&D 2010 Iter_1.SetMeshName('PLAQUE_1') Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) homard.AssociateIterHypo('Iter_1', 'Hypo_1') - result1 = Iter_1.Compute(1) + error = Iter_1.Compute(1) + if error : + error = 1 + break # Creation of the iteration Iter_2 Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') Iter_2.SetMeshName('PLAQUE_2') Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) homard.AssociateIterHypo('Iter_2', 'Hypo_1') - result2 = Iter_2.Compute(1) + error = Iter_2.Compute(1) + if error : + error = 2 + break # Creation of the iteration Iter_3 Iter_3 = homard.CreateIteration('Iter_3', 'Iter_2') Iter_3.SetMeshName('PLAQUE_3') Iter_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) homard.AssociateIterHypo('Iter_3', 'Hypo_2') - result3 = Iter_3.Compute(1) - return result1*result2*result3 + error = Iter_3.Compute(1) + if error : + error = 3 + break +# + break +# + return error ###################################################################################### @@ -109,11 +125,11 @@ homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD') # Exec of HOMARD-SALOME # try : - result=homard_exec(salome.myStudy) - if (result != True): - raise Exception('Pb in homard_exec') + error_main = homard_exec(salome.myStudy) + if error_main : + raise Exception('Pb in homard_exec at iteration %d' %error_main ) except : - raise Exception('Pb in homard_exec') + raise Exception('Pb in homard_exec at iteration %d' %error_main ) sys.exit(1) # # Test of the result diff --git a/tests/test_3.py b/tests/test_3.py index fdcadafe..33840564 100644 --- a/tests/test_3.py +++ b/tests/test_3.py @@ -22,7 +22,7 @@ Python script for HOMARD Copyright EDF-R&D 2011 Test test_3 """ -__revision__ = "V1.2" +__revision__ = "V1.3" ###################################################################################### Test_Name = "test_3" @@ -50,6 +50,10 @@ def homard_exec(theStudy): Python script for HOMARD Copyright EDF-R&D 2010 """ + error = 0 +# + while not error : +# homard.SetCurrentStudy(theStudy) # # Creation of the boundaries @@ -94,16 +98,24 @@ Copyright EDF-R&D 2010 Iter_1.SetMeshName('MOYEU_1') Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) homard.AssociateIterHypo('Iter_1', 'Hypo') - result1 = Iter_1.Compute(1) + error = Iter_1.Compute(1) + if error : + error = 1 + break # Creation of the iteration Iter_2 Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') Iter_2.SetMeshName('MOYEU_2') Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) homard.AssociateIterHypo('Iter_2', 'Hypo') - result2 = Iter_2.Compute(1) - - return result1*result2 + error = Iter_2.Compute(1) + if error : + error = 2 + break +# + break +# + return error ###################################################################################### @@ -112,11 +124,11 @@ homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD') # Exec of HOMARD-SALOME # try : - result=homard_exec(salome.myStudy) - if (result != True): - raise Exception('Pb in homard_exec') + error_main = homard_exec(salome.myStudy) + if error_main : + raise Exception('Pb in homard_exec at iteration %d' %error_main ) except : - raise Exception('Pb in homard_exec') + raise Exception('Pb in homard_exec at iteration %d' %error_main ) sys.exit(1) # # Test of the result