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
Merge remote-tracking branch 'origin/master' into V8_5_BR
[modules/smesh.git]
/
src
/
StdMeshers
/
StdMeshers_CompositeHexa_3D.cxx
diff --git
a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
index 07919e0ffcaef8115f50eb116d22997282bc4087..ebdbd9ee47e0603cc27b89b7f55d12677945b6bd 100644
(file)
--- a/
src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
+++ b/
src/StdMeshers/StdMeshers_CompositeHexa_3D.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
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-17,7
+17,7
@@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESH : implementaion of SMESH idl descriptions
+// SMESH SMESH : implementa
t
ion of SMESH idl descriptions
// File : StdMeshers_CompositeHexa_3D.cxx
// Module : SMESH
// Created : Tue Nov 25 11:04:59 2008
// File : StdMeshers_CompositeHexa_3D.cxx
// Module : SMESH
// Created : Tue Nov 25 11:04:59 2008
@@
-28,6
+28,8
@@
#include "SMDS_Mesh.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx"
#include "SMDS_Mesh.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx"
+#include "SMESHDS_Mesh.hxx"
+#include "SMESHDS_SubMesh.hxx"
#include "SMESH_Block.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_ComputeError.hxx"
#include "SMESH_Block.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_ComputeError.hxx"
@@
-58,13
+60,12
@@
#include <set>
#include <vector>
#include <set>
#include <vector>
+using namespace std;
#ifdef _DEBUG_
// #define DEB_FACES
// #define DEB_GRID
#ifdef _DEBUG_
// #define DEB_FACES
// #define DEB_GRID
-// #define DUMP_VERT(msg,V) \
-// { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v); \
-// cout << msg << "( "<< p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl;}
+// #define DUMP_VERT(msg,V) { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v); cout << msg << "( "<< p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl; }
#endif
#ifndef DUMP_VERT
#endif
#ifndef DUMP_VERT
@@
-84,7
+85,7
@@
enum EAxes{ COO_X=1, COO_Y, COO_Z };
//================================================================================
/*!
//================================================================================
/*!
- * \brief Convert
o
r of a pair of integers to a sole index
+ * \brief Convert
e
r of a pair of integers to a sole index
*/
struct _Indexer
{
*/
struct _Indexer
{
@@
-383,12
+384,12
@@
namespace
const TopTools_MapOfShape& cornerVV,
TopTools_MapOfShape& internEE)
{
const TopTools_MapOfShape& cornerVV,
TopTools_MapOfShape& internEE)
{
- TopTools_IndexedMapOfShape subEE
, subFF
;
+ TopTools_IndexedMapOfShape subEE;
TopExp::MapShapes( shape, TopAbs_EDGE, subEE );
TopExp::MapShapes( shape, TopAbs_EDGE, subEE );
- TopExp::MapShapes( shape, TopAbs_FACE, subFF );
+
//
TopExp::MapShapes( shape, TopAbs_FACE, subFF );
TopoDS_Vertex VV[2];
TopoDS_Vertex VV[2];
- TopTools_MapOfShape subChecked
/*, ridgeEE*/
;
+ TopTools_MapOfShape subChecked
, ridgeEE
;
TopTools_MapIteratorOfMapOfShape vIt( cornerVV );
for ( ; vIt.More(); vIt.Next() )
{
TopTools_MapIteratorOfMapOfShape vIt( cornerVV );
for ( ; vIt.More(); vIt.Next() )
{
@@
-402,6
+403,8
@@
namespace
TopoDS_Edge ridgeE = TopoDS::Edge( *riE );
while ( !ridgeE.IsNull() )
{
TopoDS_Edge ridgeE = TopoDS::Edge( *riE );
while ( !ridgeE.IsNull() )
{
+ if ( !ridgeEE.Add( ridgeE ))
+ break;
TopExp::Vertices( ridgeE, VV[0], VV[1] );
TopoDS_Shape V1 = VV[ V0.IsSame( VV[0] )];
if ( cornerVV.Contains( V1 ) )
TopExp::Vertices( ridgeE, VV[0], VV[1] );
TopoDS_Shape V1 = VV[ V0.IsSame( VV[0] )];
if ( cornerVV.Contains( V1 ) )
@@
-452,6
+455,11
@@
namespace
} // loop on ridge EDGEs around a corner VERTEX
} // loop on on corner VERTEXes
} // loop on ridge EDGEs around a corner VERTEX
} // loop on on corner VERTEXes
+ if ( subEE.Extent() > ridgeEE.Extent() + internEE.Extent() ) // PAL23269
+ for ( int i = 1; i < subEE.Extent(); ++i )
+ if ( !ridgeEE.Contains( subEE(i) ))
+ internEE.Add( subEE(i) );
+
return true;
} // getInternalEdges()
} // namespace
return true;
} // getInternalEdges()
} // namespace
@@
-556,7
+564,7
@@
bool StdMeshers_CompositeHexa_3D::findBoxFaces( const TopoDS_Shape& shape,
if ( !fTop )
return error(COMPERR_BAD_SHAPE);
if ( !fTop )
return error(COMPERR_BAD_SHAPE);
- // orient bottom e
gd
e of faces along axes of the unit box
+ // orient bottom e
dg
e of faces along axes of the unit box
fBottom->ReverseEdges();
fBack ->ReverseEdges();
fLeft ->ReverseEdges();
fBottom->ReverseEdges();
fBack ->ReverseEdges();
fLeft ->ReverseEdges();
@@
-569,7
+577,7
@@
bool StdMeshers_CompositeHexa_3D::findBoxFaces( const TopoDS_Shape& shape,
* \brief Computes hexahedral mesh on a box with composite sides
* \param aMesh - mesh to compute
* \param aShape - shape to mesh
* \brief Computes hexahedral mesh on a box with composite sides
* \param aMesh - mesh to compute
* \param aShape - shape to mesh
- * \retval bool - succes sign
+ * \retval bool - succes
s
sign
*/
//================================================================================
*/
//================================================================================
@@
-931,7
+939,7
@@
bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid& other,
{
const _FaceSide& otherSide = other.GetSide( i );
int iMyCommon;
{
const _FaceSide& otherSide = other.GetSide( i );
int iMyCommon;
- if ( mySides.Contain( otherSide, &iMyCommon )
)
+ if ( mySides.Contain( otherSide, &iMyCommon ))
{
if ( internalEdges.Contains( otherSide.Edge( 0 )))
{
{
if ( internalEdges.Contains( otherSide.Edge( 0 )))
{
@@
-939,13
+947,23
@@
bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid& other,
DUMP_VERT("Cont 2", mySides.GetSide(iMyCommon)->LastVertex());
DUMP_VERT("Cont 3", otherSide.FirstVertex());
DUMP_VERT("Cont 4", otherSide.LastVertex());
DUMP_VERT("Cont 2", mySides.GetSide(iMyCommon)->LastVertex());
DUMP_VERT("Cont 3", otherSide.FirstVertex());
DUMP_VERT("Cont 4", otherSide.LastVertex());
- if ( myChildren.empty() ) {
+
+ if ( myChildren.empty() )
+ {
myChildren.push_back( *this );
myFace.Nullify();
}
myChildren.push_back( *this );
myFace.Nullify();
}
+ else // find iMyCommon in myChildren
+ {
+ for ( TChildIterator children = GetChildren(); children.more(); ) {
+ const _QuadFaceGrid& child = children.next();
+ if ( child.mySides.Contain( otherSide, &iMyCommon ))
+ break;
+ }
+ }
// orient new children equally
// orient new children equally
- int otherBottomIndex =
( 4 + i - iMyCommon + 2 ) % 4
;
+ int otherBottomIndex =
SMESH_MesherHelper::WrapIndex( i - iMyCommon + 2, 4 )
;
if ( other.IsComplex() )
for ( TChildIterator children = other.GetChildren(); children.more(); ) {
myChildren.push_back( children.next() );
if ( other.IsComplex() )
for ( TChildIterator children = other.GetChildren(); children.more(); ) {
myChildren.push_back( children.next() );
@@
-962,7
+980,7
@@
bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid& other,
if ( other.IsComplex() )
for ( TChildIterator children = other.GetChildren(); children.more(); )
{
if ( other.IsComplex() )
for ( TChildIterator children = other.GetChildren(); children.more(); )
{
- const _QuadFaceGrid& child =
children.next();
+ const _QuadFaceGrid& child = children.next();
for ( int i = 0; i < 4; ++i )
mySides.AppendSide( child.GetSide(i) );
}
for ( int i = 0; i < 4; ++i )
mySides.AppendSide( child.GetSide(i) );
}
@@
-1004,9
+1022,9
@@
bool _QuadFaceGrid::SetBottomSide(const _FaceSide& bottom, int* sideIndex)
{
if ( childFace->SetBottomSide( bottom, &myBottomIndex ))
{
{
if ( childFace->SetBottomSide( bottom, &myBottomIndex ))
{
- TChildren::iterator orientedCild = childFace;
+ TChildren::iterator orientedC
h
ild = childFace;
for ( childFace = myChildren.begin(); childFace != childEnd; ++childFace ) {
for ( childFace = myChildren.begin(); childFace != childEnd; ++childFace ) {
- if ( childFace != orientedCild )
+ if ( childFace != orientedC
h
ild )
childFace->SetBottomSide( childFace->GetSide( myBottomIndex ));
}
if ( sideIndex )
childFace->SetBottomSide( childFace->GetSide( myBottomIndex ));
}
if ( sideIndex )
@@
-1078,7
+1096,7
@@
const _FaceSide& _QuadFaceGrid::GetSide(int i) const
*/
//================================================================================
*/
//================================================================================
-void _QuadFaceGrid::ReverseEdges(
/*int e1, int e2*/
)
+void _QuadFaceGrid::ReverseEdges()
{
myReverse = !myReverse;
{
myReverse = !myReverse;
@@
-1089,8
+1107,6
@@
void _QuadFaceGrid::ReverseEdges(/*int e1, int e2*/)
if ( myChildren.empty() )
{
if ( myChildren.empty() )
{
-// mySides.GetSide( e1 )->Reverse();
-// mySides.GetSide( e2 )->Reverse();
DumpVertices();
}
else
DumpVertices();
}
else
@@
-1098,7
+1114,7
@@
void _QuadFaceGrid::ReverseEdges(/*int e1, int e2*/)
DumpVertices();
TChildren::iterator child = myChildren.begin(), childEnd = myChildren.end();
for ( ; child != childEnd; ++child )
DumpVertices();
TChildren::iterator child = myChildren.begin(), childEnd = myChildren.end();
for ( ; child != childEnd; ++child )
- child->ReverseEdges(
/*e1, e2*/
);
+ child->ReverseEdges();
}
}
}
}
@@
-1142,7
+1158,7
@@
bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
myGrid.resize( myIndexer.size() );
myGrid.resize( myIndexer.size() );
- // st
r
ore nodes bound to the bottom edge
+ // store nodes bound to the bottom edge
mySides.GetSide( Q_BOTTOM )->StoreNodes( mesh, myGrid, myReverse );
// store the rest nodes row by row
mySides.GetSide( Q_BOTTOM )->StoreNodes( mesh, myGrid, myReverse );
// store the rest nodes row by row
@@
-1150,7
+1166,7
@@
bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
TIDSortedElemSet emptySet, avoidSet;
const SMDS_MeshElement* firstQuad = 0; // most left face above the last row of found nodes
TIDSortedElemSet emptySet, avoidSet;
const SMDS_MeshElement* firstQuad = 0; // most left face above the last row of found nodes
-
in
t nbFoundNodes = myIndexer._xSize;
+
size_
t nbFoundNodes = myIndexer._xSize;
while ( nbFoundNodes != myGrid.size() )
{
// first and last nodes of the last filled row of nodes
while ( nbFoundNodes != myGrid.size() )
{
// first and last nodes of the last filled row of nodes
@@
-1674,8
+1690,6
@@
_FaceSide::_FaceSide(const list<TopoDS_Edge>& edges):
for ( ; edge != eEnd; ++edge ) {
myChildren.push_back( _FaceSide( *edge ));
myNbChildren++;
for ( ; edge != eEnd; ++edge ) {
myChildren.push_back( _FaceSide( *edge ));
myNbChildren++;
-// myVertices.insert( myChildren.back().myVertices.begin(),
-// myChildren.back().myVertices.end() );
myVertices.Add( myChildren.back().FirstVertex() );
myVertices.Add( myChildren.back().LastVertex() );
myChildren.back().SetID( Q_CHILD ); // not to splice them
myVertices.Add( myChildren.back().FirstVertex() );
myVertices.Add( myChildren.back().LastVertex() );
myChildren.back().SetID( Q_CHILD ); // not to splice them
@@
-1684,7
+1698,7
@@
_FaceSide::_FaceSide(const list<TopoDS_Edge>& edges):
//=======================================================================
//function : GetSide
//=======================================================================
//function : GetSide
-//purpose :
+//purpose :
//=======================================================================
_FaceSide* _FaceSide::GetSide(const int i)
//=======================================================================
_FaceSide* _FaceSide::GetSide(const int i)