Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#16648 [CEA] RadialQuadrangle algorithm hypothesis change requires a Clear Mesh Data...
[modules/smesh.git]
/
src
/
SMDS
/
SMDS_VolumeTool.cxx
diff --git
a/src/SMDS/SMDS_VolumeTool.cxx
b/src/SMDS/SMDS_VolumeTool.cxx
index f7857c3eb486e19b45656d8bcc51ad081bbeca1f..582af506b9b4cf1b5b4db29d7a5de2a45be8551b 100644
(file)
--- a/
src/SMDS/SMDS_VolumeTool.cxx
+++ b/
src/SMDS/SMDS_VolumeTool.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
9
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-32,10
+32,9
@@
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
-#include "SMDS_VtkVolume.hxx"
#include "SMDS_Mesh.hxx"
#include "SMDS_Mesh.hxx"
-#include
"utilities.h"
+#include
<utilities.h>
#include <map>
#include <limits>
#include <map>
#include <limits>
@@
-43,8
+42,6
@@
#include <numeric>
#include <algorithm>
#include <numeric>
#include <algorithm>
-using namespace std;
-
namespace
{
// ======================================================
namespace
{
// ======================================================
@@
-506,7
+503,7
@@
bool SMDS_VolumeTool::Set (const SMDS_MeshElement* theVolume,
myNbFaces = theVolume->NbFaces();
if ( myVolume->IsPoly() )
{
myNbFaces = theVolume->NbFaces();
if ( myVolume->IsPoly() )
{
- myPolyedre =
dynamic_cast<const SMDS_VtkVolume*
>( myVolume );
+ myPolyedre =
SMDS_Mesh::DownCast<SMDS_MeshVolume
>( myVolume );
myPolyFacetOri.resize( myNbFaces, 0 );
}
myPolyFacetOri.resize( myNbFaces, 0 );
}
@@
-522,10
+519,7
@@
bool SMDS_VolumeTool::Set (const SMDS_MeshElement* theVolume,
}
else
{
}
else
{
- int iNode = 0;
- SMDS_ElemIteratorPtr nodeIt = myVolume->nodesIterator();
- while ( nodeIt->more() )
- myVolumeNodes[ iNode++ ] = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
+ myVolumeNodes.assign( myVolume->begin_nodes(), myVolume->end_nodes() );
}
// check validity
}
// check validity
@@
-954,8
+948,8
@@
const int* SMDS_VolumeTool::GetFaceNodesIndices( int faceIndex ) const
//purpose : Return a set of face nodes.
//=======================================================================
//purpose : Return a set of face nodes.
//=======================================================================
-bool SMDS_VolumeTool::GetFaceNodes (int faceIndex,
- set<const SMDS_MeshNode*>& theFaceNodes ) const
+bool SMDS_VolumeTool::GetFaceNodes (int
faceIndex,
+ s
td::s
et<const SMDS_MeshNode*>& theFaceNodes ) const
{
if ( !setFace( faceIndex ))
return false;
{
if ( !setFace( faceIndex ))
return false;
@@
-1060,7
+1054,7
@@
bool SMDS_VolumeTool::IsFaceExternal( int faceIndex ) const
{
ori = ( -minProj < maxProj ? -1 : +1 );
double convexity = std::min( -minProj, maxProj ) / std::max( -minProj, maxProj );
{
ori = ( -minProj < maxProj ? -1 : +1 );
double convexity = std::min( -minProj, maxProj ) / std::max( -minProj, maxProj );
- convexity2face.insert( make_pair( convexity, iF * ori ));
+ convexity2face.insert(
std::
make_pair( convexity, iF * ori ));
}
}
if ( faceMostConvex < 0 ) // none facet has nodes on the same side
}
}
if ( faceMostConvex < 0 ) // none facet has nodes on the same side
@@
-1089,7
+1083,7
@@
bool SMDS_VolumeTool::IsFaceExternal( int faceIndex ) const
// compare orientation of links of the facet with myFwdLinks
ori = 0;
setFace( faceIndex );
// compare orientation of links of the facet with myFwdLinks
ori = 0;
setFace( faceIndex );
- vector< NLink > links( myCurFace.myNbNodes ), links2;
+
std::
vector< NLink > links( myCurFace.myNbNodes ), links2;
for ( int i = 0; i < myCurFace.myNbNodes && !ori; ++i )
{
NLink link( myCurFace.myNodes[i], myCurFace.myNodes[i+1] );
for ( int i = 0; i < myCurFace.myNbNodes && !ori; ++i )
{
NLink link( myCurFace.myNodes[i], myCurFace.myNodes[i+1] );
@@
-1210,7
+1204,7
@@
bool SMDS_VolumeTool::GetFaceNormal (int faceIndex, double & X, double & Y, doub
}
double size = cross.Magnitude();
}
double size = cross.Magnitude();
- if ( size <= numeric_limits<double>::min() )
+ if ( size <=
std::
numeric_limits<double>::min() )
return false;
X = cross.x / size;
return false;
X = cross.x / size;
@@
-1382,7
+1376,7
@@
bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1,
} else {
d2 = 0;
}
} else {
d2 = 0;
}
- vector<const SMDS_MeshNode*>::const_iterator i;
+
std::
vector<const SMDS_MeshNode*>::const_iterator i;
for (int iface = 0; iface < myNbFaces; iface++)
{
from = to;
for (int iface = 0; iface < myNbFaces; iface++)
{
from = to;
@@
-1429,8
+1423,8
@@
bool SMDS_VolumeTool::IsLinked (const int theNode1Index,
return IsLinked(myVolumeNodes[theNode1Index], myVolumeNodes[theNode2Index]);
}
return IsLinked(myVolumeNodes[theNode1Index], myVolumeNodes[theNode2Index]);
}
- int minInd = min( theNode1Index, theNode2Index );
- int maxInd = max( theNode1Index, theNode2Index );
+ int minInd =
std::
min( theNode1Index, theNode2Index );
+ int maxInd =
std::
max( theNode1Index, theNode2Index );
if ( minInd < 0 || maxInd > (int)myVolumeNodes.size() - 1 || maxInd == minInd )
return false;
if ( minInd < 0 || maxInd > (int)myVolumeNodes.size() - 1 || maxInd == minInd )
return false;
@@
-1565,7
+1559,7
@@
int SMDS_VolumeTool::GetNodeIndex(const SMDS_MeshNode* theNode) const
*/
//================================================================================
*/
//================================================================================
-int SMDS_VolumeTool::GetAllExistingFaces(vector<const SMDS_MeshElement*> & faces) const
+int SMDS_VolumeTool::GetAllExistingFaces(
std::
vector<const SMDS_MeshElement*> & faces) const
{
faces.clear();
SaveFacet savedFacet( myCurFace );
{
faces.clear();
SaveFacet savedFacet( myCurFace );
@@
-1606,7
+1600,7
@@
int SMDS_VolumeTool::GetAllExistingFaces(vector<const SMDS_MeshElement*> & faces
*/
//================================================================================
*/
//================================================================================
-int SMDS_VolumeTool::GetAllExistingEdges(vector<const SMDS_MeshElement*> & edges) const
+int SMDS_VolumeTool::GetAllExistingEdges(
std::
vector<const SMDS_MeshElement*> & edges) const
{
edges.clear();
edges.reserve( myVolumeNodes.size() * 2 );
{
edges.clear();
edges.reserve( myVolumeNodes.size() * 2 );
@@
-1683,7
+1677,7
@@
double SMDS_VolumeTool::MaxLinearSize2() const
//================================================================================
/*!
//================================================================================
/*!
- * \brief
fast check that only one volume is build
on the face nodes
+ * \brief
Fast quickly check that only one volume is built
on the face nodes
* This check is valid for conformal meshes only
*/
//================================================================================
* This check is valid for conformal meshes only
*/
//================================================================================
@@
-1717,7
+1711,7
@@
bool SMDS_VolumeTool::IsFreeFace( int faceIndex, const SMDS_MeshElement** otherV
// int nb = myCurFace.myNbNodes;
// if ( myVolume->GetEntityType() != vol->GetEntityType() )
// nb -= ( GetCenterNodeIndex(0) > 0 );
// int nb = myCurFace.myNbNodes;
// if ( myVolume->GetEntityType() != vol->GetEntityType() )
// nb -= ( GetCenterNodeIndex(0) > 0 );
- // set<const SMDS_MeshNode*> faceNodes( nodes, nodes + nb );
+ // s
td::s
et<const SMDS_MeshNode*> faceNodes( nodes, nodes + nb );
// if ( SMDS_VolumeTool( vol ).GetFaceIndex( faceNodes ) < 0 )
// continue;
// }
// if ( SMDS_VolumeTool( vol ).GetFaceIndex( faceNodes ) < 0 )
// continue;
// }
@@
-1731,7
+1725,7
@@
bool SMDS_VolumeTool::IsFreeFace( int faceIndex, const SMDS_MeshElement** otherV
//================================================================================
/*!
//================================================================================
/*!
- * \brief Thorough check that only one volume is buil
d
on the face nodes
+ * \brief Thorough check that only one volume is buil
t
on the face nodes
*/
//================================================================================
*/
//================================================================================
@@
-1747,7
+1741,7
@@
bool SMDS_VolumeTool::IsFreeFaceAdv( int faceIndex, const SMDS_MeshElement** oth
// evaluate nb of face nodes shared by other volumes
int maxNbShared = -1;
// evaluate nb of face nodes shared by other volumes
int maxNbShared = -1;
- typedef map< const SMDS_MeshElement*, int > TElemIntMap;
+ typedef
std::
map< const SMDS_MeshElement*, int > TElemIntMap;
TElemIntMap volNbShared;
TElemIntMap::iterator vNbIt;
for ( int iNode = 0; iNode < nbFaceNodes; iNode++ ) {
TElemIntMap volNbShared;
TElemIntMap::iterator vNbIt;
for ( int iNode = 0; iNode < nbFaceNodes; iNode++ ) {
@@
-1756,7
+1750,7
@@
bool SMDS_VolumeTool::IsFreeFaceAdv( int faceIndex, const SMDS_MeshElement** oth
while ( eIt->more() ) {
const SMDS_MeshElement* elem = eIt->next();
if ( elem != myVolume ) {
while ( eIt->more() ) {
const SMDS_MeshElement* elem = eIt->next();
if ( elem != myVolume ) {
- vNbIt = volNbShared.insert( make_pair( elem, 0 )).first;
+ vNbIt = volNbShared.insert(
std::
make_pair( elem, 0 )).first;
(*vNbIt).second++;
if ( vNbIt->second > maxNbShared )
maxNbShared = vNbIt->second;
(*vNbIt).second++;
if ( vNbIt->second > maxNbShared )
maxNbShared = vNbIt->second;
@@
-1855,7
+1849,7
@@
bool SMDS_VolumeTool::IsFreeFaceAdv( int faceIndex, const SMDS_MeshElement** oth
//purpose : Return index of a face formed by theFaceNodes
//=======================================================================
//purpose : Return index of a face formed by theFaceNodes
//=======================================================================
-int SMDS_VolumeTool::GetFaceIndex( const set<const SMDS_MeshNode*>& theFaceNodes,
+int SMDS_VolumeTool::GetFaceIndex( const s
td::s
et<const SMDS_MeshNode*>& theFaceNodes,
const int theFaceIndexHint ) const
{
if ( theFaceIndexHint >= 0 )
const int theFaceIndexHint ) const
{
if ( theFaceIndexHint >= 0 )
@@
-1898,12
+1892,12
@@
int SMDS_VolumeTool::GetFaceIndex( const set<const SMDS_MeshNode*>& theFaceNodes
//purpose : Return index of a face formed by theFaceNodes
//=======================================================================
//purpose : Return index of a face formed by theFaceNodes
//=======================================================================
-/*int SMDS_VolumeTool::GetFaceIndex( const set<int>& theFaceNodesIndices )
+/*int SMDS_VolumeTool::GetFaceIndex( const s
td::s
et<int>& theFaceNodesIndices )
{
for ( int iFace = 0; iFace < myNbFaces; iFace++ ) {
const int* nodes = GetFaceNodesIndices( iFace );
int nbFaceNodes = NbFaceNodes( iFace );
{
for ( int iFace = 0; iFace < myNbFaces; iFace++ ) {
const int* nodes = GetFaceNodesIndices( iFace );
int nbFaceNodes = NbFaceNodes( iFace );
- set<int> nodeSet;
+ s
td::s
et<int> nodeSet;
for ( int iNode = 0; iNode < nbFaceNodes; iNode++ )
nodeSet.insert( nodes[ iNode ] );
if ( theFaceNodesIndices == nodeSet )
for ( int iNode = 0; iNode < nbFaceNodes; iNode++ )
nodeSet.insert( nodes[ iNode ] );
if ( theFaceNodesIndices == nodeSet )
@@
-1932,7
+1926,7
@@
bool SMDS_VolumeTool::setFace( int faceIndex ) const
if (myVolume->IsPoly())
{
if (myVolume->IsPoly())
{
- if (
!myPolyedre
) {
+ if (
!myPolyedre
) {
MESSAGE("Warning: bad volumic element");
return false;
}
MESSAGE("Warning: bad volumic element");
return false;
}