0020944: EDF 1464 SMESH: detection of over-constrained elements

+    FT_OverConstrainedVolume,
+    FT_OverConstrainedFace,
+    class  OverConstrainedVolume: public Predicate
+    class  OverConstrainedFace: public Predicate
This commit is contained in:
eap 2010-11-19 16:47:06 +00:00
parent 1a692fd690
commit 022f918412
14 changed files with 220 additions and 56 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -33,6 +33,7 @@ Face quality controls:
<ul>
<li>\subpage free_faces_page "Free faces"</li>
<li>\subpage bare_border_faces_page "Bare border faces"</li>
<li>\subpage over_constrained_faces_page "Over-constrained faces"</li>
<li>\subpage length_2d_page "Length 2D"</li>
<li>\subpage borders_at_multi_connection_2d_page "Borders at multi-connection 2D"</li>
<li>\subpage area_page "Area"</li>
@ -50,6 +51,7 @@ Volume quality controls:
<li>\subpage volume_page "Volume"</li>
<li>\subpage max_element_length_3d_page "Max element length 3D"</li>
<li>\subpage bare_border_volumes_page "Bare border volumes"</li>
<li>\subpage over_constrained_volumes_page "Over-constrained volumes"</li>
</ul>
*/

View File

@ -0,0 +1,14 @@
/*!
\page over_constrained_faces_page Over-constrained faces
\n This mesh quality control highlights faces sharing only one of its borders with other faces.
\image html over_constrained_faces.png
In this picture the over-constrained face is displayed in red.
<br><b>See Also</b> a sample TUI Script of a
\ref tui_over_constrained_faces "Over-constrained faces" filter.
*/

View File

@ -0,0 +1,14 @@
/*!
\page over_constrained_volumes_page Over-constrained volumes
\n This mesh quality control highlights volumes sharing only one of its borders with other volumes.
\image html over_constrained_volumes.png
In this picture the over-constrained volume is displayed in red.
<br><b>See Also</b> a sample TUI Script of a
\ref tui_over_constrained_volumes "Over-constrained volumes" filter.
*/

View File

@ -149,6 +149,10 @@ one element of mesh only. See also a
<b>Faces with bare border</b> selects 2D mesh elements having a free border without an edge on it.
See also \ref bare_border_faces_page "Bare border faces quality control".
</li><li>
<b>Over-constrained faces</b> selects 2D mesh elements having only one border shared
with other 2D elements.
See also \ref over_constrained_faces_page "Over-constrained faces quality control".
</li><li>
<b>Borders at Multi-Connections 2D</b> selects cells consisting of edges belonging to
several elements of mesh. The number of mesh elements should be more, less or equal
(within a given <b>Tolerance</b>) to the predefined <b>Threshold Value</b>.
@ -185,6 +189,10 @@ diagonals with a value of length, which is more, less or equal
<b>Bad oriented volume</b> selects mesh volumes, which are incorrectly oriented from
the point of view of MED convention.
</li><li>
<b>Over-constrained volumes</b> selects mesh volumes having only one border shared
with other volumes.
See also \ref over_constrained_volumes_page "Over-constrained volumes quality control".
</li><li>
<b>Volumes with bare border</b> selects 3D mesh elements having a free border without a face on it.
See also \ref bare_border_volumes_page "Bare border volumes quality control".
</li>

View File

@ -357,6 +357,42 @@ bareGroup = mesh.MakeGroup("bare volumes", VOLUME, FT_BareBorderVolume)
assert(bareGroup.Size() == len( faceToRemove))
\endcode
\section tui_over_constrained_faces Over-constrained faces
\code
from smesh import *
SetCurrentStudy(salome.myStudy)
mesh = Mesh()
faceFilter = GetFilter(FACE,FT_OverConstrainedFace)
#make an edge
n1 = mesh.AddNode(0,0,0)
n2 = mesh.AddNode(10,0,0)
edge = mesh.AddEdge([n1,n2])
assert( not mesh.GetIdsFromFilter( faceFilter ))
# make faces
mesh.ExtrusionSweep([edge], MakeDirStruct(0,7,0), 5)
assert( 2 == len( mesh.GetIdsFromFilter( faceFilter )))
\endcode
\section tui_over_constrained_volumes Over-constrained volumes
\code
from smesh import *
SetCurrentStudy(salome.myStudy)
mesh = Mesh()
volumeFilter = GetFilter(VOLUME,FT_OverConstrainedVolume)
# make volumes by extrusion of one face
n1 = mesh.AddNode(0,0,0)
n2 = mesh.AddNode(10,0,0)
edge = mesh.AddEdge([n1,n2])
mesh.ExtrusionSweep([edge], MakeDirStruct(0,7,0), 1)
mesh.ExtrusionSweep( mesh.GetElementsByType(FACE), MakeDirStruct(0,0,5), 7)
assert( 2 == len( mesh.GetIdsFromFilter( volumeFilter )))
\endcode
\section tui_length_2d Length 2D
\code

