/*!
- * To mesh Boundary Layers growing inward or outward.
- * Default is inward.
+ * Collision mode: 0-decrease, 1-stop. Default is decrease
*/
- void SetBoundaryLayersInward(in boolean toBoundaryLayersInward);
- boolean GetBoundaryLayersInward();
+ void SetCollisionMode(in short level) raises (SALOME::SALOME_Exception);
+ short GetCollisionMode();
/*!
- * To mesh with element type Tetra Dominant or hexa Dominant in the boundary layers.
- * Default is Tetra Dominant.
+ * BoundaryLayersGrowth: 0-Layer_Growth_Inward, 1-Layer_Growth_Outward. Default is Layer_Growth_Inward
*/
- void SetElemGenTetraDominant(in boolean toElemGenTetraDominant);
- boolean GetElemGenTetraDominant();
+ void SetBoundaryLayersGrowth(in short level) raises (SALOME::SALOME_Exception);
+ short GetBoundaryLayersGrowth();
+ /*!
+ * ElementGeneration: 0-Generation_Tetra_Dominant, 1-Generation_Hexa_Dominant. Default is Generation_Tetra_Dominant
+ */
+ void SetElementGeneration(in short level) raises (SALOME::SALOME_Exception);
+ short GetElementGeneration();
+
/*!
* To mesh adding extra normals at opening ridges and corners.
* Default is no.
<algorithms>
<algorithm type="HYBRID_3D"
- label-id="Tetrahedron and hexahedron (HYBRID)"
+ label-id="Tetrahedron etc... (HYBRID)"
icon-id="mesh_tree_hypo_hybrid.png"
input="TRIA,QUAD"
need-geom="false"
QFrame* HYBRIDPluginGUI_HypothesisCreator::buildFrame()
{
- std::cout << std::endl << "!!!!!!!!!!!!!!!!!!!!buildFrame TOVERIFY" << std::endl;
QFrame* fr = new QFrame( 0 );
QVBoxLayout* lay = new QVBoxLayout( fr );
lay->setMargin( 5 );
types << tr( "LEVEL_NONE" ) << tr( "LEVEL_LIGHT" ) << tr( "LEVEL_MEDIUM" ) << tr( "LEVEL_STANDARDPLUS" ) << tr( "LEVEL_STRONG" );
myOptimizationLevelCombo->addItems( types );
- myBoundaryLayersInwardCheck = new QCheckBox( tr( "HYBRID_LAYERS_INWARD" ), myStdGroup );
- aStdLayout->addWidget( myBoundaryLayersInwardCheck, row++, 0, 1, 1 );
- myBoundaryLayersInwardCheck->setToolTip(tr( "HYBRID_LAYERS_Outward" ) ); //"Outward growth if deselected");
+ aStdLayout->addWidget( new QLabel( tr( "HYBRID_BOUNDARY_LAYERS_GROWTH" ), myStdGroup ), row, 0, 1, 1 );
+ myBoundaryLayersGrowthCombo = new QComboBox( myStdGroup );
+ aStdLayout->addWidget( myBoundaryLayersGrowthCombo, row++, 1, 1, 1 );
+
+ QStringList typesBoundaryLayersGrowth;
+ typesBoundaryLayersGrowth << tr( "HYBRID_LAYER_GROWTH_INWARD" ) << tr( "HYBRID_LAYER_GROWTH_OUTWARD" );
+ myBoundaryLayersGrowthCombo->addItems( typesBoundaryLayersGrowth );
aStdLayout->addWidget( new QLabel( tr( "HYBRID_HeightFirstLayer" ), myStdGroup ), row, 0, 1, 1 );
myHeightFirstLayerSpin = new SMESHGUI_SpinBox( myStdGroup );
myBoundaryLayersProgressionSpin->RangeStepAndValidator(0., 10., .1, "BoundaryLayersProgression");
aStdLayout->addWidget( myBoundaryLayersProgressionSpin, row++, 1, 1, 1 );
- myElemGenTetraDominantCheck = new QCheckBox( tr( "HYBRID_TETRA_DOMINANT" ), myStdGroup );
- aStdLayout->addWidget( myElemGenTetraDominantCheck, row++, 0, 1, 1 );
+ aStdLayout->addWidget( new QLabel( tr( "COLLISION_MODE" ), myStdGroup ), row, 0, 1, 1 );
+ myCollisionModeCombo = new QComboBox( myStdGroup );
+ aStdLayout->addWidget( myCollisionModeCombo, row++, 1, 1, 1 );
+
+ QStringList typescoll;
+ typescoll << tr( "COLLISION_DECREASE" ) << tr( "COLLISION_STOP" );
+ myCollisionModeCombo->addItems( typescoll );
+ aStdLayout->addWidget( new QLabel( tr( "HYBRID_GENERATION_ELEMENT" ), myStdGroup ), row, 0, 1, 1 );
+ myElementGenerationCombo = new QComboBox( myStdGroup );
+ aStdLayout->addWidget( myElementGenerationCombo, row++, 1, 1, 1 );
+
+ QStringList typesElementGeneration;
+ typesElementGeneration << tr( "HYBRID_GENERATION_TETRA_DOMINANT" ) << tr( "HYBRID_GENERATION_HEXA_DOMINANT" );
+ myElementGenerationCombo->addItems( typesElementGeneration );
+
myAddMultinormalsCheck = new QCheckBox( tr( "HYBRID_ADD_MULTINORMALS" ), myStdGroup );
aStdLayout->addWidget( myAddMultinormalsCheck, row++, 0, 1, 1 );
//connect( myAdvWidget->initialMemoryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
//connect( myAdvWidget->boundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
- connect( myBoundaryLayersInwardCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
- connect( myElemGenTetraDominantCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
+ //connect( myBoundaryLayersGrowthCombo, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
+ //connect( myElementGenerationCombo, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
connect( myAddMultinormalsCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
connect( mySmoothNormalsCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
// connect( myEnfMeshConstraint, SIGNAL( currentIndexChanged(int) ), this, SLOT( checkEnfMeshIsDefined() ) );
// connect( this, SIGNAL( enfMeshDefined(bool) ), addEnfMeshButton, SLOT( setEnabled(bool) ) );
- std::cout << std::endl << "!!!!!!!!!!!!!!!!!!!!buildFrame TOVERIFY end" << std::endl;
return fr;
}
myAdvWidget->initialMemorySpin ->setValue ( qMax( data.myInitialMemory,
myAdvWidget->initialMemorySpin->minimum() ));
- myBoundaryLayersInwardCheck -> setChecked ( data.myBoundaryLayersInward );
- myElemGenTetraDominantCheck -> setChecked ( data.myElemGenTetraDominant );
+ myCollisionModeCombo ->setCurrentIndex( data.myCollisionMode );
+ myBoundaryLayersGrowthCombo ->setCurrentIndex( data.myBoundaryLayersGrowth );
+ myElementGenerationCombo ->setCurrentIndex( data.myElementGeneration );
myAddMultinormalsCheck -> setChecked ( data.myAddMultinormals );
mySmoothNormalsCheck -> setChecked ( data.mySmoothNormals );
myHeightFirstLayerSpin -> setValue( data.myHeightFirstLayer );
h_data.myInitialMemory = h->GetInitialMemory();
h_data.myOptimizationLevel = h->GetOptimizationLevel();
- h_data.myBoundaryLayersInward = h->GetBoundaryLayersInward();
- h_data.myElemGenTetraDominant = h->GetElemGenTetraDominant();
+ h_data.myCollisionMode = h->GetCollisionMode();
+ h_data.myBoundaryLayersGrowth = h->GetBoundaryLayersGrowth();
+ h_data.myElementGeneration = h->GetElementGeneration();
h_data.myAddMultinormals = h->GetAddMultinormals();
h_data.mySmoothNormals = h->GetSmoothNormals();
h_data.myHeightFirstLayer = h->GetHeightFirstLayer();
if ( h->GetOptimizationLevel() != h_data.myOptimizationLevel )
h->SetOptimizationLevel( h_data.myOptimizationLevel );
- if ( h->GetBoundaryLayersInward() != h_data.myBoundaryLayersInward )
- h->SetBoundaryLayersInward ( h_data.myBoundaryLayersInward );
- if ( h->GetElemGenTetraDominant() != h_data.myElemGenTetraDominant )
- h->SetElemGenTetraDominant ( h_data.myElemGenTetraDominant );
+ if ( h->GetCollisionMode() != h_data.myCollisionMode )
+ h->SetCollisionMode( h_data.myCollisionMode );
+ if ( h->GetBoundaryLayersGrowth() != h_data.myBoundaryLayersGrowth )
+ h->SetBoundaryLayersGrowth( h_data.myBoundaryLayersGrowth );
+ if ( h->GetElementGeneration() != h_data.myElementGeneration )
+ h->SetElementGeneration( h_data.myElementGeneration );
+
if ( h->GetAddMultinormals() != h_data.myAddMultinormals )
h->SetAddMultinormals ( h_data.myAddMultinormals );
if ( h->GetSmoothNormals() != h_data.mySmoothNormals )
h_data.myInitialMemory = myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1;
h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex();
- h_data.myBoundaryLayersInward = myBoundaryLayersInwardCheck->isChecked();
- h_data.myElemGenTetraDominant = myElemGenTetraDominantCheck->isChecked();
+ h_data.myCollisionMode = myCollisionModeCombo->currentIndex();
+ h_data.myBoundaryLayersGrowth = myBoundaryLayersGrowthCombo->currentIndex();
+ h_data.myElementGeneration = myElementGenerationCombo->currentIndex();
h_data.myAddMultinormals = myAddMultinormalsCheck->isChecked();
h_data.mySmoothNormals = mySmoothNormalsCheck->isChecked();
typedef struct
{
- bool myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint,
+ bool myToMeshHoles, myToMakeGroupsOfDomains,
+ myKeepFiles, myToCreateNewNodes,
+ myBoundaryRecovery, myFEMCorrection,
+ myRemoveInitialCentralPoint,
myLogInStandardOutput, myRemoveLogOnSuccess;
double myMaximumMemory,myInitialMemory;
int myOptimizationLevel;
+ int myCollisionMode;
+ int myBoundaryLayersGrowth;
+ int myElementGeneration;
QString myName,myWorkingDir,myTextOption;
double myGradation;
short myVerboseLevel;
TEnfVertexList myEnforcedVertices;
TEnfMeshList myEnforcedMeshes;
- bool myBoundaryLayersInward,
- myElemGenTetraDominant,
- myAddMultinormals,
+ bool myAddMultinormals,
mySmoothNormals;
double myHeightFirstLayer,
myBoundaryLayersProgression,
QCheckBox* myToMeshHolesCheck;
QCheckBox* myToMakeGroupsOfDomains;
QComboBox* myOptimizationLevelCombo;
- QCheckBox* myBoundaryLayersInwardCheck;
- QCheckBox* myElemGenTetraDominantCheck;
+ QComboBox* myCollisionModeCombo;
+ QComboBox* myBoundaryLayersGrowthCombo;
+ QComboBox* myElementGenerationCombo;
QCheckBox* myAddMultinormalsCheck;
QCheckBox* mySmoothNormals;
QWidget* myAdvGroup;
<translation>Hypothesis Construction</translation>
</message>
<message>
- <source>HYBRID_LAYERS_INWARD</source>
- <translation>Inward growth of boundary layers</translation>
+ <source>HYBRID_BOUNDARY_LAYERS_GROWTH</source>
+ <translation>Growth of boundary layers</translation>
</message>
<message>
- <source>HYBRID_LAYERS_Outward</source>
- <translation>Outward growth growth of boundary layers if deselected</translation>
+ <source>HYBRID_LAYER_GROWTH_INWARD</source>
+ <translation>Inward growth</translation>
</message>
<message>
- <source>HYBRID_TETRA_DOMINANT</source>
- <translation>Mesh with tetrahedra in the remaining volume</translation>
+ <source>HYBRID_LAYER_GROWTH_OUTWARD</source>
+ <translation>Outward growth</translation>
+ </message>
+ <message>
+ <source>HYBRID_GENERATION_ELEMENT</source>
+ <translation>Element type for mesh in the remaining volume</translation>
+ </message>
+ <message>
+ <source>HYBRID_GENERATION_TETRA_DOMINANT</source>
+ <translation>Tetrahedra dominant</translation>
+ </message>
+ <message>
+ <source>HYBRID_GENERATION_HEXA_DOMINANT</source>
+ <translation>Hexahedra dominant</translation>
</message>
<message>
<source>HYBRID_ADD_MULTINORMALS</source>
<source>KEEP_WORKING_FILES</source>
<translation>Keep all working files</translation>
</message>
+ <message>
+ <source>COLLISION_MODE</source>
+ <translation>Behavior in case of collision between layers</translation>
+ </message>
+ <message>
+ <source>COLLISION_DECREASE</source>
+ <translation>Decrease height of layers</translation>
+ </message>
+ <message>
+ <source>COLLISION_STOP</source>
+ <translation>Reduce number of layers locally</translation>
+ </message>
<message>
<source>LEVEL_NONE</source>
<translation>None</translation>
# V4.1 (partialy redefines V3.1). Issue 0020574
None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization, Strong_Optimization = 0,1,2,3,4
+# Collision Mode
+Decrease_Collision_Mode, Stop_Collision_Mode = 0,1
+
+# Boundary Layers growing inward or outward.
+Layer_Growth_Inward, Layer_Growth_Outward = 0,1
+
+# Mesh with element type Tetra Dominant or hexa Dominant in the remaining volume (outside layers).
+Generation_Tetra_Dominant, Generation_Hexa_Dominant = 0,1
+
#----------------------------
# Mesh algo type identifiers
#----------------------------
pass
"""
+ ## Set Collision Mode:
+ # @param mode Collision Mode, one of the following values
+ # - Decrease_Collision_Mode
+ # - Stop_Collision_Mode
+ # .
+ # Default is Decrease_Collision_Mode
+ def SetCollisionMode(self, mode):
+ self.Parameters().SetCollisionMode(mode)
+ pass
+
## To mesh Boundary Layers growing inward or outward.
- # Default is inward.
- # @param inward boolean value
- def SetBoundaryLayersInward(self, inward):
- self.Parameters().SetBoundaryLayersInward(inward)
+ # @param mode, one of the following values
+ # - Layer_Growth_Inward
+ # - Layer_Growth_Outward
+ # .
+ # Default is Layer_Growth_Inward
+ def SetBoundaryLayersGrowth(self, mode):
+ self.Parameters().SetBoundaryLayersGrowth(mode)
pass
- ## To mesh with element type Tetra Dominant or hexa Dominant in the boundary layers.
- # Default is Tetra Dominant.
- # @param tetraDominant boolean value
- def SetElemGenTetraDominant(self, tetraDominant);
- self.Parameters().SetElemGenTetraDominant(tetraDominant)
+ ## To mesh with element type Tetra Dominant or hexa Dominant in the remaining volume (outside layers).
+ # @param mode, one of the following values
+ # - Generation_Tetra_Dominant
+ # - Generation_Hexa_Dominant
+ # .
+ # Default is Generation_Tetra_Dominant
+ def SetElementGeneration(self, mode);
+ self.Parameters().SetElementGeneration(mode)
pass
## To mesh adding extra normals at opening ridges and corners.
TCollection_AsciiString cmd = TCollection_AsciiString((char*)HYBRIDPlugin_Hypothesis::CommandToRun( _hyp, false ).c_str());
cmd += TCollection_AsciiString(" --in ") + aGMFFileName;
- if ( nbEnforcedVertices + nbEnforcedNodes)
- cmd += TCollection_AsciiString(" --required_vertices ") + aGenericNameRequired;
+ //if ( nbEnforcedVertices + nbEnforcedNodes)
+ // cmd += TCollection_AsciiString(" --required_vertices ") + aGenericNameRequired;
cmd += TCollection_AsciiString(" --out ") + aResultFileName;
if ( !_logInStandardOutput )
cmd += TCollection_AsciiString(" 1>" ) + aLogFileName; // dump into file
myMaximumMemory(-1),
myInitialMemory(-1),
myOptimizationLevel(DefaultOptimizationLevel()),
- myBoundaryLayersInward(DefaultBoundaryLayersInward()),
- myElemGenTetraDominant(DefaultElemGenTetraDominant()),
+ myCollisionMode(DefaultCollisionMode()),
+ myBoundaryLayersGrowth(DefaultBoundaryLayersGrowth()),
+ myElementGeneration(DefaultElementGeneration()),
myAddMultinormals(DefaultAddMultinormals()),
mySmoothNormals(DefaultSmoothNormals()),
myHeightFirstLayer(DefaultHeightFirstLayer()),
//=======================================================================
//function : GetOptimizationLevel
//=======================================================================
-
HYBRIDPlugin_Hypothesis::OptimizationLevel HYBRIDPlugin_Hypothesis::GetOptimizationLevel() const
{
return (OptimizationLevel) myOptimizationLevel;
}
-
//=======================================================================
-//function : SetBoundaryLayersInward
+//function : SetCollisionMode
//=======================================================================
-
-void HYBRIDPlugin_Hypothesis::SetBoundaryLayersInward(bool toBoundaryLayersInward)
+void HYBRIDPlugin_Hypothesis::SetCollisionMode(CollisionMode mode)
{
- if ( myBoundaryLayersInward != toBoundaryLayersInward ) {
- myBoundaryLayersInward = toBoundaryLayersInward;
+ if ( myCollisionMode != mode ) {
+ myCollisionMode = mode;
NotifySubMeshesHypothesisModification();
}
}
//=======================================================================
-//function : GetBoundaryLayersInward
+//function : GetCollisionMode
//=======================================================================
+HYBRIDPlugin_Hypothesis::CollisionMode HYBRIDPlugin_Hypothesis::GetCollisionMode() const
+{
+ return (CollisionMode) myCollisionMode;
+}
-bool HYBRIDPlugin_Hypothesis::GetBoundaryLayersInward() const
+//=======================================================================
+//function : SetBoundaryLayersGrowth
+//=======================================================================
+void HYBRIDPlugin_Hypothesis::SetBoundaryLayersGrowth(BoundaryLayersGrowth mode)
{
- return myBoundaryLayersInward;
+ if ( myBoundaryLayersGrowth != mode ) {
+ myBoundaryLayersGrowth = mode;
+ NotifySubMeshesHypothesisModification();
+ }
}
//=======================================================================
-//function : SetElemGenTetraDominant
+//function : GetBoundaryLayersGrowth
//=======================================================================
+HYBRIDPlugin_Hypothesis::BoundaryLayersGrowth HYBRIDPlugin_Hypothesis::GetBoundaryLayersGrowth() const
+{
+ return (BoundaryLayersGrowth) myBoundaryLayersGrowth;
+}
-void HYBRIDPlugin_Hypothesis::SetElemGenTetraDominant(bool toElemGenTetraDominant)
+//=======================================================================
+//function : SetElementGeneration
+//=======================================================================
+void HYBRIDPlugin_Hypothesis::SetElementGeneration(ElementGeneration mode)
{
- if ( myElemGenTetraDominant != toElemGenTetraDominant ) {
- myElemGenTetraDominant = toElemGenTetraDominant;
+ if ( myElementGeneration != mode ) {
+ myElementGeneration = mode;
NotifySubMeshesHypothesisModification();
}
}
//=======================================================================
-//function : GetElemGenTetraDominant
+//function : GetElementGeneration
//=======================================================================
-
-bool HYBRIDPlugin_Hypothesis::GetElemGenTetraDominant() const
+HYBRIDPlugin_Hypothesis::ElementGeneration HYBRIDPlugin_Hypothesis::GetElementGeneration() const
{
- return myElemGenTetraDominant;
+ return (ElementGeneration) myElementGeneration;
}
//=======================================================================
//function : SetAddMultinormals
//=======================================================================
-
void HYBRIDPlugin_Hypothesis::SetAddMultinormals(bool toAddMultinormals)
{
if ( myAddMultinormals != toAddMultinormals ) {
}
//=======================================================================
-//function : DefaultOptimizationLevel
+//function : DefaultCollisionMode
//=======================================================================
+short HYBRIDPlugin_Hypothesis::DefaultCollisionMode()
+{
+ return Decrease;
+}
+//=======================================================================
+//function : DefaultBoundaryLayersGrowth
+//=======================================================================
+short HYBRIDPlugin_Hypothesis::DefaultBoundaryLayersGrowth()
+{
+ return Layer_Growth_Inward;
+}
+
+//=======================================================================
+//function : DefaultElementGeneration
+//=======================================================================
+short HYBRIDPlugin_Hypothesis::DefaultElementGeneration()
+{
+ return Generation_Tetra_Dominant;
+}
+
+//=======================================================================
+//function : DefaultOptimizationLevel
+//=======================================================================
short HYBRIDPlugin_Hypothesis::DefaultOptimizationLevel()
{
return Medium;
// return HYBRIDPlugin_Hypothesis::TID2SizeMap();
// }
-//=======================================================================
-//function : DefaultBoundaryLayersInward
-//=======================================================================
-bool HYBRIDPlugin_Hypothesis::DefaultBoundaryLayersInward()
-{
- return true;
-}
-
-//=======================================================================
-//function : DefaultElemGenTetraDominant
-//=======================================================================
-bool HYBRIDPlugin_Hypothesis::DefaultElemGenTetraDominant()
-{
- return true;
-}
-
//=======================================================================
//function : DefaultAddMultinormals
//=======================================================================
std::ostream & HYBRIDPlugin_Hypothesis::SaveTo(std::ostream & save)
{
- save << (int) myBoundaryLayersInward << " ";
- save << (int) myElemGenTetraDominant << " ";
+ save << (int) myBoundaryLayersGrowth << " ";
+ save << (int) myElementGeneration << " ";
save << (int) myAddMultinormals << " ";
save << (int) mySmoothNormals << " ";
isOK = (load >> i);
if (isOK)
- myBoundaryLayersInward = (bool) i;
+ myBoundaryLayersGrowth = (short) i;
else
load.clear(ios::badbit | load.rdstate());
isOK = (load >> i);
if (isOK)
- myElemGenTetraDominant = (bool) i;
+ myElementGeneration = (short) i;
else
load.clear(ios::badbit | load.rdstate());
//================================================================================
std::string HYBRIDPlugin_Hypothesis::CommandToRun(const HYBRIDPlugin_Hypothesis* hyp,
- const bool hasShapeToMesh)
+ const bool hasShapeToMesh)
{
TCollection_AsciiString cmd = GetExeName().c_str();
// check if any option is overridden by hyp->myTextOption
- bool p_v = hyp ? ( hyp->myTextOption.find("-v") == std::string::npos ) : true;
- //bool p_i = hyp ? ( hyp->myTextOption.find("-i") == std::string::npos ) : true;
- bool p_o = hyp ? ( hyp->myTextOption.find("-o") == std::string::npos ) : true;
- bool p_blsi = hyp ? ( hyp->myTextOption.find("-blsi") == std::string::npos ) : true;
- bool p_blsd = hyp ? ( hyp->myTextOption.find("-blsd") == std::string::npos ) : true;
- bool p_hotfl = hyp ? ( hyp->myTextOption.find("-hotfl") == std::string::npos ) : true;
- bool p_nobl = hyp ? ( hyp->myTextOption.find("-nobl") == std::string::npos ) : true;
- bool p_blgp = hyp ? ( hyp->myTextOption.find("-blgp") == std::string::npos ) : true;
- bool p_eg = hyp ? ( hyp->myTextOption.find("-eg") == std::string::npos ) : true;
- bool p_am = hyp ? ( hyp->myTextOption.find("-am") == std::string::npos ) : true;
- bool p_mat = hyp ? ( hyp->myTextOption.find("-mat") == std::string::npos ) : true;
- bool p_sn = hyp ? ( hyp->myTextOption.find("-sn") == std::string::npos ) : true;
-
- // verbose mode
- if ( p_v && hyp ) {
- cmd += " -v ";
+ bool p_h = ( hyp->myTextOption.find("-h") != std::string::npos );
+ bool p_v = ( hyp->myTextOption.find("-v ") != std::string::npos );
+ //bool p_i = ( hyp->myTextOption.find("-i") != std::string::npos );
+ //bool p_o = ( hyp->myTextOption.find("-o") != std::string::npos );
+ bool p_mnot = ( hyp->myTextOption.find("--max_number_of_threads ") != std::string::npos );
+ bool p_blsi = ( hyp->myTextOption.find("--boundary_layers_surface_ids ") != std::string::npos );
+ bool p_blii = ( hyp->myTextOption.find("--boundary_layers_imprint_ids ") != std::string::npos );
+ bool p_blsd = ( hyp->myTextOption.find("--boundary_layers_subdomain_direction ") != std::string::npos );
+ bool p_hotfl = ( hyp->myTextOption.find("--height_of_the_first_layer ") != std::string::npos );
+ bool p_nobl = ( hyp->myTextOption.find("--number_of_boundary_layers ") != std::string::npos );
+ bool p_blgp = ( hyp->myTextOption.find("--boundary_layers_geometric_progression ") != std::string::npos );
+ bool p_eg = ( hyp->myTextOption.find("--element_generation ") != std::string::npos );
+ bool p_cm = ( hyp->myTextOption.find("--collision_mode ") != std::string::npos );
+ bool p_am = ( hyp->myTextOption.find("--add_multinormals ") != std::string::npos );
+ bool p_mat = ( hyp->myTextOption.find("--multinormals_angle_threshold ") != std::string::npos );
+ bool p_sn = ( hyp->myTextOption.find("--smooth_normals ") != std::string::npos );
+
+ //help mode
+ if ( p_h ) {
+ cmd += " --help ";
+#ifdef WIN32
+ cmd += " < NUL";
+#endif
+ std::cout << "!!!!! CommandToRun help only !!!! " << cmd.ToCString() << std::endl;
+ return cmd.ToCString();
+ }
+
+ if ( !p_v && hyp ) {
+ cmd += " --verbose ";
cmd += hyp->myVerboseLevel;
}
- // options as text
- if ( hyp && !hyp->myTextOption.empty() ) {
- cmd += " ";
- cmd += (char*) hyp->myTextOption.c_str();
+ if ( !p_mnot && hyp ) {
+ cmd += " --max_number_of_threads ";
+ cmd += 8; //TODO getenv NB CPU
}
-
+
+ //if ( !p_blsi && hyp ) {
+ // cmd += " --boundary_layers_surface_ids ";
+ // cmd += 0; //TODO hyp->my;
+ //}
+
+ //if ( !p_blii && hyp ) {
+ // cmd += " --boundary_layers_imprint_ids ";
+ // cmd += 0; //TODO hyp->my;
+ //}
+
+ if ( !p_blsd && hyp ) {
+ if ( hyp->myBoundaryLayersGrowth >= 0 && hyp->myBoundaryLayersGrowth <= 1 ) {
+ const char* value[] = { "1" , "-1" };
+ cmd += " --boundary_layers_subdomain_direction ";
+ cmd += value[ hyp->myBoundaryLayersGrowth ];
+ }
+ }
+
+ if ( !p_hotfl && hyp ) {
+ cmd += " --height_of_the_first_layer ";
+ cmd += hyp->myHeightFirstLayer;
+ }
+
+ if ( !p_nobl && hyp ) {
+ cmd += " --number_of_boundary_layers ";
+ cmd += hyp->myNbOfBoundaryLayers;
+ }
+
+ if ( !p_blgp && hyp ) {
+ cmd += " --boundary_layers_geometric_progression ";
+ cmd += hyp->myBoundaryLayersProgression;
+ }
+
+ if ( !p_eg && hyp ) {
+ if ( hyp->myElementGeneration >= 0 && hyp->myElementGeneration <= 1 ) {
+ const char* value[] = { "tetra-dominant" , "hexa-dominant" };
+ cmd += " --element_generation ";
+ cmd += value[ hyp->myElementGeneration ];
+ }
+ }
+
+ if ( !p_cm && hyp ) {
+ if ( hyp->myCollisionMode >= 0 && hyp->myCollisionMode <= 1 ) {
+ const char* value[] = { "decrease" , "stop" };
+ cmd += " --collision_mode ";
+ cmd += value[ hyp->myCollisionMode ];
+ }
+ }
+
+ if ( !p_am && hyp ) {
+ int res = hyp->myAddMultinormals ? 0 : 1 ;
+ const char* value[] = { "yes" , "no" };
+ cmd += " --add_multinormals ";
+ cmd += value[ res ];
+ }
+
+ if ( !p_mat && hyp ) {
+ cmd += " --multinormals_angle_threshold ";
+ cmd += hyp->myMultinormalsAngle;
+ }
+
+ if ( !p_sn && hyp ) {
+ int res = hyp->mySmoothNormals ? 0 : 1 ;
+ const char* value[] = { "yes" , "no" };
+ cmd += " --smooth_normals ";
+ cmd += value[ res ];
+ }
+
#ifdef WIN32
cmd += " < NUL";
#endif
-
+ //std::cout << "!!!!!CommandToRun end " << cmd.ToCString() << std::endl;
+
return cmd.ToCString();
}
void SetOptimizationLevel(OptimizationLevel level);
OptimizationLevel GetOptimizationLevel() const;
- /*!
- * To mesh Boundary Layers growing inward or outward.
- * Default is inward.
- */
- void SetBoundaryLayersInward(bool toBoundaryLayersInward);
- bool GetBoundaryLayersInward() const;
- /*!
- * To mesh with element type Tetra Dominant or hexa Dominant in the boundary layers.
- * Default is Tetra Dominant.
- */
- void SetElemGenTetraDominant(bool toElemGenTetraDominant);
- bool GetElemGenTetraDominant() const;
+ /*!
+ * Collision Mode: 0-decrease, 1-stop. Default is decrease
+ */
+ enum CollisionMode { Decrease = 0, Stop };
+ void SetCollisionMode(CollisionMode level);
+ CollisionMode GetCollisionMode() const;
+ /*!
+ * BoundaryLayersGrowth: 0-Layer_Growth_Inward, 1-Layer_Growth_Outward. Default is Layer_Growth_Inward
+ */
+ enum BoundaryLayersGrowth { Layer_Growth_Inward = 0, Layer_Growth_Outward };
+ void SetBoundaryLayersGrowth(BoundaryLayersGrowth level);
+ BoundaryLayersGrowth GetBoundaryLayersGrowth() const;
+ /*!
+ * ElementGeneration: 0-Generation_Tetra_Dominant, 1-Generation_Hexa_Dominant. Default is Generation_Tetra_Dominant
+ */
+ enum ElementGeneration { Generation_Tetra_Dominant = 0, Generation_Hexa_Dominant };
+ void SetElementGeneration(ElementGeneration level);
+ ElementGeneration GetElementGeneration() const;
/*!
* To mesh adding extra normals at opening ridges and corners.
* Default is no.
static double DefaultMaximumMemory();
static double DefaultInitialMemory();
static short DefaultOptimizationLevel();
+ static short DefaultCollisionMode();
+ static short DefaultBoundaryLayersGrowth();
+ static short DefaultElementGeneration();
static std::string DefaultWorkingDirectory();
static bool DefaultKeepFiles();
static short DefaultVerboseLevel();
static bool DefaultStandardOutputLog();
static bool DefaultRemoveLogOnSuccess();
static double DefaultGradation();
- static bool DefaultBoundaryLayersInward();
- static bool DefaultElemGenTetraDominant();
static bool DefaultAddMultinormals();
static bool DefaultSmoothNormals();
static short DefaultNbOfBoundaryLayers();
double myMaximumMemory;
double myInitialMemory;
short myOptimizationLevel;
+ short myCollisionMode;
+ short myBoundaryLayersGrowth;
+ short myElementGeneration;
bool myKeepFiles;
std::string myWorkingDirectory;
short myVerboseLevel;
std::string myTextOption;
double myGradation;
- bool myBoundaryLayersInward;
- bool myElemGenTetraDominant;
bool myAddMultinormals;
bool mySmoothNormals;
double myHeightFirstLayer;
return this->GetImpl()->GetOptimizationLevel();
}
+
+//=======================================================================
+//function : SetCollisionMode
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetCollisionMode(CORBA::Short level)
+ throw ( SALOME::SALOME_Exception )
+{
+ ::HYBRIDPlugin_Hypothesis::CollisionMode l =
+ (::HYBRIDPlugin_Hypothesis::CollisionMode) level;
+ if ( l < ::HYBRIDPlugin_Hypothesis::Decrease ||
+ l > ::HYBRIDPlugin_Hypothesis::Stop )
+ THROW_SALOME_CORBA_EXCEPTION( "Invalid collision mode",SALOME::BAD_PARAM );
+
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetCollisionMode(l);
+ SMESH::TPythonDump() << _this() << ".SetCollisionMode( " << level << " )";
+}
+
+//=======================================================================
+//function : GetCollisionMode
+//=======================================================================
+CORBA::Short HYBRIDPlugin_Hypothesis_i::GetCollisionMode()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetCollisionMode();
+}
+
//=======================================================================
//function : SetWorkingDirectory
//=======================================================================
}
//=======================================================================
-//function : SetBoundaryLayersInward
+//function : SetBoundaryLayersGrowth
//=======================================================================
-void HYBRIDPlugin_Hypothesis_i::SetBoundaryLayersInward(CORBA::Boolean toBoundaryLayersInward)
+void HYBRIDPlugin_Hypothesis_i::SetBoundaryLayersGrowth(CORBA::Short level)
+ throw ( SALOME::SALOME_Exception )
{
+ ::HYBRIDPlugin_Hypothesis::BoundaryLayersGrowth l =
+ (::HYBRIDPlugin_Hypothesis::BoundaryLayersGrowth) level;
+ if ( l < ::HYBRIDPlugin_Hypothesis::Layer_Growth_Inward ||
+ l > ::HYBRIDPlugin_Hypothesis::Layer_Growth_Outward )
+ THROW_SALOME_CORBA_EXCEPTION( "Invalid BoundaryLayersGrowth mode",SALOME::BAD_PARAM );
+
ASSERT(myBaseImpl);
- this->GetImpl()->SetBoundaryLayersInward(toBoundaryLayersInward);
- SMESH::TPythonDump() << _this() << ".SetBoundaryLayersInward( " << toBoundaryLayersInward << " )";
+ this->GetImpl()->SetBoundaryLayersGrowth(l);
+ SMESH::TPythonDump() << _this() << ".SetBoundaryLayersGrowth( " << level << " )";
}
//=======================================================================
-//function : GetBoundaryLayersInward
+//function : GetBoundaryLayersGrowth
//=======================================================================
-CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetBoundaryLayersInward()
+CORBA::Short HYBRIDPlugin_Hypothesis_i::GetBoundaryLayersGrowth()
{
ASSERT(myBaseImpl);
- return this->GetImpl()->GetBoundaryLayersInward();
+ return this->GetImpl()->GetBoundaryLayersGrowth();
}
//=======================================================================
-//function : SetElemGenTetraDominant
+//function : SetElementGeneration
//=======================================================================
-void HYBRIDPlugin_Hypothesis_i::SetElemGenTetraDominant(CORBA::Boolean toElemGenTetraDominant)
+void HYBRIDPlugin_Hypothesis_i::SetElementGeneration(CORBA::Short level)
+ throw ( SALOME::SALOME_Exception )
{
+ ::HYBRIDPlugin_Hypothesis::ElementGeneration l =
+ (::HYBRIDPlugin_Hypothesis::ElementGeneration) level;
+ if ( l < ::HYBRIDPlugin_Hypothesis::Generation_Tetra_Dominant ||
+ l > ::HYBRIDPlugin_Hypothesis::Generation_Hexa_Dominant )
+ THROW_SALOME_CORBA_EXCEPTION( "Invalid ElementGeneration mode",SALOME::BAD_PARAM );
+
ASSERT(myBaseImpl);
- this->GetImpl()->SetElemGenTetraDominant(toElemGenTetraDominant);
- SMESH::TPythonDump() << _this() << ".SetElemGenTetraDominant( " << toElemGenTetraDominant << " )";
+ this->GetImpl()->SetElementGeneration(l);
+ SMESH::TPythonDump() << _this() << ".SetElementGeneration( " << level << " )";
}
//=======================================================================
-//function : GetElemGenTetraDominant
+//function : GetElementGeneration
//=======================================================================
-CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetElemGenTetraDominant()
+CORBA::Short HYBRIDPlugin_Hypothesis_i::GetElementGeneration()
{
ASSERT(myBaseImpl);
- return this->GetImpl()->GetElemGenTetraDominant();
+ return this->GetImpl()->GetElementGeneration();
}
//=======================================================================
*/
void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
CORBA::Short GetOptimizationLevel();
+ /*!
+ * Collision Mode: 0-decrease, 1-stop. Default is decrease
+ */
+ void SetCollisionMode(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
+ CORBA::Short GetCollisionMode();
/*!
* Path to working directory
*/
void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
CORBA::Boolean GetRemoveLogOnSuccess();
- void SetBoundaryLayersInward(CORBA::Boolean toBoundaryLayersInward);
- CORBA::Boolean GetBoundaryLayersInward();
+ void SetBoundaryLayersGrowth(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
+ CORBA::Short GetBoundaryLayersGrowth();
- void SetElemGenTetraDominant(CORBA::Boolean toElemGenTetraDominant);
- CORBA::Boolean GetElemGenTetraDominant();
+ void SetElementGeneration(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
+ CORBA::Short GetElementGeneration();
void SetAddMultinormals(CORBA::Boolean toAddMultinormals);
CORBA::Boolean GetAddMultinormals();