# Specific to HYBRIDPLUGIN:
SET(SALOME_HYBRIDPLUGIN_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/hybridplugin" CACHE PATH
"Install path: SALOME HYBRIDPLUGIN specific data")
+SET(SALOME_HYBRIDPLUGIN_INSTALL_TESTS ${SALOME_INSTALL_BINS})
MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
IF(SALOME_BUILD_DOC)
ADD_SUBDIRECTORY(doc)
ENDIF(SALOME_BUILD_DOC)
+IF(SALOME_BUILD_TESTS)
+ ADD_SUBDIRECTORY(tests)
+ENDIF(SALOME_BUILD_TESTS)
# Header configuration
# ====================
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
+ * ElementGeneration: 0-Generation_Tetra_Dominant, 1-Generation_Hexa_Dominant, 2-Generation_Cartesian_Core. Default is Generation_Tetra_Dominant
*/
void SetElementGeneration(in short level) raises (SALOME::SALOME_Exception);
short GetElementGeneration();
*/
void SetBoundaryLayersProgression(in double BLP) raises (SALOME::SALOME_Exception);
double GetBoundaryLayersProgression();
+ /*!
+ * To set core size.
+ * Default is 0.0
+ */
+ void SetCoreSize(in double CS) raises (SALOME::SALOME_Exception);
+ double GetCoreSize();
/*!
* To set multinormals angle threshold at opening ridges.
* Default is 30.0
aStdLayout->addWidget( myElementGenerationCombo, row++, 1, 1, 1 );
QStringList typesElementGeneration;
- typesElementGeneration << tr( "HYBRID_GENERATION_TETRA_DOMINANT" ) << tr( "HYBRID_GENERATION_HEXA_DOMINANT" );
+ typesElementGeneration << tr( "HYBRID_GENERATION_TETRA_DOMINANT" ) << tr( "HYBRID_GENERATION_HEXA_DOMINANT" ) << tr( "HYBRID_GENERATION_CARTESIAN_CORE" );
myElementGenerationCombo->addItems( typesElementGeneration );
+ aStdLayout->addWidget( new QLabel( tr( "HYBRID_CORE_SIZE" ), myStdGroup ), row, 0, 1, 1 );
+ myCoreSizeSpin = new SMESHGUI_SpinBox( myStdGroup );
+ myCoreSizeSpin->RangeStepAndValidator(0., COORD_MAX, 10., "length_precision");
+ aStdLayout->addWidget( myCoreSizeSpin, row++, 1, 1, 1 );
+
myAddMultinormalsCheck = new QCheckBox( tr( "HYBRID_ADD_MULTINORMALS" ), myStdGroup );
aStdLayout->addWidget( myAddMultinormalsCheck, row++, 0, 1, 1 );
myHeightFirstLayerSpin -> setValue( data.myHeightFirstLayer );
myNbOfBoundaryLayersSpin -> setValue( data.myNbOfBoundaryLayers );
myBoundaryLayersProgressionSpin -> setValue( data.myBoundaryLayersProgression );
+ if (data.myCoreSize <= 0)
+ myCoreSizeSpin->setText("");
+ else
+ myCoreSizeSpin -> setValue( data.myCoreSize );
myMultinormalsAngleSpin -> setValue( data.myMultinormalsAngle );
myFaceSelector ->SetListOfIDs( data.myFaceWLIds );
h_data.mySmoothNormals = h->GetSmoothNormals();
h_data.myHeightFirstLayer = h->GetHeightFirstLayer();
h_data.myBoundaryLayersProgression = h->GetBoundaryLayersProgression();
+ h_data.myCoreSize = h->GetCoreSize();
h_data.myMultinormalsAngle = h->GetMultinormalsAngle();
h_data.myNbOfBoundaryLayers = h->GetNbOfBoundaryLayers();
h_data.myFaceWLIds = h->GetFacesWithLayers();
h->SetHeightFirstLayer ( h_data.myHeightFirstLayer );
if ( h->GetBoundaryLayersProgression() != h_data.myBoundaryLayersProgression )
h->SetBoundaryLayersProgression ( h_data.myBoundaryLayersProgression );
+ if ( h->GetCoreSize() != h_data.myCoreSize )
+ h->SetCoreSize ( h_data.myCoreSize );
if ( h->GetMultinormalsAngle() != h_data.myMultinormalsAngle )
h->SetMultinormalsAngle ( h_data.myMultinormalsAngle );
if ( h->GetNbOfBoundaryLayers() != h_data.myNbOfBoundaryLayers )
h_data.myHeightFirstLayer = myHeightFirstLayerSpin -> value();
h_data.myNbOfBoundaryLayers = myNbOfBoundaryLayersSpin -> value();
h_data.myBoundaryLayersProgression = myBoundaryLayersProgressionSpin -> value();
+ h_data.myCoreSize = myCoreSizeSpin->text().isEmpty() ? 0.0 : myCoreSizeSpin -> value();
h_data.myMultinormalsAngle = myMultinormalsAngleSpin -> value();
h_data.myFaceWLIds = myFaceSelector->GetListOfIDs();
mySmoothNormals;
double myHeightFirstLayer,
myBoundaryLayersProgression,
+ myCoreSize,
myMultinormalsAngle;
short myNbOfBoundaryLayers;
SMESH::long_array_var myFaceWLIds;
SMESHGUI_SpinBox* myHeightFirstLayerSpin;
QSpinBox* myNbOfBoundaryLayersSpin;
SMESHGUI_SpinBox* myBoundaryLayersProgressionSpin;
+ SMESHGUI_SpinBox* myCoreSizeSpin;
SMESHGUI_SpinBox* myMultinormalsAngleSpin;
QCheckBox* mySmoothNormalsCheck;
<source>HYBRID_GENERATION_HEXA_DOMINANT</source>
<translation>Hexahedra dominant</translation>
</message>
+ <message>
+ <source>HYBRID_GENERATION_CARTESIAN_CORE</source>
+ <translation>Cartesian core</translation>
+ </message>
+ <message>
+ <source>HYBRID_CORE_SIZE</source>
+ <translation>Core elements size (cartesian core only)</translation>
+ </message>
<message>
<source>HYBRID_ADD_MULTINORMALS</source>
<translation>Add extra normals at opening ridges and corners</translation>
<source>HYBRID_GENERATION_HEXA_DOMINANT</source>
<translation>Dominance d'hexaèdres</translation>
</message>
+ <message>
+ <source>HYBRID_GENERATION_CARTESIAN_CORE</source>
+ <translation>Cœur cartésien</translation>
+ </message>
+ <message>
+ <source>HYBRID_CORE_SIZE</source>
+ <translation>Taille des éléments du cœur (cœur cartésien uniquement)</translation>
+ </message>
<message>
<source>HYBRID_ADD_MULTINORMALS</source>
<translation>Ajout d'extra normales extérieures aux arêtes et coins</translation>
<source>HYBRID_GENERATION_HEXA_DOMINANT</source>
<translation>主に六面体</translation>
</message>
+ <message>
+ <source>HYBRID_GENERATION_CARTESIAN_CORE</source>
+ <translation type="unfinished">Cartesian core</translation>
+ </message>
+ <message>
+ <source>HYBRID_CORE_SIZE</source>
+ <translation type="unfinished">Core elements size (cartesian core only)</translation>
+ </message>
<message>
<source>HYBRID_ADD_MULTINORMALS</source>
<translation>開いたリッジと角に別の法線を追加</translation>
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
+Generation_Tetra_Dominant, Generation_Hexa_Dominant, Generation_Cartesian_Core = 0,1,2
#----------------------------
# Mesh algo type identifiers
# @param mode, one of the following values
# - Generation_Tetra_Dominant
# - Generation_Hexa_Dominant
+ # - Generation_Cartesian_Core
# .
# Default is Generation_Tetra_Dominant
def SetElementGeneration(self, mode):
self.Parameters().SetBoundaryLayersProgression(boundaryLayersProgression)
pass
+ ## Set core elements size.
+ # Default is 0.0
+ # @param CoreSize double value
+ def SetCoreSize(self, CoreSize):
+ self.Parameters().SetCoreSize(CoreSize)
+ pass
+
## To set multinormals angle threshold at opening ridges.
# Default is 30.0
# @param multinormalsAngle double value
mySmoothNormals(DefaultSmoothNormals()),
myHeightFirstLayer(DefaultHeightFirstLayer()),
myBoundaryLayersProgression(DefaultBoundaryLayersProgression()),
+ myCoreSize(DefaultCoreSize()),
myMultinormalsAngle(DefaultMultinormalsAngle()),
myNbOfBoundaryLayers(DefaultNbOfBoundaryLayers()),
_enfVertexList(DefaultHYBRIDEnforcedVertexList()),
return myBoundaryLayersProgression;
}
+//=======================================================================
+//function : SetCoreSize
+//=======================================================================
+
+void HYBRIDPlugin_Hypothesis::SetCoreSize(double toCoreSize)
+{
+ if ( myCoreSize != toCoreSize ) {
+ myCoreSize = toCoreSize;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=======================================================================
+//function : GetCoreSize
+//=======================================================================
+
+double HYBRIDPlugin_Hypothesis::GetCoreSize() const
+{
+ return myCoreSize;
+}
+
//=======================================================================
//function : SetMultinormalsAngle
//=======================================================================
}
//=======================================================================
-//function : GetMultinormalsAngle
+//function : GetCoreSize
//=======================================================================
short HYBRIDPlugin_Hypothesis::GetNbOfBoundaryLayers() const
return 1.0;
}
+//=======================================================================
+//function : DefaultCoreSize
+//=======================================================================
+double HYBRIDPlugin_Hypothesis::DefaultCoreSize()
+{
+ return 0.0;
+}
+
//=======================================================================
//function : DefaultMultinormalsAngle
//=======================================================================
save << (int) myKeepFiles << " ";
save << myWorkingDirectory << " ";
save << myVerboseLevel << " ";
+ save << myCoreSize << " ";
+
if (!myTextOption.empty()) {
save << "__OPTIONS_BEGIN__ ";
save << myTextOption << " ";
else
load.clear(ios::badbit | load.rdstate());
+ isOK = static_cast<bool>(load >> d);
+ if (isOK)
+ myCoreSize = d;
+ else
+ load.clear(ios::badbit | load.rdstate());
std::string separator;
bool hasOptions = false;
bool p_eg = ( hyp && hyp->myTextOption.find("--element_generation ") != std::string::npos );
bool p_cm = ( hyp && hyp->myTextOption.find("--collision_mode ") != std::string::npos );
bool p_am = ( hyp && hyp->myTextOption.find("--add_multinormals ") != std::string::npos );
+ bool p_cs = ( hyp && hyp->myTextOption.find("--global_physical_size ") != std::string::npos );
bool p_mat = ( hyp && hyp->myTextOption.find("--multinormal_angle_threshold ") != std::string::npos );
bool p_sn = ( hyp && hyp->myTextOption.find("--smooth_normals ") != std::string::npos );
//missing options :
- //- global_physical_size
- //- boundary_layer_size_mode
- //- boundary_layer_initial_height_on_surface_tags
//- boundary_layer_max_element_angle
bool nolayers = false;
}
if ( !p_eg && hyp ) {
- if ( hyp->myElementGeneration >= 0 && hyp->myElementGeneration <= 1 ) {
- const char* value[] = { "tetra-dominant" , "hexa-dominant" };
+ if ( hyp->myElementGeneration >= 0 && hyp->myElementGeneration <= 2 ) {
+ const char* value[] = { "tetra-dominant" , "hexa-dominant", "cartesian_core" };
cmd << " --element_generation " << value[ hyp->myElementGeneration ];
}
}
-
+
+ if ( !p_cs && hyp ) {
+ if ( hyp->myCoreSize >= 0 ) {
+ cmd << " --global_physical_size " << hyp->myCoreSize;
+ }
+ }
+
if ( !p_cm && hyp ) {
if ( hyp->myCollisionMode >= 0 && hyp->myCollisionMode <= 1 ) {
const char* value[] = { "decrease" , "stop" };
void SetBoundaryLayersGrowth(BoundaryLayersGrowth level);
BoundaryLayersGrowth GetBoundaryLayersGrowth() const;
/*!
- * ElementGeneration: 0-Generation_Tetra_Dominant, 1-Generation_Hexa_Dominant. Default is Generation_Tetra_Dominant
+ * ElementGeneration: 0-Generation_Tetra_Dominant, 1-Generation_Hexa_Dominant, 2-Generation_Cartesian_Core. Default is Generation_Tetra_Dominant
*/
- enum ElementGeneration { Generation_Tetra_Dominant = 0, Generation_Hexa_Dominant };
+ enum ElementGeneration { Generation_Tetra_Dominant = 0, Generation_Hexa_Dominant, Generation_Cartesian_Core };
void SetElementGeneration(ElementGeneration level);
ElementGeneration GetElementGeneration() const;
/*!
*/
void SetBoundaryLayersProgression(double BLP);
double GetBoundaryLayersProgression() const;
+ /*!
+ * Set core elements size.
+ * Default is 0.0
+ */
+ void SetCoreSize(double CS);
+ double GetCoreSize() const;
/*!
* To set multinormals angle threshold at opening ridges.
* Default is 30.0
static short DefaultNbOfBoundaryLayers();
static double DefaultHeightFirstLayer();
static double DefaultBoundaryLayersProgression();
+ static double DefaultCoreSize();
static double DefaultMultinormalsAngle();
static THYBRIDEnforcedVertex DefaultHYBRIDEnforcedVertex() {return THYBRIDEnforcedVertex();}
bool mySmoothNormals;
double myHeightFirstLayer;
double myBoundaryLayersProgression;
+ double myCoreSize;
double myMultinormalsAngle;
short myNbOfBoundaryLayers;
::HYBRIDPlugin_Hypothesis::ElementGeneration l =
(::HYBRIDPlugin_Hypothesis::ElementGeneration) level;
if ( l < ::HYBRIDPlugin_Hypothesis::Generation_Tetra_Dominant ||
- l > ::HYBRIDPlugin_Hypothesis::Generation_Hexa_Dominant )
+ l > ::HYBRIDPlugin_Hypothesis::Generation_Cartesian_Core )
THROW_SALOME_CORBA_EXCEPTION( "Invalid ElementGeneration mode",SALOME::BAD_PARAM );
ASSERT(myBaseImpl);
return this->GetImpl()->GetBoundaryLayersProgression();
}
+//=======================================================================
+//function : SetCoreSize
+//=======================================================================
+void HYBRIDPlugin_Hypothesis_i::SetCoreSize(CORBA::Double toCoreSize)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetCoreSize(toCoreSize);
+ SMESH::TPythonDump() << _this() << ".SetCoreSize( " << toCoreSize << " )";
+}
+
+//=======================================================================
+//function : GetCoreSize
+//=======================================================================
+CORBA::Double HYBRIDPlugin_Hypothesis_i::GetCoreSize()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetCoreSize();
+}
+
//=======================================================================
//function : SetMultinormalsAngle
//=======================================================================
void SetBoundaryLayersProgression(CORBA::Double toBoundaryLayersProgression);
CORBA::Double GetBoundaryLayersProgression();
+ void SetCoreSize(CORBA::Double toCoreSize);
+ CORBA::Double GetCoreSize();
+
void SetMultinormalsAngle(CORBA::Double toMultinormalsAngle);
CORBA::Double GetMultinormalsAngle();