View File

@ -66,6 +66,8 @@ module SMESH
FT_BadOrientedVolume,
FT_BareBorderVolume,
FT_BareBorderFace,
FT_OverConstrainedVolume,
FT_OverConstrainedFace,
FT_LinearOrQuadratic,
FT_GroupColor,
FT_ElemGeomType,
@ -168,7 +170,7 @@ module SMESH
interface BadOrientedVolume: Predicate {};
/*!
* Logical functor (predicate) "Volumes with bare border" and "Faces with bare border".
* Logical functor (predicate) "Volumes with bare border".
* Verify whether a mesh volume has a free facet without a mesh face on it
*/
interface BareBorderVolume: Predicate {};
@ -179,6 +181,17 @@ module SMESH
*/
interface BareBorderFace: Predicate {};
/*!
* Logical functor (predicate) "Over-constrained Volume"
* Verify whether a mesh volume has only one facet shared with other volumes
*/
interface OverConstrainedVolume: Predicate {};
/*!
* Logical functor (predicate) "Over-constrained Face".
* Verify whether a mesh face has only one border shared with other faces
*/
interface OverConstrainedFace: Predicate {};
/*!
* Logical functor (predicate) "Belong To Geometry".
* Verify whether mesh element or node belong to pointed Geom Object
@ -508,6 +521,8 @@ module SMESH
BadOrientedVolume CreateBadOrientedVolume();
BareBorderVolume CreateBareBorderVolume();
BareBorderFace CreateBareBorderFace();
OverConstrainedVolume CreateOverConstrainedVolume();
OverConstrainedFace CreateOverConstrainedFace();
LinearOrQuadratic CreateLinearOrQuadratic();
GroupColor CreateGroupColor();

View File

@ -1172,6 +1172,8 @@ void SMESHGUI_FilterTable::SetCriterion (const int theRow,
theCriterion.Type != SMESH::FT_BadOrientedVolume &&
theCriterion.Type != SMESH::FT_BareBorderFace &&
theCriterion.Type != SMESH::FT_BareBorderVolume &&
theCriterion.Type != SMESH::FT_OverConstrainedFace &&
theCriterion.Type != SMESH::FT_OverConstrainedVolume &&
theCriterion.Type != SMESH::FT_LinearOrQuadratic)
aTable->item( theRow, 2 )->setText(QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
else
@ -1332,7 +1334,9 @@ void SMESHGUI_FilterTable::updateAdditionalWidget()
aCriterion != SMESH::FT_FreeFaces &&
aCriterion != SMESH::FT_BadOrientedVolume &&
aCriterion != SMESH::FT_BareBorderFace &&
aCriterion != SMESH::FT_BareBorderVolume);
aCriterion != SMESH::FT_BareBorderVolume &&
aCriterion != SMESH::FT_OverConstrainedFace &&
aCriterion != SMESH::FT_OverConstrainedVolume);
if (!myAddWidgets.contains(anItem))
{
@ -1509,9 +1513,11 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
if (aType == SMESH::NODE && aCriterionType == SMESH::FT_FreeNodes ||
aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ||
aType == SMESH::FACE && (aCriterionType == SMESH::FT_BareBorderFace ||
aCriterionType == SMESH::FT_OverConstrainedFace ||
aCriterionType == SMESH::FT_FreeEdges ||
aCriterionType == SMESH::FT_FreeFaces) ||
aType == SMESH::VOLUME && (aCriterionType == SMESH::FT_BadOrientedVolume ||
aCriterionType == SMESH::FT_OverConstrainedVolume ||
aCriterionType == SMESH::FT_BareBorderVolume) ||
aCriterionType == SMESH::FT_LinearOrQuadratic ||
aCriterionType == SMESH::FT_GroupColor ||
@ -1796,6 +1802,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
aCriteria[ SMESH::FT_MultiConnection2D ] = tr("MULTI2D_BORDERS");
aCriteria[ SMESH::FT_FreeFaces ] = tr("FREE_FACES");
aCriteria[ SMESH::FT_BareBorderFace ] = tr("BARE_BORDER_FACE");
aCriteria[ SMESH::FT_OverConstrainedFace] = tr("OVER_CONSTRAINED_FACE");
aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
aCriteria[ SMESH::FT_ElemGeomType ] = tr("GEOM_TYPE");
@ -1807,17 +1814,18 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
static QMap<int, QString> aCriteria;
if (aCriteria.isEmpty())
{
aCriteria[ SMESH::FT_AspectRatio3D ] = tr("ASPECT_RATIO_3D");
aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME");
aCriteria[ SMESH::FT_BareBorderVolume ] = tr("BARE_BORDER_VOLUME");
aCriteria[ SMESH::FT_Volume3D ] = tr("VOLUME_3D");
aCriteria[ SMESH::FT_MaxElementLength3D ] = tr("MAX_ELEMENT_LENGTH_3D");
aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
aCriteria[ SMESH::FT_ElemGeomType ] = tr("GEOM_TYPE");
aCriteria[ SMESH::FT_AspectRatio3D ] = tr("ASPECT_RATIO_3D");
aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME");
aCriteria[ SMESH::FT_BareBorderVolume ] = tr("BARE_BORDER_VOLUME");
aCriteria[ SMESH::FT_OverConstrainedVolume] = tr("OVER_CONSTRAINED_VOLUME");
aCriteria[ SMESH::FT_Volume3D ] = tr("VOLUME_3D");
aCriteria[ SMESH::FT_MaxElementLength3D ] = tr("MAX_ELEMENT_LENGTH_3D");
aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
aCriteria[ SMESH::FT_ElemGeomType ] = tr("GEOM_TYPE");
}
return aCriteria;
}

View File

@ -465,6 +465,14 @@
<source>ICON_BARE_BORDER_FACE</source>
<translation>bare_border_face.png</translation>
</message>
<message>
<source>ICON_OVER_CONSTRAINED_VOLUME</source>
<translation>over_constrained_volume.png</translation>
</message>
<message>
<source>ICON_OVER_CONSTRAINED_FACE</source>
<translation>over_constrained_face.png</translation>
</message>
<message>
<source>ICON_WARP</source>
<translation>mesh_wrap.png</translation>

View File

@ -399,6 +399,14 @@
<source>MEN_BARE_BORDER_FACE</source>
<translation>Faces with bare border</translation>
</message>
<message>
<source>MEN_OVER_CONSTRAINED_VOLUME</source>
<translation>Over-constrained volumes</translation>
</message>
<message>
<source>MEN_OVER_CONSTRAINED_FACE</source>
<translation>Over-constrained faces</translation>
</message>
<message>
<source>MEN_FREE_BORDER</source>
<translation>Free Borders</translation>
@ -2440,6 +2448,14 @@ Consider saving your work before application crash</translation>
<source>STB_BARE_BORDER_FACE</source>
<translation>Faces with bare border</translation>
</message>
<message>
<source>STB_OVER_CONSTRAINED_VOLUME</source>
<translation>Over-constrained volumes</translation>
</message>
<message>
<source>STB_OVER_CONSTRAINED_FACE</source>
<translation>Over-constrained faces</translation>
</message>
<message>
<source>STB_FREE_BORDER</source>
<translation>Free Borders</translation>
@ -2984,6 +3000,14 @@ Consider saving your work before application crash</translation>
<source>TOP_BARE_BORDER_FACE</source>
<translation>Faces with bare border</translation>
</message>
<message>
<source>TOP_OVER_CONSTRAINED_VOLUME</source>
<translation>Over-constrained volumes</translation>
</message>
<message>
<source>TOP_OVER_CONSTRAINED_FACE</source>
<translation>Over-constrained faces</translation>
</message>
<message>
<source>TOP_FREE_BORDER</source>
<translation>Free Borders</translation>
@ -4331,6 +4355,14 @@ Please check input data and try again</translation>
<source>BARE_BORDER_FACE</source>
<translation>Faces with bare border</translation>
</message>
<message>
<source>OVER_CONSTRAINED_VOLUME</source>
<translation>Over-constrained volumes</translation>
</message>
<message>
<source>OVER_CONSTRAINED_FACE</source>
<translation>Over-constrained faces</translation>
</message>
<message>
<source>BELONG_TO_CYLINDER</source>
<translation>Belong to Cylinder</translation>

View File

@ -266,44 +266,46 @@ namespace SMESH
if ( theArg ) {
FunctorType aFunctorType = theArg->GetFunctorType();
switch(aFunctorType){
case FT_AspectRatio: myStream<< "anAspectRatio"; break;
case FT_AspectRatio3D: myStream<< "anAspectRatio3D"; break;
case FT_Warping: myStream<< "aWarping"; break;
case FT_MinimumAngle: myStream<< "aMinimumAngle"; break;
case FT_Taper: myStream<< "aTaper"; break;
case FT_Skew: myStream<< "aSkew"; break;
case FT_Area: myStream<< "aArea"; break;
case FT_Volume3D: myStream<< "aVolume3D"; break;
case FT_MaxElementLength2D:myStream<< "aMaxElementLength2D";break;
case FT_MaxElementLength3D:myStream<< "aMaxElementLength3D";break;
case FT_FreeBorders: myStream<< "aFreeBorders"; break;
case FT_FreeEdges: myStream<< "aFreeEdges"; break;
case FT_FreeNodes: myStream<< "aFreeNodes"; break;
case FT_FreeFaces: myStream<< "aFreeFaces"; break;
case FT_MultiConnection: myStream<< "aMultiConnection"; break;
case FT_MultiConnection2D:myStream<< "aMultiConnection2D";break;
case FT_Length: myStream<< "aLength"; break;
case FT_Length2D: myStream<< "aLength"; break;
case FT_BelongToGeom: myStream<< "aBelongToGeom"; break;
case FT_BelongToPlane: myStream<< "aBelongToPlane"; break;
case FT_BelongToCylinder: myStream<< "aBelongToCylinder"; break;
case FT_BelongToGenSurface:myStream<<"aBelongToGenSurface";break;
case FT_LyingOnGeom: myStream<< "aLyingOnGeom"; break;
case FT_RangeOfIds: myStream<< "aRangeOfIds"; break;
case FT_BadOrientedVolume:myStream<< "aBadOrientedVolume";break;
case FT_BareBorderVolume: myStream<< "aBareBorderVolume"; break;
case FT_BareBorderFace: myStream<< "aBareBorderFace"; break;
case FT_LinearOrQuadratic:myStream<< "aLinearOrQuadratic";break;
case FT_GroupColor: myStream<< "aGroupColor"; break;
case FT_ElemGeomType: myStream<< "anElemGeomType"; break;
case FT_LessThan: myStream<< "aLessThan"; break;
case FT_MoreThan: myStream<< "aMoreThan"; break;
case FT_EqualTo: myStream<< "anEqualTo"; break;
case FT_LogicalNOT: myStream<< "aLogicalNOT"; break;
case FT_LogicalAND: myStream<< "aLogicalAND"; break;
case FT_LogicalOR: myStream<< "aLogicalOR"; break;
case FT_AspectRatio: myStream<< "anAspectRatio"; break;
case FT_AspectRatio3D: myStream<< "anAspectRatio3D"; break;
case FT_Warping: myStream<< "aWarping"; break;
case FT_MinimumAngle: myStream<< "aMinimumAngle"; break;
case FT_Taper: myStream<< "aTaper"; break;
case FT_Skew: myStream<< "aSkew"; break;
case FT_Area: myStream<< "aArea"; break;
case FT_Volume3D: myStream<< "aVolume3D"; break;
case FT_MaxElementLength2D: myStream<< "aMaxElementLength2D"; break;
case FT_MaxElementLength3D: myStream<< "aMaxElementLength3D"; break;
case FT_FreeBorders: myStream<< "aFreeBorders"; break;
case FT_FreeEdges: myStream<< "aFreeEdges"; break;
case FT_FreeNodes: myStream<< "aFreeNodes"; break;
case FT_FreeFaces: myStream<< "aFreeFaces"; break;
case FT_MultiConnection: myStream<< "aMultiConnection"; break;
case FT_MultiConnection2D: myStream<< "aMultiConnection2D"; break;
case FT_Length: myStream<< "aLength"; break;
case FT_Length2D: myStream<< "aLength"; break;
case FT_BelongToGeom: myStream<< "aBelongToGeom"; break;
case FT_BelongToPlane: myStream<< "aBelongToPlane"; break;
case FT_BelongToCylinder: myStream<< "aBelongToCylinder"; break;
case FT_BelongToGenSurface: myStream<<"aBelongToGenSurface"; break;
case FT_LyingOnGeom: myStream<< "aLyingOnGeom"; break;
case FT_RangeOfIds: myStream<< "aRangeOfIds"; break;
case FT_BadOrientedVolume: myStream<< "aBadOrientedVolume"; break;
case FT_BareBorderVolume: myStream<< "aBareBorderVolume"; break;
case FT_BareBorderFace: myStream<< "aBareBorderFace"; break;
case FT_OverConstrainedVolume: myStream<< "aOverConstrainedVolume"; break;
case FT_OverConstrainedFace: myStream<< "aOverConstrainedFace"; break;
case FT_LinearOrQuadratic: myStream<< "aLinearOrQuadratic"; break;
case FT_GroupColor: myStream<< "aGroupColor"; break;
case FT_ElemGeomType: myStream<< "anElemGeomType"; break;
case FT_LessThan: myStream<< "aLessThan"; break;
case FT_MoreThan: myStream<< "aMoreThan"; break;
case FT_EqualTo: myStream<< "anEqualTo"; break;
case FT_LogicalNOT: myStream<< "aLogicalNOT"; break;
case FT_LogicalAND: myStream<< "aLogicalAND"; break;
case FT_LogicalOR: myStream<< "aLogicalOR"; break;
case FT_Undefined:
default: myStream<< "anUndefined"; break;
default: myStream<< "anUndefined"; break;
}
myStream<<theArg;
}

View File

@ -392,8 +392,7 @@ namespace SMESH
/*
Class : BareBorderVolume_i
Description : Verify whether a mesh volume is incorrectly oriented from
the point of view of MED convention
Description : Verify whether a mesh volume has a free facet without a face on it
*/
class SMESH_I_EXPORT BareBorderVolume_i: public virtual POA_SMESH::BareBorderVolume,
public virtual Predicate_i
@ -405,8 +404,7 @@ namespace SMESH
/*
Class : BareBorderFace_i
Description : Verify whether a mesh volume is incorrectly oriented from
the point of view of MED convention
Description : Verify whether a mesh face has a free border without an edge on it
*/
class SMESH_I_EXPORT BareBorderFace_i: public virtual POA_SMESH::BareBorderFace,
public virtual Predicate_i
@ -416,6 +414,30 @@ namespace SMESH
FunctorType GetFunctorType();
};
/*
Class : OverConstrainedVolume_i
Description : Verify whether a mesh volume has only one facet shared with other volumes
*/
class SMESH_I_EXPORT OverConstrainedVolume_i: public virtual POA_SMESH::OverConstrainedVolume,
public virtual Predicate_i
{
public:
OverConstrainedVolume_i();
FunctorType GetFunctorType();
};
/*
Class : OverConstrainedFace_i
Description : Verify whether a mesh face has only one border shared with other faces
*/
class SMESH_I_EXPORT OverConstrainedFace_i: public virtual POA_SMESH::OverConstrainedFace,
public virtual Predicate_i
{
public:
OverConstrainedFace_i();
FunctorType GetFunctorType();
};
/*
Class : BelongToGeom_i
Description : Predicate for selection on geometrical support
@ -966,6 +988,8 @@ namespace SMESH
BadOrientedVolume_ptr CreateBadOrientedVolume();
BareBorderFace_ptr CreateBareBorderFace();
BareBorderVolume_ptr CreateBareBorderVolume();
OverConstrainedFace_ptr CreateOverConstrainedFace();
OverConstrainedVolume_ptr CreateOverConstrainedVolume();
LinearOrQuadratic_ptr CreateLinearOrQuadratic();
GroupColor_ptr CreateGroupColor();

View File

@ -795,7 +795,8 @@ class smeshDC(SMESH._objref_SMESH_Gen):
pass
elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_BadOrientedVolume, FT_FreeNodes,
FT_FreeFaces, FT_LinearOrQuadratic,
FT_BareBorderFace, FT_BareBorderVolume]:
FT_BareBorderFace, FT_BareBorderVolume,
FT_OverConstrainedFace, FT_OverConstrainedVolume]:
# At this point the treshold is unnecessary
if aTreshold == FT_LogicalNOT:
aCriterion.UnaryOp = self.EnumToLong(FT_LogicalNOT)
@ -3168,7 +3169,7 @@ class Mesh:
## Generates new elements by extrusion of the elements with given ids
# @param IDsOfElements the list of elements ids for extrusion
# @param StepVector vector, defining the direction and value of extrusion
# @param StepVector vector or DirStruct, defining the direction and value of extrusion
# @param NbOfSteps the number of steps
# @param MakeGroups forces the generation of new groups from existing ones
# @return the list of created groups (SMESH_GroupBase) if MakeGroups=True, empty list otherwise