From: eap Date: Fri, 24 May 2013 11:41:20 +0000 (+0000) Subject: 0022172: [CEA 790] create the groups corresponding to domains X-Git-Tag: V7_3_0a1~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0e71d2128e3ee269ffd781c02f0579316a949676;p=plugins%2Fhybridplugin.git 0022172: [CEA 790] create the groups corresponding to domains "To make groups of domains" option has been added. --- diff --git a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png index e272cef..e71688e 100644 Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png differ diff --git a/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc b/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc index 9cececf..9ed28b5 100644 --- a/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc +++ b/doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc @@ -22,6 +22,14 @@ create mesh in the holes inside a solid shape, else only the outermost shape will be meshed. Volumic elements created within holes are bound to the solid. +- To make groups of domains - if checked, the algorithm will +create groups of just generated elements corresponding to each mesh +domain.
+The groups are created provided that + - To mesh holes is switched on, + - the mesh is not based on geometry, e.g. imported from file, and + - there are several domains in the mesh. + - Optimization level - allows choosing the required optimization level (higher level of optimisation provides better mesh, but can be time-consuming): diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index 78cb1fa..04517b5 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx @@ -21,13 +21,11 @@ // File : GHS3DPluginGUI_HypothesisCreator.cxx // Author : Michael Zorin // Module : GHS3DPlugin -// $Header: // #include "GHS3DPluginGUI_HypothesisCreator.h" -// #include "GHS3DPluginGUI_EnforcedDelegates.h" #include "GHS3DPluginGUI_Enums.h" -#include "GeometryGUI.h" +#include #include #include @@ -294,7 +292,7 @@ QWidget *EnforcedMeshTableWidgetDelegate::createEditor(QWidget *parent, void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { - QItemDelegate::setEditorData(editor, index); + QItemDelegate::setEditorData(editor, index); } void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, @@ -392,7 +390,9 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame() } myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup ); - aStdLayout->addWidget( myToMeshHolesCheck, row++, 0, 1, 2 ); + aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 ); + myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup ); + aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 ); aStdLayout->addWidget( new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup ), row, 0, 1, 1 ); myOptimizationLevelCombo = new QComboBox( myStdGroup ); @@ -645,6 +645,7 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame() tab->setCurrentIndex( STD_TAB ); // connections + connect( myToMeshHolesCheck, SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool))); connect( myMaximumMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) ); connect( myInitialMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) ); connect( myBoundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) ); @@ -1384,6 +1385,13 @@ void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() myEnforcedTableWidget->selectionModel()->clearSelection(); } +void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn) +{ + myToMakeGroupsOfDomains->setEnabled( isOn ); + if ( !isOn ) + myToMakeGroupsOfDomains->setChecked( false ); +} + void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked() { QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myWorkingDir->text(), QString() ); @@ -1393,6 +1401,7 @@ void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked() void GHS3DPluginGUI_HypothesisCreator::updateWidgets() { + myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() ); myMaximumMemorySpin->setEnabled( myMaximumMemoryCheck->isChecked() ); myInitialMemoryCheck->setEnabled( !myBoundaryRecoveryCheck->isChecked() ); myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() && !myBoundaryRecoveryCheck->isChecked() ); @@ -1424,6 +1433,7 @@ void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const myName->setText( data.myName ); myToMeshHolesCheck ->setChecked ( data.myToMeshHoles ); + myToMakeGroupsOfDomains ->setChecked ( data.myToMakeGroupsOfDomains ); myOptimizationLevelCombo ->setCurrentIndex( data.myOptimizationLevel ); myMaximumMemoryCheck ->setChecked ( data.myMaximumMemory > 0 ); myMaximumMemorySpin ->setValue ( qMax( data.myMaximumMemory, @@ -1668,6 +1678,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData& h_data.myName = isCreation() && data ? hypName() : ""; h_data.myToMeshHoles = h->GetToMeshHoles(); + h_data.myToMakeGroupsOfDomains = h->GetToMeshHoles() && h->GetToMakeGroupsOfDomains(); h_data.myMaximumMemory = h->GetMaximumMemory(); h_data.myInitialMemory = h->GetInitialMemory(); h_data.myInitialMemory = h->GetInitialMemory(); @@ -1741,6 +1752,8 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD if ( h->GetToMeshHoles() != h_data.myToMeshHoles ) // avoid duplication of DumpPython commands h->SetToMeshHoles ( h_data.myToMeshHoles ); + if ( h->GetToMakeGroupsOfDomains() != h_data.myToMakeGroupsOfDomains ) + h->SetToMakeGroupsOfDomains( h_data.myToMakeGroupsOfDomains ); if ( h->GetMaximumMemory() != h_data.myMaximumMemory ) h->SetMaximumMemory ( h_data.myMaximumMemory ); if ( h->GetInitialMemory() != h_data.myInitialMemory ) @@ -1854,6 +1867,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisDat MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets"); h_data.myName = myName ? myName->text() : ""; h_data.myToMeshHoles = myToMeshHolesCheck->isChecked(); + h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked(); h_data.myMaximumMemory = myMaximumMemoryCheck->isChecked() ? myMaximumMemorySpin->value() : -1; h_data.myInitialMemory = myInitialMemoryCheck->isChecked() ? myInitialMemorySpin->value() : -1; h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex(); diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.h b/src/GUI/GHS3DPluginGUI_HypothesisCreator.h index 44641a5..a9830d9 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.h +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.h @@ -140,7 +140,7 @@ typedef std::set< TEnfMesh*, CompareEnfMeshes > TEnfMeshList; typedef struct { - bool myToMeshHoles,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint; + bool myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint; int myMaximumMemory,myInitialMemory,myOptimizationLevel; QString myName,myWorkingDir,myTextOption; double myGradation; @@ -173,6 +173,7 @@ protected: virtual QString type() const; protected slots: + void onToMeshHoles(bool); void onDirBtnClicked(); void updateWidgets(); @@ -209,6 +210,7 @@ private: QWidget* myStdGroup; QLineEdit* myName; QCheckBox* myToMeshHolesCheck; + QCheckBox* myToMakeGroupsOfDomains; QComboBox* myOptimizationLevelCombo; QWidget* myAdvGroup; diff --git a/src/GUI/GHS3DPlugin_msg_en.ts b/src/GUI/GHS3DPlugin_msg_en.ts index 9c8884b..b77bcb3 100644 --- a/src/GUI/GHS3DPlugin_msg_en.ts +++ b/src/GUI/GHS3DPlugin_msg_en.ts @@ -31,6 +31,10 @@ GHS3D_TO_MESH_HOLES To mesh holes + + GHS3D_TO_MAKE_DOMAIN_GROUPS + To make groups of domains + INIT_MEMORY_SIZE Initial memory size