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
blocFissure: rename the med file produced in accordance with the case name
[modules/smesh.git]
/
src
/
SMESH
/
SMESH_MesherHelper.cxx
diff --git
a/src/SMESH/SMESH_MesherHelper.cxx
b/src/SMESH/SMESH_MesherHelper.cxx
index 3ceea9fa34ca191c0b8aed017df5ff22f2b41a06..3877d8a7bf9f90a51a631cabc7b59224616be80e 100644
(file)
--- a/
src/SMESH/SMESH_MesherHelper.cxx
+++ b/
src/SMESH/SMESH_MesherHelper.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
5
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
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
@@
-139,7
+139,7
@@
bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh)
SMDSAbs_ElementType elemType( subType==TopAbs_FACE ? SMDSAbs_Face : SMDSAbs_Edge );
SMDSAbs_ElementType elemType( subType==TopAbs_FACE ? SMDSAbs_Face : SMDSAbs_Edge );
- int nbOldLinks = myTLinkNodeMap.size();
+
//
int nbOldLinks = myTLinkNodeMap.size();
if ( !myMesh->HasShapeToMesh() )
{
if ( !myMesh->HasShapeToMesh() )
{
@@
-2070,7
+2070,7
@@
SMDS_MeshFace* SMESH_MesherHelper::AddPolygonalFace (const vector<const SMDS_Mes
{
vector<const SMDS_MeshNode*> newNodes( nodes.size() * 2 );
newNodes = nodes;
{
vector<const SMDS_MeshNode*> newNodes( nodes.size() * 2 );
newNodes = nodes;
- for (
in
t i = 0; i < nodes.size(); ++i )
+ for (
size_
t i = 0; i < nodes.size(); ++i )
{
const SMDS_MeshNode* n1 = nodes[i];
const SMDS_MeshNode* n2 = nodes[(i+1)%nodes.size()];
{
const SMDS_MeshNode* n1 = nodes[i];
const SMDS_MeshNode* n2 = nodes[(i+1)%nodes.size()];
@@
-2393,7
+2393,7
@@
SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>
{
vector<const SMDS_MeshNode*> newNodes;
vector<int> newQuantities;
{
vector<const SMDS_MeshNode*> newNodes;
vector<int> newQuantities;
- for (
int iFace=0, iN=0; iFace < quantities.size(); ++iFace
)
+ for (
size_t iFace = 0, iN = 0; iFace < quantities.size(); ++iFace
)
{
int nbNodesInFace = quantities[iFace];
newQuantities.push_back(0);
{
int nbNodesInFace = quantities[iFace];
newQuantities.push_back(0);
@@
-2402,10
+2402,10
@@
SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>
const SMDS_MeshNode* n1 = nodes[ iN + i ];
newNodes.push_back( n1 );
newQuantities.back()++;
const SMDS_MeshNode* n1 = nodes[ iN + i ];
newNodes.push_back( n1 );
newQuantities.back()++;
-
+
const SMDS_MeshNode* n2 = nodes[ iN + ( i+1==nbNodesInFace ? 0 : i+1 )];
const SMDS_MeshNode* n2 = nodes[ iN + ( i+1==nbNodesInFace ? 0 : i+1 )];
-
//
if ( n1->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE &&
-
//
n2->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE )
+
//
if ( n1->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE &&
+
//
n2->GetPosition()->GetTypeOfPosition() != SMDS_TOP_3DSPACE )
{
const SMDS_MeshNode* n12 = GetMediumNode( n1, n2, force3d, TopAbs_SOLID );
newNodes.push_back( n12 );
{
const SMDS_MeshNode* n12 = GetMediumNode( n1, n2, force3d, TopAbs_SOLID );
newNodes.push_back( n12 );
@@
-2606,8
+2606,8
@@
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2
}
// nb rows of nodes
}
// nb rows of nodes
-
in
t prevNbRows = theParam2ColumnMap.begin()->second.size(); // current, at least 1 here
-
int expected
NbRows = faceSubMesh->NbElements() / ( theParam2ColumnMap.size()-1 ); // to be added
+
size_
t prevNbRows = theParam2ColumnMap.begin()->second.size(); // current, at least 1 here
+
size_t expect
NbRows = faceSubMesh->NbElements() / ( theParam2ColumnMap.size()-1 ); // to be added
// fill theParam2ColumnMap column by column by passing from nodes on
// theBaseEdge up via mesh faces on theFace
// fill theParam2ColumnMap column by column by passing from nodes on
// theBaseEdge up via mesh faces on theFace
@@
-2620,10
+2620,10
@@
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2
{
vector<const SMDS_MeshNode*>& nCol1 = par_nVec_1->second;
vector<const SMDS_MeshNode*>& nCol2 = par_nVec_2->second;
{
vector<const SMDS_MeshNode*>& nCol1 = par_nVec_1->second;
vector<const SMDS_MeshNode*>& nCol2 = par_nVec_2->second;
- nCol1.resize( prevNbRows + expect
ed
NbRows );
- nCol2.resize( prevNbRows + expect
ed
NbRows );
+ nCol1.resize( prevNbRows + expectNbRows );
+ nCol2.resize( prevNbRows + expectNbRows );
- int i1, i2
,
foundNbRows = 0;
+ int i1, i2
; size_t
foundNbRows = 0;
const SMDS_MeshNode *n1 = nCol1[ prevNbRows-1 ];
const SMDS_MeshNode *n2 = nCol2[ prevNbRows-1 ];
// find face sharing node n1 and n2 and belonging to faceSubMesh
const SMDS_MeshNode *n1 = nCol1[ prevNbRows-1 ];
const SMDS_MeshNode *n2 = nCol2[ prevNbRows-1 ];
// find face sharing node n1 and n2 and belonging to faceSubMesh
@@
-2635,7
+2635,7
@@
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2
int nbNodes = face->NbCornerNodes();
if ( nbNodes != 4 )
return false;
int nbNodes = face->NbCornerNodes();
if ( nbNodes != 4 )
return false;
- if ( foundNbRows + 1 > expect
ed
NbRows )
+ if ( foundNbRows + 1 > expectNbRows )
return false;
n1 = face->GetNode( (i2+2) % 4 ); // opposite corner of quadrangle face
n2 = face->GetNode( (i1+2) % 4 );
return false;
n1 = face->GetNode( (i2+2) % 4 ); // opposite corner of quadrangle face
n2 = face->GetNode( (i1+2) % 4 );
@@
-2645,12
+2645,12
@@
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2
}
avoidSet.insert( face );
}
}
avoidSet.insert( face );
}
- if (
foundNbRows != expected
NbRows )
+ if (
(size_t) foundNbRows != expect
NbRows )
return false;
avoidSet.clear();
}
return ( theParam2ColumnMap.size() > 1 &&
return false;
avoidSet.clear();
}
return ( theParam2ColumnMap.size() > 1 &&
- theParam2ColumnMap.begin()->second.size() == prevNbRows + expect
ed
NbRows );
+ theParam2ColumnMap.begin()->second.size() == prevNbRows + expectNbRows );
}
namespace
}
namespace
@@
-2904,6
+2904,10
@@
bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
bool ok = true;
double u0 = GetNodeU( TopoDS::Edge( E ), nn[0], nn[1], &ok );
double u1 = GetNodeU( TopoDS::Edge( E ), nn[1], nn[0], &ok );
bool ok = true;
double u0 = GetNodeU( TopoDS::Edge( E ), nn[0], nn[1], &ok );
double u1 = GetNodeU( TopoDS::Edge( E ), nn[1], nn[0], &ok );
+ // check that the 2 nodes are connected with a segment (IPAL53055)
+ if ( SMESHDS_SubMesh* sm = GetMeshDS()->MeshElements( E ))
+ if ( sm->NbElements() > 0 && !GetMeshDS()->FindEdge( nn[0], nn[1] ))
+ ok = false;
if ( ok )
{
isReversed = ( u0 > u1 );
if ( ok )
{
isReversed = ( u0 > u1 );
@@
-3553,11
+3557,11
@@
namespace { // Structures used by FixQuadraticElements()
int NbVolumes() const { return !_volumes[0] ? 0 : !_volumes[1] ? 1 : 2; }
void AddSelfToLinks() const {
int NbVolumes() const { return !_volumes[0] ? 0 : !_volumes[1] ? 1 : 2; }
void AddSelfToLinks() const {
- for (
in
t i = 0; i < _sides.size(); ++i )
+ for (
size_
t i = 0; i < _sides.size(); ++i )
_sides[i]->_faces.push_back( this );
}
int LinkIndex( const QLink* side ) const {
_sides[i]->_faces.push_back( this );
}
int LinkIndex( const QLink* side ) const {
- for (
int i=
0; i<_sides.size(); ++i ) if ( _sides[i] == side ) return i;
+ for (
size_t i =
0; i<_sides.size(); ++i ) if ( _sides[i] == side ) return i;
return -1;
}
bool GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& err) const;
return -1;
}
bool GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& err) const;
@@
-3589,7
+3593,7
@@
namespace { // Structures used by FixQuadraticElements()
const SMDS_MeshNode* nodeToContain) const;
const SMDS_MeshNode* GetNodeInFace() const {
const SMDS_MeshNode* nodeToContain) const;
const SMDS_MeshNode* GetNodeInFace() const {
- for (
in
t iL = 0; iL < _sides.size(); ++iL )
+ for (
size_
t iL = 0; iL < _sides.size(); ++iL )
if ( _sides[iL]->MediumPos() == SMDS_TOP_FACE ) return _sides[iL]->_mediumNode;
return 0;
}
if ( _sides[iL]->MediumPos() == SMDS_TOP_FACE ) return _sides[iL]->_mediumNode;
return 0;
}
@@
-3642,7
+3646,7
@@
namespace { // Structures used by FixQuadraticElements()
_sides = links;
_sideIsAdded[0]=_sideIsAdded[1]=_sideIsAdded[2]=_sideIsAdded[3]=false;
_normal.SetCoord(0,0,0);
_sides = links;
_sideIsAdded[0]=_sideIsAdded[1]=_sideIsAdded[2]=_sideIsAdded[3]=false;
_normal.SetCoord(0,0,0);
- for (
in
t i = 1; i < _sides.size(); ++i ) {
+ for (
size_
t i = 1; i < _sides.size(); ++i ) {
const QLink *l1 = _sides[i-1], *l2 = _sides[i];
insert( l1->node1() ); insert( l1->node2() );
// compute normal
const QLink *l1 = _sides[i-1], *l2 = _sides[i];
insert( l1->node1() ); insert( l1->node2() );
// compute normal
@@
-3676,7
+3680,7
@@
namespace { // Structures used by FixQuadraticElements()
bool QFace::GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& error) const
{
bool QFace::GetLinkChain( int iSide, TChain& chain, SMDS_TypeOfPosition pos, int& error) const
{
- if ( iSide >= _sides.size() ) // wrong argument iSide
+ if ( iSide >=
(int)
_sides.size() ) // wrong argument iSide
return false;
if ( _sideIsAdded[ iSide ]) // already in chain
return true;
return false;
if ( _sideIsAdded[ iSide ]) // already in chain
return true;
@@
-3687,7
+3691,7
@@
namespace { // Structures used by FixQuadraticElements()
list< const QFace* > faces( 1, this );
while ( !faces.empty() ) {
const QFace* face = faces.front();
list< const QFace* > faces( 1, this );
while ( !faces.empty() ) {
const QFace* face = faces.front();
- for (
in
t i = 0; i < face->_sides.size(); ++i ) {
+ for (
size_
t i = 0; i < face->_sides.size(); ++i ) {
if ( !face->_sideIsAdded[i] && face->_sides[i] ) {
face->_sideIsAdded[i] = true;
// find a face side in the chain
if ( !face->_sideIsAdded[i] && face->_sides[i] ) {
face->_sideIsAdded[i] = true;
// find a face side in the chain
@@
-3770,7
+3774,7
@@
namespace { // Structures used by FixQuadraticElements()
typedef list< pair< const QFace*, TLinkInSet > > TFaceLinkList;
TFaceLinkList adjacentFaces;
typedef list< pair< const QFace*, TLinkInSet > > TFaceLinkList;
TFaceLinkList adjacentFaces;
- for (
in
t iL = 0; iL < _sides.size(); ++iL )
+ for (
size_
t iL = 0; iL < _sides.size(); ++iL )
{
if ( avoidLink._qlink == _sides[iL] )
continue;
{
if ( avoidLink._qlink == _sides[iL] )
continue;
@@
-3823,10
+3827,10
@@
namespace { // Structures used by FixQuadraticElements()
const TChainLink& avoidLink,
const SMDS_MeshNode* nodeToContain) const
{
const TChainLink& avoidLink,
const SMDS_MeshNode* nodeToContain) const
{
- for (
in
t i = 0; i < _sides.size(); ++i )
+ for (
size_
t i = 0; i < _sides.size(); ++i )
if ( avoidLink._qlink != _sides[i] &&
(_sides[i]->node1() == nodeToContain || _sides[i]->node2() == nodeToContain ))
if ( avoidLink._qlink != _sides[i] &&
(_sides[i]->node1() == nodeToContain || _sides[i]->node2() == nodeToContain ))
- return links.find( _sides[
i ]
);
+ return links.find( _sides[
i]
);
return links.end();
}
return links.end();
}
@@
-3877,7
+3881,7
@@
namespace { // Structures used by FixQuadraticElements()
if ( !theStep )
return thePrevLen; // propagation limit reached
if ( !theStep )
return thePrevLen; // propagation limit reached
-
in
t iL; // index of theLink
+
size_
t iL; // index of theLink
for ( iL = 0; iL < _sides.size(); ++iL )
if ( theLink._qlink == _sides[ iL ])
break;
for ( iL = 0; iL < _sides.size(); ++iL )
if ( theLink._qlink == _sides[ iL ])
break;
@@
-4017,7
+4021,7
@@
namespace { // Structures used by FixQuadraticElements()
int iFaceCont = -1, nbBoundary = 0, iBoundary[2]={-1,-1};
if ( _faces[0]->IsBoundary() )
iBoundary[ nbBoundary++ ] = 0;
int iFaceCont = -1, nbBoundary = 0, iBoundary[2]={-1,-1};
if ( _faces[0]->IsBoundary() )
iBoundary[ nbBoundary++ ] = 0;
- for (
in
t iF = 1; iFaceCont < 0 && iF < _faces.size(); ++iF )
+ for (
size_
t iF = 1; iFaceCont < 0 && iF < _faces.size(); ++iF )
{
// look for a face bounding none of volumes bound by _faces[0]
bool sameVol = false;
{
// look for a face bounding none of volumes bound by _faces[0]
bool sameVol = false;
@@
-4059,12
+4063,13
@@
namespace { // Structures used by FixQuadraticElements()
const QFace* QLink::GetContinuesFace( const QFace* face ) const
{
const QFace* QLink::GetContinuesFace( const QFace* face ) const
{
- for ( int i = 0; i < _faces.size(); ++i ) {
- if ( _faces[i] == face ) {
- int iF = i < 2 ? 1-i : 5-i;
- return iF < _faces.size() ? _faces[iF] : 0;
+ if ( _faces.size() <= 4 )
+ for ( size_t i = 0; i < _faces.size(); ++i ) {
+ if ( _faces[i] == face ) {
+ int iF = i < 2 ? 1-i : 5-i;
+ return iF < (int)_faces.size() ? _faces[iF] : 0;
+ }
}
}
- }
return 0;
}
//================================================================================
return 0;
}
//================================================================================
@@
-4075,7
+4080,7
@@
namespace { // Structures used by FixQuadraticElements()
bool QLink::OnBoundary() const
{
bool QLink::OnBoundary() const
{
- for (
in
t i = 0; i < _faces.size(); ++i )
+ for (
size_
t i = 0; i < _faces.size(); ++i )
if (_faces[i] && _faces[i]->IsBoundary()) return true;
return false;
}
if (_faces[i] && _faces[i]->IsBoundary()) return true;
return false;
}
@@
-4144,7
+4149,7
@@
namespace { // Structures used by FixQuadraticElements()
for ( ; bnd != bndEnd; ++bnd )
{
const QLink* bndLink = *bnd;
for ( ; bnd != bndEnd; ++bnd )
{
const QLink* bndLink = *bnd;
- for (
in
t i = 0; i < bndLink->_faces.size(); ++i ) // loop on faces of bndLink
+ for (
size_
t i = 0; i < bndLink->_faces.size(); ++i ) // loop on faces of bndLink
{
const QFace* face = bndLink->_faces[i]; // quadrange lateral face of a prism
if ( !face ) continue;
{
const QFace* face = bndLink->_faces[i]; // quadrange lateral face of a prism
if ( !face ) continue;
@@
-4211,7
+4216,7
@@
namespace { // Structures used by FixQuadraticElements()
{
// put links in the set and evalute number of result chains by number of boundary links
TLinkSet linkSet;
{
// put links in the set and evalute number of result chains by number of boundary links
TLinkSet linkSet;
-
in
t nbBndLinks = 0;
+
size_
t nbBndLinks = 0;
for ( TChain::iterator lnk = allLinks.begin(); lnk != allLinks.end(); ++lnk ) {
linkSet.insert( *lnk );
nbBndLinks += lnk->IsBoundary();
for ( TChain::iterator lnk = allLinks.begin(); lnk != allLinks.end(); ++lnk ) {
linkSet.insert( *lnk );
nbBndLinks += lnk->IsBoundary();
@@
-4260,7
+4265,7
@@
namespace { // Structures used by FixQuadraticElements()
TLinkInSet botLink = startLink; // current horizontal link to go up from
corner = startCorner; // current corner the botLink ends at
TLinkInSet botLink = startLink; // current horizontal link to go up from
corner = startCorner; // current corner the botLink ends at
-
in
t iRow = 0;
+
size_
t iRow = 0;
while ( botLink != linksEnd ) // loop on rows
{
// add botLink to the columnChain
while ( botLink != linksEnd ) // loop on rows
{
// add botLink to the columnChain
@@
-4357,7
+4362,7
@@
namespace { // Structures used by FixQuadraticElements()
// In the linkSet, there must remain the last links of rowChains; add them
if ( linkSet.size() != rowChains.size() )
return _BAD_SET_SIZE;
// In the linkSet, there must remain the last links of rowChains; add them
if ( linkSet.size() != rowChains.size() )
return _BAD_SET_SIZE;
- for (
in
t iRow = 0; iRow < rowChains.size(); ++iRow ) {
+ for (
size_
t iRow = 0; iRow < rowChains.size(); ++iRow ) {
// find the link (startLink) ending at startCorner
corner = 0;
for ( startLink = linkSet.begin(); startLink != linksEnd; ++startLink ) {
// find the link (startLink) ending at startCorner
corner = 0;
for ( startLink = linkSet.begin(); startLink != linksEnd; ++startLink ) {
@@
-4449,6
+4454,7
@@
namespace { // Structures used by FixQuadraticElements()
{
continue;
}
{
continue;
}
+ default:;
}
// get nodes shared by faces that may be distorted
SMDS_NodeIteratorPtr nodeIt;
}
// get nodes shared by faces that may be distorted
SMDS_NodeIteratorPtr nodeIt;
@@
-4562,6
+4568,7
@@
namespace { // Structures used by FixQuadraticElements()
{
concaveFaces.push_back( face );
}
{
concaveFaces.push_back( face );
}
+ default:;
}
}
if ( concaveFaces.empty() )
}
}
if ( concaveFaces.empty() )
@@
-4627,7
+4634,7
@@
namespace { // Structures used by FixQuadraticElements()
while ( volIt->more() )
{
const SMDS_MeshElement* vol = volIt->next();
while ( volIt->more() )
{
const SMDS_MeshElement* vol = volIt->next();
-
int
nbN = vol->NbCornerNodes();
+
size_t
nbN = vol->NbCornerNodes();
if ( ( nbN != 4 && nbN != 5 ) ||
!solidSM->Contains( vol ) ||
!checkedVols.insert( vol ).second )
if ( ( nbN != 4 && nbN != 5 ) ||
!solidSM->Contains( vol ) ||
!checkedVols.insert( vol ).second )
@@
-4957,7
+4964,7
@@
void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
else {
continue;
}
else {
continue;
}
- for (
in
t iC = 0; iC < chains.size(); ++iC )
+ for (
size_
t iC = 0; iC < chains.size(); ++iC )
{
TChain& chain = chains[iC];
if ( chain.empty() ) continue;
{
TChain& chain = chains[iC];
if ( chain.empty() ) continue;