mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-25 03:22:04 +05:00
0020982: EDF 1547 SMESH: Creation of non-conformal quadratic pyramids
bool IsLinked (const SMDS_MeshNode* theNode1, const SMDS_MeshNode* theNode2, + const bool theIgnoreMediumNodes=false) const; // Return true if theNode1 is linked with theNode2. + // If theIgnoreMediumNodes then corner nodes of quadratic cell are considered linked as well
This commit is contained in:
parent
27c31e5d2a
commit
52e29b1d26
@ -520,7 +520,7 @@ bool SMDS_VolumeTool::Set (const SMDS_MeshElement* theVolume)
|
|||||||
GetFaceNormal( 0, botNormal.x, botNormal.y, botNormal.z );
|
GetFaceNormal( 0, botNormal.x, botNormal.y, botNormal.z );
|
||||||
const SMDS_MeshNode* botNode = myVolumeNodes[ 0 ];
|
const SMDS_MeshNode* botNode = myVolumeNodes[ 0 ];
|
||||||
int topNodeIndex = myVolume->NbCornerNodes() - 1;
|
int topNodeIndex = myVolume->NbCornerNodes() - 1;
|
||||||
while ( !IsLinked( 0, topNodeIndex )) --topNodeIndex;
|
while ( !IsLinked( 0, topNodeIndex, /*ignoreMediumNodes=*/true )) --topNodeIndex;
|
||||||
const SMDS_MeshNode* topNode = myVolumeNodes[ topNodeIndex ];
|
const SMDS_MeshNode* topNode = myVolumeNodes[ topNodeIndex ];
|
||||||
XYZ upDir (topNode->X() - botNode->X(),
|
XYZ upDir (topNode->X() - botNode->X(),
|
||||||
topNode->Y() - botNode->Y(),
|
topNode->Y() - botNode->Y(),
|
||||||
@ -1087,10 +1087,12 @@ int SMDS_VolumeTool::GetOppFaceIndex( int faceIndex ) const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsLinked
|
//function : IsLinked
|
||||||
//purpose : return true if theNode1 is linked with theNode2
|
//purpose : return true if theNode1 is linked with theNode2
|
||||||
|
// If theIgnoreMediumNodes then corner nodes of quadratic cell are considered linked as well
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1,
|
bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1,
|
||||||
const SMDS_MeshNode* theNode2) const
|
const SMDS_MeshNode* theNode2,
|
||||||
|
const bool theIgnoreMediumNodes) const
|
||||||
{
|
{
|
||||||
if ( !myVolume )
|
if ( !myVolume )
|
||||||
return false;
|
return false;
|
||||||
@ -1137,10 +1139,12 @@ bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1,
|
|||||||
//function : IsLinked
|
//function : IsLinked
|
||||||
//purpose : return true if the node with theNode1Index is linked
|
//purpose : return true if the node with theNode1Index is linked
|
||||||
// with the node with theNode2Index
|
// with the node with theNode2Index
|
||||||
|
// If theIgnoreMediumNodes then corner nodes of quadratic cell are considered linked as well
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
|
bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
|
||||||
const int theNode2Index) const
|
const int theNode2Index,
|
||||||
|
bool theIgnoreMediumNodes) const
|
||||||
{
|
{
|
||||||
if ( myVolume->IsPoly() ) {
|
if ( myVolume->IsPoly() ) {
|
||||||
return IsLinked(myVolumeNodes[theNode1Index], myVolumeNodes[theNode2Index]);
|
return IsLinked(myVolumeNodes[theNode1Index], myVolumeNodes[theNode2Index]);
|
||||||
@ -1152,7 +1156,20 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
|
|||||||
if ( minInd < 0 || maxInd > myVolumeNbNodes - 1 || maxInd == minInd )
|
if ( minInd < 0 || maxInd > myVolumeNbNodes - 1 || maxInd == minInd )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch ( myVolumeNbNodes ) {
|
int quadraticDivisor = 1;
|
||||||
|
if ( myVolume->IsQuadratic() )
|
||||||
|
{
|
||||||
|
int firstMediumInd = myVolume->NbCornerNodes();
|
||||||
|
if ( minInd >= firstMediumInd )
|
||||||
|
return false; // medium nodes are not linked
|
||||||
|
if ( maxInd < firstMediumInd ) // both nodes are corners
|
||||||
|
if ( theIgnoreMediumNodes )
|
||||||
|
quadraticDivisor = 2; // check linkage of corner nodes
|
||||||
|
else
|
||||||
|
return false; // corner nodes are not linked directly in a quadratic cell
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( myVolumeNbNodes / quadraticDivisor ) {
|
||||||
case 4:
|
case 4:
|
||||||
return true;
|
return true;
|
||||||
case 5:
|
case 5:
|
||||||
|
@ -102,13 +102,17 @@ class SMDS_EXPORT SMDS_VolumeTool
|
|||||||
// -----------------------
|
// -----------------------
|
||||||
|
|
||||||
bool IsLinked (const SMDS_MeshNode* theNode1,
|
bool IsLinked (const SMDS_MeshNode* theNode1,
|
||||||
const SMDS_MeshNode* theNode2) const;
|
const SMDS_MeshNode* theNode2,
|
||||||
|
const bool theIgnoreMediumNodes=false) const;
|
||||||
// Return true if theNode1 is linked with theNode2.
|
// Return true if theNode1 is linked with theNode2.
|
||||||
|
// If theIgnoreMediumNodes then corner nodes of quadratic cell are considered linked as well
|
||||||
|
|
||||||
bool IsLinked (const int theNode1Index,
|
bool IsLinked (const int theNode1Index,
|
||||||
const int theNode2Index) const;
|
const int theNode2Index,
|
||||||
|
bool theIgnoreMediumNodes=false) const;
|
||||||
// Return true if the node with theNode1Index is linked
|
// Return true if the node with theNode1Index is linked
|
||||||
// with the node with theNode2Index
|
// with the node with theNode2Index
|
||||||
|
// If theIgnoreMediumNodes then corner nodes of quadratic cell are considered linked as well
|
||||||
|
|
||||||
int GetNodeIndex(const SMDS_MeshNode* theNode) const;
|
int GetNodeIndex(const SMDS_MeshNode* theNode) const;
|
||||||
// Return an index of theNode
|
// Return an index of theNode
|
||||||
|
Loading…
x
Reference in New Issue
Block a user