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 branch 'V9_3_BR' into pre/padder
[modules/smesh.git]
/
src
/
StdMeshers
/
StdMeshers_Prism_3D.cxx
diff --git
a/src/StdMeshers/StdMeshers_Prism_3D.cxx
b/src/StdMeshers/StdMeshers_Prism_3D.cxx
index a6e7b0f620ab6cf1c62694f2de4afc26e1bb44d0..4d02c40bba688f46bbcbff375987ff0dcb4d32d2 100644
(file)
--- a/
src/StdMeshers/StdMeshers_Prism_3D.cxx
+++ b/
src/StdMeshers/StdMeshers_Prism_3D.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
@@
-33,6
+33,7
@@
#include "SMESH_Comment.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_HypoFilter.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_HypoFilter.hxx"
+#include "SMESH_MeshEditor.hxx"
#include "SMESH_MesherHelper.hxx"
#include "StdMeshers_FaceSide.hxx"
#include "StdMeshers_ProjectionSource1D.hxx"
#include "SMESH_MesherHelper.hxx"
#include "StdMeshers_FaceSide.hxx"
#include "StdMeshers_ProjectionSource1D.hxx"
@@
-455,7
+456,7
@@
namespace {
int nbEdges = thePrism.myNbEdgesInWires.front(); // nb outer edges
int nbSides = nbEdges;
int nbEdges = thePrism.myNbEdgesInWires.front(); // nb outer edges
int nbSides = nbEdges;
-
+
list< TopoDS_Edge >::const_iterator edgeIt = thePrism.myBottomEdges.begin();
std::advance( edgeIt, nbEdges-1 );
TopoDS_Edge prevE = *edgeIt;
list< TopoDS_Edge >::const_iterator edgeIt = thePrism.myBottomEdges.begin();
std::advance( edgeIt, nbEdges-1 );
TopoDS_Edge prevE = *edgeIt;
@@
-523,7
+524,7
@@
namespace {
// isPrevStraight = isCurStraight;
// iPrev = iE;
// }
// isPrevStraight = isCurStraight;
// iPrev = iE;
// }
-
+
return nbSides;
}
return nbSides;
}
@@
-562,7
+563,7
@@
namespace {
//=======================================================================
//function : StdMeshers_Prism_3D
//=======================================================================
//function : StdMeshers_Prism_3D
-//purpose :
+//purpose :
//=======================================================================
StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen)
//=======================================================================
StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen)
@@
-594,7
+595,7
@@
StdMeshers_Prism_3D::~StdMeshers_Prism_3D()
//=======================================================================
//function : CheckHypothesis
//=======================================================================
//function : CheckHypothesis
-//purpose :
+//purpose :
//=======================================================================
bool StdMeshers_Prism_3D::CheckHypothesis(SMESH_Mesh& aMesh,
//=======================================================================
bool StdMeshers_Prism_3D::CheckHypothesis(SMESH_Mesh& aMesh,
@@
-921,7
+922,7
@@
bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism,
StdMeshers_Quadrangle_2D* quadAlgo = TQuadrangleAlgo::instance( this, myHelper );
TopTools_MapOfShape faceMap;
StdMeshers_Quadrangle_2D* quadAlgo = TQuadrangleAlgo::instance( this, myHelper );
TopTools_MapOfShape faceMap;
- TopTools_IndexedDataMapOfShapeListOfShape edgeToFaces;
+ TopTools_IndexedDataMapOfShapeListOfShape edgeToFaces;
TopExp::MapShapesAndAncestors( thePrism.myShape3D,
TopAbs_EDGE, TopAbs_FACE, edgeToFaces );
TopExp::MapShapesAndAncestors( thePrism.myShape3D,
TopAbs_EDGE, TopAbs_FACE, edgeToFaces );
@@
-1652,7
+1653,7
@@
bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
for ( size_t iN = 1; iN < srcNodeStr.size(); ++iN ) // add segments
{
// find an EDGE to set a new segment
for ( size_t iN = 1; iN < srcNodeStr.size(); ++iN ) // add segments
{
// find an EDGE to set a new segment
- std::pair<int, TopAbs_ShapeEnum> id2type =
+ std::pair<int, TopAbs_ShapeEnum> id2type =
myHelper->GetMediumPos( newNodes[ iN-1 ], newNodes[ iN ] );
if ( id2type.second != TopAbs_EDGE )
{
myHelper->GetMediumPos( newNodes[ iN-1 ], newNodes[ iN ] );
if ( id2type.second != TopAbs_EDGE )
{
@@
-1672,7
+1673,7
@@
bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism)
{
SMESH_MeshEditor::TListOfListOfNodes lln( 1, list< const SMDS_MeshNode* >() );
lln.back().push_back ( vn );
{
SMESH_MeshEditor::TListOfListOfNodes lln( 1, list< const SMDS_MeshNode* >() );
lln.back().push_back ( vn );
- lln.back().push_front( newNodes[ iN-isPrev ] ); // to keep
+ lln.back().push_front( newNodes[ iN-isPrev ] ); // to keep
SMESH_MeshEditor( mesh ).MergeNodes( lln );
}
}
SMESH_MeshEditor( mesh ).MergeNodes( lln );
}
}
@@
-1997,7
+1998,7
@@
bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh,
std::vector<int> aVec = (*anIt).second;
nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
std::vector<int> aVec = (*anIt).second;
nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
-
+
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] );
std::vector<int> aVec = (*anIt).second;
bool IsQuadratic = (aVec[SMDSEntity_Quad_Triangle]>aVec[SMDSEntity_Triangle]) ||
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] );
std::vector<int> aVec = (*anIt).second;
bool IsQuadratic = (aVec[SMDSEntity_Quad_Triangle]>aVec[SMDSEntity_Triangle]) ||
@@
-2310,7
+2311,7
@@
bool StdMeshers_Prism_3D::projectBottomToTop( const gp_Trsf & bottom
{
return true;
}
{
return true;
}
- NSProjUtils::TNodeNodeMap& n2nMap =
+ NSProjUtils::TNodeNodeMap& n2nMap =
(NSProjUtils::TNodeNodeMap&) TProjction2dAlgo::instance( this )->GetNodesMap();
n2nMap.clear();
(NSProjUtils::TNodeNodeMap&) TProjction2dAlgo::instance( this )->GetNodesMap();
n2nMap.clear();
@@
-2395,7
+2396,7
@@
bool StdMeshers_Prism_3D::projectBottomToTop( const gp_Trsf & bottom
meshDS->MoveNode( topNode, distXYZ[1], distXYZ[2], distXYZ[3] ); // transform can be inaccurate
}
// create node column
meshDS->MoveNode( topNode, distXYZ[1], distXYZ[2], distXYZ[3] ); // transform can be inaccurate
}
// create node column
- TNode2ColumnMap::iterator bN_col =
+ TNode2ColumnMap::iterator bN_col =
myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first;
TNodeColumn & column = bN_col->second;
column.resize( zSize );
myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first;
TNodeColumn & column = bN_col->second;
column.resize( zSize );
@@
-2543,7
+2544,7
@@
double StdMeshers_Prism_3D::getSweepTolerance( const Prism_3D::TPrismTopo& thePr
for ( int iN = 0; iN < nbNodes; ++iN )
nodes[ iN ] = nIt->next();
nodes.back() = nodes[0];
for ( int iN = 0; iN < nbNodes; ++iN )
nodes[ iN ] = nIt->next();
nodes.back() = nodes[0];
-
+
// loop on links
double dist2;
for ( int iN = 0; iN < nbNodes; ++iN )
// loop on links
double dist2;
for ( int iN = 0; iN < nbNodes; ++iN )
@@
-2589,7
+2590,7
@@
double StdMeshers_Prism_3D::getSweepTolerance( const Prism_3D::TPrismTopo& thePr
//=======================================================================
//function : isSimpleQuad
//purpose : check if the bottom FACE is meshable with nice quadrangles,
//=======================================================================
//function : isSimpleQuad
//purpose : check if the bottom FACE is meshable with nice quadrangles,
-// if so the block aproach can work rather fast.
+// if so the block ap
p
roach can work rather fast.
// This is a temporary mean caused by problems in StdMeshers_Sweeper
//=======================================================================
// This is a temporary mean caused by problems in StdMeshers_Sweeper
//=======================================================================
@@
-2784,8
+2785,8
@@
namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
EdgeWithNeighbors() {}
bool IsInternal() const { return !_edge.IsNull() && _edge.Orientation() == TopAbs_INTERNAL; }
};
EdgeWithNeighbors() {}
bool IsInternal() const { return !_edge.IsNull() && _edge.Orientation() == TopAbs_INTERNAL; }
};
- // PrismSide contains all FACEs linking a bottom EDGE with a top one.
- struct PrismSide
+ // PrismSide contains all FACEs linking a bottom EDGE with a top one.
+ struct PrismSide
{
TopoDS_Face _face; // a currently treated upper FACE
TopTools_IndexedMapOfShape *_faces; // all FACEs (pointer because of a private copy constructor)
{
TopoDS_Face _face; // a currently treated upper FACE
TopTools_IndexedMapOfShape *_faces; // all FACEs (pointer because of a private copy constructor)
@@
-2923,7
+2924,7
@@
namespace // utils used by StdMeshers_Prism_3D::IsApplicable()
}
return edges.size();
}
}
return edges.size();
}
-
+
//--------------------------------------------------------------------------------
/*!
* \brief Return number of faces sharing given edges
//--------------------------------------------------------------------------------
/*!
* \brief Return number of faces sharing given edges
@@
-3536,7
+3537,7
@@
bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper,
SMESH_Block::init();
myShapeIDMap.Clear();
myShapeIndex2ColumnMap.clear();
SMESH_Block::init();
myShapeIDMap.Clear();
myShapeIndex2ColumnMap.clear();
-
+
int wallFaceIds[ NB_WALL_FACES ] = { // to walk around a block
SMESH_Block::ID_Fx0z, SMESH_Block::ID_F1yz,
SMESH_Block::ID_Fx1z, SMESH_Block::ID_F0yz
int wallFaceIds[ NB_WALL_FACES ] = { // to walk around a block
SMESH_Block::ID_Fx0z, SMESH_Block::ID_F1yz,
SMESH_Block::ID_Fx1z, SMESH_Block::ID_F0yz
@@
-3979,7
+3980,7
@@
bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector<gp_Trsf> &
if ( p0.SquareDistance( pz ) > tol2 )
{
t = gp_Trsf();
if ( p0.SquareDistance( pz ) > tol2 )
{
t = gp_Trsf();
- return ( z == zSize - 1 ); // OK if fails only botto
n
->top trsf
+ return ( z == zSize - 1 ); // OK if fails only botto
m
->top trsf
}
}
}
}
}
}
@@
-3988,12
+3989,12
@@
bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector<gp_Trsf> &
//================================================================================
/*!
//================================================================================
/*!
- * \brief Check curve orientation of a bo
o
tom edge
+ * \brief Check curve orientation of a bo
t
tom edge
* \param meshDS - mesh DS
* \param columnsMap - node columns map of side face
* \param meshDS - mesh DS
* \param columnsMap - node columns map of side face
- * \param bottomEdge - the bo
o
tom edge
+ * \param bottomEdge - the bo
t
tom edge
* \param sideFaceID - side face in-block ID
* \param sideFaceID - side face in-block ID
- * \retval bool - true if orientation coin
s
ide with in-block forward orientation
+ * \retval bool - true if orientation coin
c
ide with in-block forward orientation
*/
//================================================================================
*/
//================================================================================
@@
-4064,7
+4065,7
@@
void StdMeshers_PrismAsBlock::faceGridToPythonDump(const SMESH_Block::TShapeID f
<< n << ", " << n+1 << ", "
<< n+nb+2 << ", " << n+nb+1 << "]) " << endl;
}
<< n << ", " << n+1 << ", "
<< n+nb+2 << ", " << n+nb+1 << "]) " << endl;
}
-
+
#endif
}
#endif
}
@@
-4216,8
+4217,8
@@
Adaptor3d_Curve* StdMeshers_PrismAsBlock::TSideFace::VertiCurve(const bool isMax
//================================================================================
/*!
* \brief Return geometry of the top or bottom curve
//================================================================================
/*!
* \brief Return geometry of the top or bottom curve
- * \param isTop -
- * \retval Adaptor3d_Curve* -
+ * \param isTop -
+ * \retval Adaptor3d_Curve* -
*/
//================================================================================
*/
//================================================================================
@@
-4473,7
+4474,7
@@
gp_Pnt StdMeshers_PrismAsBlock::TSideFace::Value(const Standard_Real U,
meshDS->IndexToShape( notFaceID2 ),
*myHelper.GetMesh(),
TopAbs_FACE );
meshDS->IndexToShape( notFaceID2 ),
*myHelper.GetMesh(),
TopAbs_FACE );
- if ( face.IsNull() )
+ if ( face.IsNull() )
throw SALOME_Exception("StdMeshers_PrismAsBlock::TSideFace::Value() face.IsNull()");
int faceID = meshDS->ShapeToIndex( face );
me->mySurface = me->myShapeID2Surf[ faceID ];
throw SALOME_Exception("StdMeshers_PrismAsBlock::TSideFace::Value() face.IsNull()");
int faceID = meshDS->ShapeToIndex( face );
me->mySurface = me->myShapeID2Surf[ faceID ];
@@
-4603,7
+4604,7
@@
int StdMeshers_PrismAsBlock::TSideFace::InsertSubShapes(TBlockShapes& shapeMap)
if ( v1.ShapeType() == TopAbs_VERTEX ) {
nbInserted += SMESH_Block::Insert( v1, vertIdVec[ 1 ], shapeMap);
}
if ( v1.ShapeType() == TopAbs_VERTEX ) {
nbInserted += SMESH_Block::Insert( v1, vertIdVec[ 1 ], shapeMap);
}
-
+
// from V1 column
SMESH_Block::GetEdgeVertexIDs( edgeIdVec[ V1_EDGE ], vertIdVec);
GetColumns(1, col1, col2 );
// from V1 column
SMESH_Block::GetEdgeVertexIDs( edgeIdVec[ V1_EDGE ], vertIdVec);
GetColumns(1, col1, col2 );
@@
-4651,7
+4652,7
@@
int StdMeshers_PrismAsBlock::TSideFace::InsertSubShapes(TBlockShapes& shapeMap)
// if ( edgeID = edgeIdVec[ _v1 ]) edgeID = edgeIdVec[ _v0 ];
// else edgeID = edgeIdVec[ _v1 ];
// SMESH_Block::Insert( sideEdge, edgeID, shapeMap);
// if ( edgeID = edgeIdVec[ _v1 ]) edgeID = edgeIdVec[ _v0 ];
// else edgeID = edgeIdVec[ _v1 ];
// SMESH_Block::Insert( sideEdge, edgeID, shapeMap);
-
+
// // top edge
// TopoDS_Edge topEdge = GetEdge( TOP_EDGE );
// SMESH_Block::Insert( topEdge, edgeIdVec[ _u1 ], shapeMap);
// // top edge
// TopoDS_Edge topEdge = GetEdge( TOP_EDGE );
// SMESH_Block::Insert( topEdge, edgeIdVec[ _u1 ], shapeMap);
@@
-4689,7
+4690,7
@@
void StdMeshers_PrismAsBlock::TSideFace::dumpNodes(int nbNodes) const
//================================================================================
/*!
//================================================================================
/*!
- * \brief Creates TVerticalEdgeAdaptor
+ * \brief Creates TVerticalEdgeAdaptor
* \param columnsMap - node column map
* \param parameter - normalized parameter
*/
* \param columnsMap - node column map
* \param parameter - normalized parameter
*/
@@
-4764,7
+4765,7
@@
void StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::dumpNodes(int nbNodes) con
TParam2ColumnIt col, col2;
TParam2ColumnMap* u2cols = side->GetColumns();
side->GetColumns( u , col, col2 );
TParam2ColumnIt col, col2;
TParam2ColumnMap* u2cols = side->GetColumns();
side->GetColumns( u , col, col2 );
-
+
int j, i = myV ? mySide->ColumnHeight()-1 : 0;
const SMDS_MeshNode* n = 0;
int j, i = myV ? mySide->ColumnHeight()-1 : 0;
const SMDS_MeshNode* n = 0;
@@
-4793,7
+4794,7
@@
void StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::dumpNodes(int nbNodes) con
//================================================================================
/*!
//================================================================================
/*!
- * \brief Costructor of TPCurveOnHorFaceAdaptor fills its map of
+ * \brief Co
n
structor of TPCurveOnHorFaceAdaptor fills its map of
* normalized parameter to node UV on a horizontal face
* \param [in] sideFace - lateral prism side
* \param [in] isTop - is \a horFace top or bottom of the prism
* normalized parameter to node UV on a horizontal face
* \param [in] sideFace - lateral prism side
* \param [in] isTop - is \a horFace top or bottom of the prism