From 8349ff968e7022dc40c017de2e4529713063ae2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=A9rald=20NICOLAS?= Date: Tue, 15 Dec 2015 09:51:55 +0100 Subject: [PATCH] Fonction d'affectation d'un type externe au maillage --- doc/en/tui_create_case.rst | 17 ++- doc/fr/tui_create_case.rst | 22 +++- idl/HOMARD_Cas.idl | 3 + src/HOMARD/HOMARD_Cas.cxx | 21 +++- src/HOMARD/HOMARD_Cas.hxx | 4 + src/HOMARD/HOMARD_DriverTools.cxx | 5 + src/HOMARD/HomardDriver.cxx | 5 +- src/HOMARD/HomardDriver.hxx | 2 +- src/HOMARDGUI/CreateCase.h | 134 +++++++++++++++------- src/HOMARDGUI/CreateCase.ui | 180 +++++++++++++++++++----------- src/HOMARDGUI/MonCreateCase.cxx | 24 ++++ src/HOMARDGUI/MonCreateCase.h | 4 + src/HOMARDGUI/MonEditCase.cxx | 33 ++++-- src/HOMARD_I/HOMARD_Cas_i.cxx | 13 +++ src/HOMARD_I/HOMARD_Cas_i.hxx | 3 + src/HOMARD_I/HOMARD_Gen_i.cxx | 14 ++- 16 files changed, 358 insertions(+), 126 deletions(-) diff --git a/doc/en/tui_create_case.rst b/doc/en/tui_create_case.rst index c532f2a5..ddb9252f 100644 --- a/doc/en/tui_create_case.rst +++ b/doc/en/tui_create_case.rst @@ -120,7 +120,7 @@ Methods of the class cas | | | - ``conf_type``: integer as follows: | | | -| * 0: conformal | +| * 0: conformal (default) | | * 1: non conformal with at max 2 cut edges per element| | * 2: non conformal with one hanging node per edge of | | element | @@ -133,6 +133,21 @@ Methods of the class cas | **GetConfType()** | | Returns the type of conformity | +---------------------------------------------------------------+ +| .. module:: SetExtType | +| | +| **SetExtType(ext_type)** | +| Defines the external type for the case | +| | +| - ``ext_type`` : integer as follows: | +| | +| * 0 : Standard MED (default) | +| * 1 : Saturne 2D | ++---------------------------------------------------------------+ +| .. module:: GetExtType | +| | +| **GetExtType()** | +| Returns the external type for the case | ++---------------------------------------------------------------+ | .. module:: GetIter0 | | | | **GetIter0()** | diff --git a/doc/fr/tui_create_case.rst b/doc/fr/tui_create_case.rst index 0c9d3141..7f0d7d0a 100644 --- a/doc/fr/tui_create_case.rst +++ b/doc/fr/tui_create_case.rst @@ -121,7 +121,7 @@ Méthodes de la classe cas | | | - ``conf_type`` : entier précisant le mode de conformité | | | -| * 0 : conforme | +| * 0 : conforme (défaut) | | * 1 : non conforme avec au minimum 2 aretes coupees | | * 2 : non conforme avec 1 noeud par arete de maille | | * 3 : non conforme quelconque | @@ -133,6 +133,21 @@ Méthodes de la classe cas | **GetConfType()** | | Retourne le type de conformité | +---------------------------------------------------------------+ +| .. module:: SetExtType | +| | +| **SetExtType(ext_type)** | +| Définit le type externe associé au cas | +| | +| - ``ext_type`` : entier précisant le type externe | +| | +| * 0 : MED standard (défaut) | +| * 1 : Saturne 2D | ++---------------------------------------------------------------+ +| .. module:: GetExtType | +| | +| **GetExtType()** | +| Retourne le type externe associé au cas | ++---------------------------------------------------------------+ | .. module:: GetIter0 | | | | **GetIter0()** | @@ -250,11 +265,12 @@ La création de l'objet case_1 se fait ainsi : :: case_name = "CAS_1" mesh_name = "MAILL" - mesh_file = "/local00/Salome/Adapt/m0.med" + mesh_file = "/home/A1789/Adapt/m0.med" case_1 = homard.CreateCase(case_name, mesh_name, mesh_file) - dirname = "/local00/Salome/Adapt/resu" + dirname = "/home/A1789/Adapt/resu" case_1.SetDirName(dirname) case_1.SetConfType(1) + case_1.SetExtType(0) case_1.AddBoundaryGroup( 'intersection', '' ) case_1.AddBoundaryGroup( 'cyl_1', 'T1_EXT' ) case_1.AddBoundaryGroup( 'cyl_1', 'T2_EXT' ) diff --git a/idl/HOMARD_Cas.idl b/idl/HOMARD_Cas.idl index a1812e02..eafe1bfa 100644 --- a/idl/HOMARD_Cas.idl +++ b/idl/HOMARD_Cas.idl @@ -65,6 +65,9 @@ module HOMARD void SetConfType(in long ConfType) raises (SALOME::SALOME_Exception); long GetConfType() raises (SALOME::SALOME_Exception); + void SetExtType(in long ExtType) raises (SALOME::SALOME_Exception); + long GetExtType() raises (SALOME::SALOME_Exception); + void SetBoundingBox(in extrema LesExtremes) raises (SALOME::SALOME_Exception); extrema GetBoundingBox() raises (SALOME::SALOME_Exception); diff --git a/src/HOMARD/HOMARD_Cas.cxx b/src/HOMARD/HOMARD_Cas.cxx index 9d2a5fe5..5daf49d4 100644 --- a/src/HOMARD/HOMARD_Cas.cxx +++ b/src/HOMARD/HOMARD_Cas.cxx @@ -50,7 +50,7 @@ */ //============================================================================= HOMARD_Cas::HOMARD_Cas(): - _Name(""), _NomDir("/tmp"), _ConfType(0) + _Name(""), _NomDir("/tmp"), _ConfType(0), _ExtType(0) { MESSAGE("HOMARD_Cas"); } @@ -82,6 +82,8 @@ std::string HOMARD_Cas::GetDumpPython() const aScript << _NomDir << "\")\n"; aScript << "\t" <<_Name << ".SetConfType("; aScript << _ConfType << ")\n"; + aScript << "\t" <<_Name << ".SetExtType("; + aScript << _ExtType << ")\n"; // Suivi de frontieres std::list::const_iterator it = _ListBoundaryGroup.begin(); while(it != _ListBoundaryGroup.end()) @@ -142,6 +144,9 @@ int HOMARD_Cas::GetNumberofIter() { return _ListIter.size(); } +// +// Le type de conformite ou non conformite +// //============================================================================= void HOMARD_Cas::SetConfType( int Conftype ) { @@ -154,6 +159,20 @@ const int HOMARD_Cas::GetConfType() const return _ConfType; } // +// Le type exterieur +// +//============================================================================= +void HOMARD_Cas::SetExtType( int ExtType ) +{ +// VERIFICATION( (ExtType>=0) && (ExtType<=1) ); + _ExtType = ExtType; +} +//============================================================================= +const int HOMARD_Cas::GetExtType() const +{ + return _ExtType; +} +// // La boite englobante // //============================================================================= diff --git a/src/HOMARD/HOMARD_Cas.hxx b/src/HOMARD/HOMARD_Cas.hxx index fecdda1b..65412ca3 100644 --- a/src/HOMARD/HOMARD_Cas.hxx +++ b/src/HOMARD/HOMARD_Cas.hxx @@ -65,6 +65,9 @@ public: void SetConfType( int ConfType ); const int GetConfType() const; + void SetExtType( int ExtType ); + const int GetExtType() const; + void SetBoundingBox( const std::vector& extremas ); const std::vector& GetBoundingBox() const; @@ -91,6 +94,7 @@ private: std::string _Name; std::string _NomDir; int _ConfType; + int _ExtType; int _Etat; std::vector _Boite; // cf HomardQTCommun pour structure du vecteur diff --git a/src/HOMARD/HOMARD_DriverTools.cxx b/src/HOMARD/HOMARD_DriverTools.cxx index 9633791d..dadfffa0 100644 --- a/src/HOMARD/HOMARD_DriverTools.cxx +++ b/src/HOMARD/HOMARD_DriverTools.cxx @@ -112,6 +112,7 @@ namespace HOMARD os << cas.GetName(); os << separator() << cas.GetDirName(); os << separator() << cas.GetConfType(); + os << separator() << cas.GetExtType(); std::vector coor = cas.GetBoundingBox(); os << separator() << coor.size(); @@ -380,6 +381,10 @@ namespace HOMARD if ( !ok ) return false; cas.SetConfType( atoi( chunk.c_str() ) ); + chunk = getNextChunk( stream, start, ok ); + if ( !ok ) return false; + cas.SetExtType( atoi( chunk.c_str() ) ); + chunk = getNextChunk( stream, start, ok ); if ( !ok ) return false; diff --git a/src/HOMARD/HomardDriver.cxx b/src/HOMARD/HomardDriver.cxx index 7b88b385..253351d7 100644 --- a/src/HOMARD/HomardDriver.cxx +++ b/src/HOMARD/HomardDriver.cxx @@ -75,12 +75,13 @@ void HomardDriver::TexteInit( const std::string DirCompute, const std::string Lo // } //=============================================================================== -void HomardDriver::TexteAdap( ) +void HomardDriver::TexteAdap( int ExtType ) { MESSAGE("TexteAdap"); // _Texte += "Action homa\n" ; - _Texte += "CCAssoci med\n" ; + if ( ExtType == 0 ) { _Texte += "CCAssoci med\n" ; } + else { _Texte += "CCAssoci saturne_2d\n" ; } _Texte += "ModeHOMA 1\n" ; _Texte += "NumeIter " + _siter + "\n" ; // diff --git a/src/HOMARD/HomardDriver.hxx b/src/HOMARD/HomardDriver.hxx index 86017a35..edf77fe0 100644 --- a/src/HOMARD/HomardDriver.hxx +++ b/src/HOMARD/HomardDriver.hxx @@ -36,7 +36,7 @@ public: void TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue ); void TexteInfo( int TypeBila, int NumeIter ); void CreeFichierDonn(); - void TexteAdap( ); + void TexteAdap( int ExtType ); void CreeFichier(); void TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres ); void TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres ); diff --git a/src/HOMARDGUI/CreateCase.h b/src/HOMARDGUI/CreateCase.h index dc57501a..c2483658 100644 --- a/src/HOMARDGUI/CreateCase.h +++ b/src/HOMARDGUI/CreateCase.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'CreateCase.ui' ** -** Created: Tue Nov 24 11:06:19 2015 +** Created: Mon Dec 14 17:01:30 2015 ** by: Qt User Interface Compiler version 4.6.3 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! @@ -35,7 +35,7 @@ QT_BEGIN_NAMESPACE class Ui_CreateCase { public: - QGridLayout *gridLayout_3; + QGridLayout *gridLayout_5; QWidget *WName; QGridLayout *gridLayout_2; QLabel *Name; @@ -77,22 +77,29 @@ public: QSpacerItem *spacer; QCheckBox *CBAdvanced; QGroupBox *GBAdvancedOptions; - QGridLayout *gridLayout2; + QGridLayout *gridLayout_4; QCheckBox *CBPyramid; + QGroupBox *GBConforme; + QGridLayout *gridLayout_3; + QHBoxLayout *horizontalLayout_2; QRadioButton *RBStandard; QRadioButton *RBBox; QRadioButton *RBNC1NpA; QRadioButton *RBNCQuelconque; + QGroupBox *GBFormat; + QGridLayout *gridLayout2; + QRadioButton *RBMED; + QRadioButton *RBSaturne2D; QSpacerItem *spacer_3; QSpacerItem *spacer_4; QLabel *Comment; - QSpacerItem *verticalSpacer; QGroupBox *GroupButtons; QGridLayout *gridLayout3; QPushButton *buttonHelp; QPushButton *buttonApply; QPushButton *buttonOk; QPushButton *buttonCancel; + QSpacerItem *verticalSpacer; QSpacerItem *spacer_2; void setupUi(QDialog *CreateCase) @@ -109,8 +116,8 @@ public: CreateCase->setSizeIncrement(QSize(1, 1)); CreateCase->setBaseSize(QSize(600, 320)); CreateCase->setAutoFillBackground(true); - gridLayout_3 = new QGridLayout(CreateCase); - gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3")); + gridLayout_5 = new QGridLayout(CreateCase); + gridLayout_5->setObjectName(QString::fromUtf8("gridLayout_5")); WName = new QWidget(CreateCase); WName->setObjectName(QString::fromUtf8("WName")); gridLayout_2 = new QGridLayout(WName); @@ -126,11 +133,11 @@ public: gridLayout_2->addWidget(LEName, 0, 1, 1, 1); - gridLayout_3->addWidget(WName, 0, 0, 1, 2); + gridLayout_5->addWidget(WName, 0, 0, 1, 3); horizontalSpacer = new QSpacerItem(199, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - gridLayout_3->addItem(horizontalSpacer, 0, 2, 1, 3); + gridLayout_5->addItem(horizontalSpacer, 0, 3, 1, 3); hboxLayout = new QHBoxLayout(); #ifndef Q_OS_MAC @@ -156,11 +163,11 @@ public: hboxLayout->addWidget(LEDirName); - gridLayout_3->addLayout(hboxLayout, 1, 0, 1, 6); + gridLayout_5->addLayout(hboxLayout, 1, 0, 1, 7); spacerItem = new QSpacerItem(20, 18, QSizePolicy::Minimum, QSizePolicy::Expanding); - gridLayout_3->addItem(spacerItem, 2, 5, 1, 1); + gridLayout_5->addItem(spacerItem, 2, 6, 1, 1); hboxLayout1 = new QHBoxLayout(); #ifndef Q_OS_MAC @@ -186,11 +193,11 @@ public: hboxLayout1->addWidget(LEFileName); - gridLayout_3->addLayout(hboxLayout1, 3, 0, 1, 6); + gridLayout_5->addLayout(hboxLayout1, 3, 0, 1, 7); spacerItem1 = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); - gridLayout_3->addItem(spacerItem1, 3, 6, 1, 1); + gridLayout_5->addItem(spacerItem1, 3, 7, 1, 1); GBTypeConf = new QGroupBox(CreateCase); GBTypeConf->setObjectName(QString::fromUtf8("GBTypeConf")); @@ -214,7 +221,7 @@ public: hboxLayout2->addWidget(RBNonConforme); - gridLayout_3->addWidget(GBTypeConf, 4, 0, 1, 3); + gridLayout_5->addWidget(GBTypeConf, 4, 0, 1, 4); hboxLayout3 = new QHBoxLayout(); #ifndef Q_OS_MAC @@ -233,15 +240,15 @@ public: hboxLayout3->addWidget(CBBoundaryA); - gridLayout_3->addLayout(hboxLayout3, 5, 0, 1, 4); + gridLayout_5->addLayout(hboxLayout3, 5, 0, 1, 5); spacerItem2 = new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); - gridLayout_3->addItem(spacerItem2, 5, 4, 1, 1); + gridLayout_5->addItem(spacerItem2, 5, 5, 1, 1); spacerItem3 = new QSpacerItem(20, 2, QSizePolicy::Minimum, QSizePolicy::Expanding); - gridLayout_3->addItem(spacerItem3, 6, 3, 1, 1); + gridLayout_5->addItem(spacerItem3, 6, 4, 1, 1); GBBoundaryD = new QGroupBox(CreateCase); GBBoundaryD->setObjectName(QString::fromUtf8("GBBoundaryD")); @@ -287,7 +294,7 @@ public: gridLayout->addWidget(PBBoundaryDiHelp, 0, 4, 1, 1); - gridLayout_3->addWidget(GBBoundaryD, 7, 0, 1, 5); + gridLayout_5->addWidget(GBBoundaryD, 7, 0, 1, 6); GBBoundaryA = new QGroupBox(CreateCase); GBBoundaryA->setObjectName(QString::fromUtf8("GBBoundaryA")); @@ -335,67 +342,93 @@ public: formLayout->setLayout(0, QFormLayout::FieldRole, gridLayout1); - gridLayout_3->addWidget(GBBoundaryA, 8, 0, 1, 7); + gridLayout_5->addWidget(GBBoundaryA, 8, 0, 1, 8); spacer = new QSpacerItem(239, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); - gridLayout_3->addItem(spacer, 9, 0, 1, 3); + gridLayout_5->addItem(spacer, 9, 0, 1, 4); CBAdvanced = new QCheckBox(CreateCase); CBAdvanced->setObjectName(QString::fromUtf8("CBAdvanced")); - gridLayout_3->addWidget(CBAdvanced, 10, 0, 1, 2); + gridLayout_5->addWidget(CBAdvanced, 10, 0, 1, 3); GBAdvancedOptions = new QGroupBox(CreateCase); GBAdvancedOptions->setObjectName(QString::fromUtf8("GBAdvancedOptions")); - gridLayout2 = new QGridLayout(GBAdvancedOptions); - gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); + gridLayout_4 = new QGridLayout(GBAdvancedOptions); + gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); CBPyramid = new QCheckBox(GBAdvancedOptions); CBPyramid->setObjectName(QString::fromUtf8("CBPyramid")); - gridLayout2->addWidget(CBPyramid, 0, 0, 1, 2); + gridLayout_4->addWidget(CBPyramid, 0, 0, 1, 1); - RBStandard = new QRadioButton(GBAdvancedOptions); + GBConforme = new QGroupBox(GBAdvancedOptions); + GBConforme->setObjectName(QString::fromUtf8("GBConforme")); + gridLayout_3 = new QGridLayout(GBConforme); + gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3")); + horizontalLayout_2 = new QHBoxLayout(); + horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + RBStandard = new QRadioButton(GBConforme); RBStandard->setObjectName(QString::fromUtf8("RBStandard")); RBStandard->setChecked(true); - gridLayout2->addWidget(RBStandard, 1, 0, 1, 1); + horizontalLayout_2->addWidget(RBStandard); - RBBox = new QRadioButton(GBAdvancedOptions); + RBBox = new QRadioButton(GBConforme); RBBox->setObjectName(QString::fromUtf8("RBBox")); RBBox->setChecked(false); - gridLayout2->addWidget(RBBox, 1, 1, 1, 1); + horizontalLayout_2->addWidget(RBBox); - RBNC1NpA = new QRadioButton(GBAdvancedOptions); + RBNC1NpA = new QRadioButton(GBConforme); RBNC1NpA->setObjectName(QString::fromUtf8("RBNC1NpA")); - gridLayout2->addWidget(RBNC1NpA, 1, 2, 1, 1); + horizontalLayout_2->addWidget(RBNC1NpA); - RBNCQuelconque = new QRadioButton(GBAdvancedOptions); + RBNCQuelconque = new QRadioButton(GBConforme); RBNCQuelconque->setObjectName(QString::fromUtf8("RBNCQuelconque")); - gridLayout2->addWidget(RBNCQuelconque, 1, 3, 1, 1); + horizontalLayout_2->addWidget(RBNCQuelconque); + + + gridLayout_3->addLayout(horizontalLayout_2, 0, 0, 1, 1); + + + gridLayout_4->addWidget(GBConforme, 1, 0, 1, 1); + + GBFormat = new QGroupBox(GBAdvancedOptions); + GBFormat->setObjectName(QString::fromUtf8("GBFormat")); + gridLayout2 = new QGridLayout(GBFormat); + gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); + RBMED = new QRadioButton(GBFormat); + RBMED->setObjectName(QString::fromUtf8("RBMED")); + RBMED->setChecked(true); + + gridLayout2->addWidget(RBMED, 0, 0, 1, 1); + + RBSaturne2D = new QRadioButton(GBFormat); + RBSaturne2D->setObjectName(QString::fromUtf8("RBSaturne2D")); + + gridLayout2->addWidget(RBSaturne2D, 0, 1, 1, 1); + + + gridLayout_4->addWidget(GBFormat, 2, 0, 1, 1); - gridLayout_3->addWidget(GBAdvancedOptions, 11, 0, 1, 5); + gridLayout_5->addWidget(GBAdvancedOptions, 11, 0, 1, 6); spacer_3 = new QSpacerItem(128, 13, QSizePolicy::Fixed, QSizePolicy::Minimum); - gridLayout_3->addItem(spacer_3, 11, 6, 1, 1); + gridLayout_5->addItem(spacer_3, 11, 7, 1, 1); spacer_4 = new QSpacerItem(239, 41, QSizePolicy::Minimum, QSizePolicy::Expanding); - gridLayout_3->addItem(spacer_4, 12, 0, 1, 3); + gridLayout_5->addItem(spacer_4, 12, 0, 1, 5); Comment = new QLabel(CreateCase); Comment->setObjectName(QString::fromUtf8("Comment")); - gridLayout_3->addWidget(Comment, 13, 0, 1, 1); - - verticalSpacer = new QSpacerItem(20, 35, QSizePolicy::Minimum, QSizePolicy::Expanding); - - gridLayout_3->addItem(verticalSpacer, 14, 1, 1, 1); + gridLayout_5->addWidget(Comment, 13, 0, 1, 2); GroupButtons = new QGroupBox(CreateCase); GroupButtons->setObjectName(QString::fromUtf8("GroupButtons")); @@ -432,12 +465,27 @@ public: gridLayout3->addWidget(buttonCancel, 0, 2, 1, 1); - gridLayout_3->addWidget(GroupButtons, 15, 0, 1, 5); + gridLayout_5->addWidget(GroupButtons, 14, 0, 1, 1); + + verticalSpacer = new QSpacerItem(20, 35, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout_5->addItem(verticalSpacer, 14, 1, 1, 1); spacer_2 = new QSpacerItem(128, 25, QSizePolicy::Fixed, QSizePolicy::Minimum); - gridLayout_3->addItem(spacer_2, 15, 5, 1, 2); + gridLayout_5->addItem(spacer_2, 14, 6, 1, 2); + WName->raise(); + GBTypeConf->raise(); + GBBoundaryD->raise(); + GBBoundaryA->raise(); + CBAdvanced->raise(); + GBAdvancedOptions->raise(); + Comment->raise(); + GroupButtons->raise(); + RBSaturne2D->raise(); + RBSaturne2D->raise(); + RBSaturne2D->raise(); retranslateUi(CreateCase); @@ -473,10 +521,14 @@ public: CBAdvanced->setText(QApplication::translate("CreateCase", "Advanced options", 0, QApplication::UnicodeUTF8)); GBAdvancedOptions->setTitle(QApplication::translate("CreateCase", "Advanced options", 0, QApplication::UnicodeUTF8)); CBPyramid->setText(QApplication::translate("CreateCase", "Authorized pyramids", 0, QApplication::UnicodeUTF8)); + GBConforme->setTitle(QApplication::translate("CreateCase", "Conformit\303\251", 0, QApplication::UnicodeUTF8)); RBStandard->setText(QApplication::translate("CreateCase", "Standard", 0, QApplication::UnicodeUTF8)); RBBox->setText(QApplication::translate("CreateCase", "Box", 0, QApplication::UnicodeUTF8)); RBNC1NpA->setText(QApplication::translate("CreateCase", "1 node per edge", 0, QApplication::UnicodeUTF8)); RBNCQuelconque->setText(QApplication::translate("CreateCase", "Free", 0, QApplication::UnicodeUTF8)); + GBFormat->setTitle(QApplication::translate("CreateCase", "Format", 0, QApplication::UnicodeUTF8)); + RBMED->setText(QApplication::translate("CreateCase", "MED", 0, QApplication::UnicodeUTF8)); + RBSaturne2D->setText(QApplication::translate("CreateCase", "Saturne 2D", 0, QApplication::UnicodeUTF8)); Comment->setText(QApplication::translate("CreateCase", " No comment.", 0, QApplication::UnicodeUTF8)); GroupButtons->setTitle(QString()); buttonHelp->setText(QApplication::translate("CreateCase", "Help", 0, QApplication::UnicodeUTF8)); diff --git a/src/HOMARDGUI/CreateCase.ui b/src/HOMARDGUI/CreateCase.ui index a4857b0e..75419364 100644 --- a/src/HOMARDGUI/CreateCase.ui +++ b/src/HOMARDGUI/CreateCase.ui @@ -40,8 +40,8 @@ true - - + + @@ -57,7 +57,7 @@ - + Qt::Horizontal @@ -70,7 +70,7 @@ - + 6 @@ -107,7 +107,7 @@ - + Qt::Vertical @@ -120,7 +120,7 @@ - + 6 @@ -157,7 +157,7 @@ - + Qt::Vertical @@ -170,7 +170,7 @@ - + Conformity type @@ -202,7 +202,7 @@ - + 6 @@ -226,7 +226,7 @@ - + Qt::Vertical @@ -239,7 +239,7 @@ - + Qt::Vertical @@ -252,7 +252,7 @@ - + @@ -329,7 +329,7 @@ - + @@ -405,7 +405,7 @@ - + Qt::Vertical @@ -418,20 +418,20 @@ - + Advanced options - + Advanced options - - + + Authorized pyramids @@ -439,43 +439,82 @@ - - - Standard - - - true - + + + Conformité + + + + + + + + Standard + + + true + + + + + + + Box + + + false + + + + + + + 1 node per edge + + + + + + + Free + + + + + + - - - - Box - - - false - - - - - - - 1 node per edge - - - - - - - Free - + + + + Format + + + + + + MED + + + true + + + + + + + Saturne 2D + + + + - + Qt::Horizontal @@ -491,7 +530,7 @@ - + Qt::Vertical @@ -504,27 +543,14 @@ - + No comment. - - - - Qt::Vertical - - - - 20 - 35 - - - - - + @@ -579,7 +605,20 @@ - + + + + Qt::Vertical + + + + 20 + 35 + + + + + Qt::Horizontal @@ -596,6 +635,17 @@ + WName + GBTypeConf + GBBoundaryD + GBBoundaryA + CBAdvanced + GBAdvancedOptions + Comment + GroupButtons + RBSaturne2D + RBSaturne2D + RBSaturne2D diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index 82adec49..87892c7a 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -49,6 +49,7 @@ MonCreateCase::MonCreateCase( bool modal, HOMARD::HOMARD_Gen_var myHomardGen0 ) Ui_CreateCase(), _aCaseName(""),_aDirName(""), _ConfType(0), + _ExtType(0), _Pyram(0) { MESSAGE("Debut du constructeur de MonCreateCase"); @@ -100,6 +101,9 @@ void MonCreateCase::InitConnect() connect( RBNC1NpA, SIGNAL(clicked()), this, SLOT(SetNC1NpA())); connect( RBNCQuelconque, SIGNAL(clicked()), this, SLOT(SetNCQuelconque())); + connect( RBMED, SIGNAL(clicked()), this, SLOT(SetMED())); + connect( RBSaturne2D, SIGNAL(clicked()), this, SLOT(SetSaturne2D())); + connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK())); connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply(0))); connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close())); @@ -252,6 +256,7 @@ bool MonCreateCase::PushOnApply(int option) aCase->SetDirName(aDirName.toStdString().c_str()); _aDirName=aDirName; aCase->SetConfType(_ConfType); + aCase->SetExtType(_ExtType); // Menage des eventuelles frontieres deja enregistrees aCase->SupprBoundaryGroup() ; @@ -407,6 +412,20 @@ void MonCreateCase::SetNCQuelconque() _ConfType = 3; } // ------------------------------------------------------------------------ +void MonCreateCase::SetMED() +// ------------------------------------------------------------------------ +{ + _ExtType = 0 ; + RBMED->setChecked(true); +} +// ------------------------------------------------------------------------ +void MonCreateCase::SetSaturne2D() +// ------------------------------------------------------------------------ +{ + _ExtType = 1 ; + RBSaturne2D->setChecked(true); +} +// ------------------------------------------------------------------------ void MonCreateCase::SetBoundaryD() // ------------------------------------------------------------------------ { @@ -551,6 +570,7 @@ void MonCreateCase::SetAdvanced() MESSAGE("Debut de SetAdvanced "); if (CBAdvanced->isChecked()) { GBAdvancedOptions->setVisible(1); + GBConforme->setVisible(1); RBStandard->setVisible(1); RBBox->setVisible(1); if ( ( _ConfType == 0 ) || ( _ConfType == -1 ) ) @@ -559,12 +579,16 @@ void MonCreateCase::SetAdvanced() else { RBNC1NpA->setVisible(1); RBNCQuelconque->setVisible(1);} + GBFormat->setVisible(1); + RBMED->setVisible(1); + RBSaturne2D->setVisible(1); } else { GBAdvancedOptions->setVisible(0); CBPyramid->setChecked(false); _Pyram = 0 ; SetStandard() ; + SetMED() ; } // adjustSize(); diff --git a/src/HOMARDGUI/MonCreateCase.h b/src/HOMARDGUI/MonCreateCase.h index c7e4cca1..c175d98d 100644 --- a/src/HOMARDGUI/MonCreateCase.h +++ b/src/HOMARDGUI/MonCreateCase.h @@ -48,6 +48,7 @@ protected : QString _aDirName; int _ConfType; + int _ExtType; int _Pyram; @@ -69,6 +70,9 @@ public slots: virtual void SetNC1NpA(); virtual void SetNCQuelconque(); + virtual void SetMED(); + virtual void SetSaturne2D(); + virtual void SetBoundaryD(); virtual void PushBoundaryDiNew(); virtual void PushBoundaryDiEdit(); diff --git a/src/HOMARDGUI/MonEditCase.cxx b/src/HOMARDGUI/MonEditCase.cxx index 7fcc792f..8824d61f 100644 --- a/src/HOMARDGUI/MonEditCase.cxx +++ b/src/HOMARDGUI/MonEditCase.cxx @@ -72,6 +72,7 @@ void MonEditCase::InitValEdit() else { RBNonConforme->setChecked(true); }; RBConforme->setEnabled(false); RBNonConforme->setEnabled(false); + int ExtType=aCase->GetExtType(); // Non affichage du mode de suivi de frontiere CBBoundaryA->setVisible(0); @@ -166,16 +167,19 @@ void MonEditCase::InitValEdit() CBAdvanced->setEnabled(false) ; int Pyram = aCase->GetPyram(); MESSAGE("Pyram "< 0 ) || ( ConfType < 0 ) || ( ConfType > 1 ) ) + if ( ( Pyram > 0 ) || ( ConfType < 0 ) || ( ConfType > 1 ) || ( ExtType > 0 ) ) { GBAdvancedOptions->setVisible(1); +// if ( Pyram > 0 ) { CBPyramid->setChecked(true); - CBPyramid->setEnabled(false); + CBPyramid->setVisible(1); } else { CBPyramid->setChecked(false); CBPyramid->setVisible(0); } + CBPyramid->setEnabled(false); +// if ( ( ConfType == 0 ) || ( ConfType == -1 ) ) { if ( ConfType == 0 ) { RBStandard->setChecked(true); } else { RBBox->setChecked(true); } @@ -183,8 +187,6 @@ void MonEditCase::InitValEdit() RBBox->setVisible(1); RBNC1NpA->setVisible(0); RBNCQuelconque->setVisible(0); - RBStandard->setEnabled(false); - RBBox->setEnabled(false); } else { if (ConfType==-2) { RBBox->setChecked(true);}; @@ -195,15 +197,30 @@ void MonEditCase::InitValEdit() RBBox->setVisible(1); RBNC1NpA->setVisible(1); RBNCQuelconque->setVisible(1); - RBStandard->setEnabled(false); - RBBox->setEnabled(false); - RBNC1NpA->setEnabled(false); - RBNCQuelconque->setEnabled(false); } + RBStandard->setEnabled(false); + RBBox->setEnabled(false); + RBNC1NpA->setEnabled(false); + RBNCQuelconque->setEnabled(false); +// + if ( ExtType == 0 ) + { GBFormat->setVisible(0); + RBMED->setChecked(true); + } + else + { GBFormat->setVisible(1); + RBMED->setVisible(1); + RBSaturne2D->setVisible(1); + RBSaturne2D->setChecked(true); + } + RBMED->setEnabled(false); + RBSaturne2D->setEnabled(false); } else { GBAdvancedOptions->setVisible(0); CBPyramid->setChecked(false); + RBStandard->setChecked(true); + RBMED->setChecked(true); } // // L'etat diff --git a/src/HOMARD_I/HOMARD_Cas_i.cxx b/src/HOMARD_I/HOMARD_Cas_i.cxx index 8bba6822..2fe20062 100755 --- a/src/HOMARD_I/HOMARD_Cas_i.cxx +++ b/src/HOMARD_I/HOMARD_Cas_i.cxx @@ -247,6 +247,19 @@ CORBA::Long HOMARD_Cas_i::GetConfType() return myHomardCas->GetConfType(); } //============================================================================= +void HOMARD_Cas_i::SetExtType( CORBA::Long ExtType ) +{ + ASSERT( myHomardCas ); +// VERIFICATION( (ExtType>=0) && (ExtType<=1) ); + myHomardCas->SetExtType( ExtType ); +} +//============================================================================= +CORBA::Long HOMARD_Cas_i::GetExtType() +{ + ASSERT( myHomardCas ); + return myHomardCas->GetExtType(); +} +//============================================================================= void HOMARD_Cas_i::SetBoundingBox( const HOMARD::extrema& LesExtrema ) { ASSERT( myHomardCas ); diff --git a/src/HOMARD_I/HOMARD_Cas_i.hxx b/src/HOMARD_I/HOMARD_Cas_i.hxx index a6d12c9f..3b610592 100644 --- a/src/HOMARD_I/HOMARD_Cas_i.hxx +++ b/src/HOMARD_I/HOMARD_Cas_i.hxx @@ -76,6 +76,9 @@ public: void SetConfType( CORBA::Long ConfType ); CORBA::Long GetConfType(); + void SetExtType( CORBA::Long ExtType ); + CORBA::Long GetExtType(); + void SetBoundingBox( const HOMARD::extrema& LesExtremes ); HOMARD::extrema* GetBoundingBox(); diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 44ae3827..d5d1fda5 100644 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -1316,6 +1316,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, // B. Lecture du fichier de configuration // ATTENTION : on doit veiller a la coherence entre HomardDriver et CreateCaseFromIteration int NumeIter ; + int TypeExt = 0 ; int TypeConf = 0 ; int Pyram = 0 ; char* MeshName ; @@ -1405,6 +1406,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas, // D. Parametrages lus dans le fichier de configuration myCase->SetConfType (TypeConf) ; + myCase->SetExtType (TypeExt) ; myCase->SetPyram (Pyram) ; // E. Copie du fichier de maillage homard @@ -2696,13 +2698,17 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM int ConfType = myCase->GetConfType(); MESSAGE ( ". ConfType = " << ConfType ); - // D.2. Le maillage de depart + // D.1. Le type externe + int ExtType = myCase->GetExtType(); + MESSAGE ( ". ExtType = " << ExtType ); + + // D.3. Le maillage de depart const char* NomMeshParent = myIterationParent->GetMeshName(); MESSAGE ( ". NomMeshParent = " << NomMeshParent ); const char* MeshFileParent = myIterationParent->GetMeshFile(); MESSAGE ( ". MeshFileParent = " << MeshFileParent ); - // D.3. Le maillage associe a l'iteration + // D.4. Le maillage associe a l'iteration const char* MeshFile = myIteration->GetMeshFile(); MESSAGE ( ". MeshFile = " << MeshFile ); FILE *file = fopen(MeshFile,"r"); @@ -2733,7 +2739,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM } } - // D.4. Les types de raffinement et de deraffinement + // D.5. Les types de raffinement et de deraffinement // Les appels corba sont lourds, il vaut mieux les grouper HOMARD::listeTypes* ListTypes = myHypo->GetAdapRefinUnRef(); ASSERT(ListTypes->length() == 3); @@ -2744,7 +2750,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM // E. Texte du fichier de configuration // E.1. Incontournables du texte - myDriver->TexteAdap(); + myDriver->TexteAdap(ExtType); int iaux = 0 ; myDriver->TexteMaillageHOMARD( DirComputePa, siter, iaux ) ; myDriver->TexteMaillage(NomMeshParent, MeshFileParent, 0); -- 2.39.2