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
1) Use transformation for projection from bottom to top
[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 11a3cc57ad510770b043a8c13b3690cd43b38d70..30b645a622793de22e636862ba28688f23e51168 100644
(file)
--- a/
src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
+++ b/
src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
2
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
3
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
@@
-32,6
+32,7
@@
#include "SMESH_Comment.hxx"
#include "SMESH_ComputeError.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_ComputeError.hxx"
#include "SMESH_Mesh.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
@@
-58,17
+59,15
@@
#ifdef _DEBUG_
#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;}
+#endif
-//#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;}
-
-#else
-
+#ifndef DUMP_VERT
#define DUMP_VERT(msg,v)
#define DUMP_VERT(msg,v)
-
#endif
//================================================================================
#endif
//================================================================================
@@
-657,10
+656,9
@@
bool _QuadFaceGrid::Init(const TopoDS_Face& f)
//if ( myFace.Orientation() != TopAbs_FORWARD )
//myFace.Reverse();
//if ( myFace.Orientation() != TopAbs_FORWARD )
//myFace.Reverse();
- TopoDS_Vertex V;
list< TopoDS_Edge > edges;
list< int > nbEdgesInWire;
list< TopoDS_Edge > edges;
list< int > nbEdgesInWire;
- int nbWire = SMESH_Block::GetOrderedEdges (myFace,
V,
edges, nbEdgesInWire);
+ int nbWire = SMESH_Block::GetOrderedEdges (myFace, edges, nbEdgesInWire);
if ( nbWire != 1 )
return false;
if ( nbWire != 1 )
return false;
@@
-715,7
+713,7
@@
bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid& other )
const _FaceSide& otherSide = other.GetSide( i );
int iMyCommon;
if ( mySides.Contain( otherSide, &iMyCommon ) ) {
const _FaceSide& otherSide = other.GetSide( i );
int iMyCommon;
if ( mySides.Contain( otherSide, &iMyCommon ) ) {
- // check if normals of two faces are collinear at all vertices of a otherSide
+ // check if normals of two faces are collinear at all vertices of a
n
otherSide
const double angleTol = M_PI / 180. / 2.;
int iV, nbV = otherSide.NbVertices(), nbCollinear = 0;
for ( iV = 0; iV < nbV; ++iV )
const double angleTol = M_PI / 180. / 2.;
int iV, nbV = otherSide.NbVertices(), nbCollinear = 0;
for ( iV = 0; iV < nbV; ++iV )
@@
-740,15
+738,20
@@
bool _QuadFaceGrid::AddContinuousFace( const _QuadFaceGrid& other )
myChildren.push_back( *this );
myFace.Nullify();
}
myChildren.push_back( *this );
myFace.Nullify();
}
+
+ // orient new children equally
+ int otherBottomIndex = ( 4 + i - iMyCommon + 2 ) % 4;
if ( other.IsComplex() )
if ( other.IsComplex() )
- for ( TChildIterator children = other.GetChildren(); children.more(); )
+ for ( TChildIterator children = other.GetChildren(); children.more(); )
{
myChildren.push_back( children.next() );
myChildren.push_back( children.next() );
- else
+ myChildren.back().SetBottomSide( myChildren.back().GetSide( otherBottomIndex ));
+ }
+ else {
myChildren.push_back( other );
myChildren.push_back( other );
+ myChildren.back().SetBottomSide( myChildren.back().GetSide( otherBottomIndex ));
+ }
myLeftBottomChild = 0;
myLeftBottomChild = 0;
- //int otherBottomIndex = ( 4 + i - iMyCommon + 2 ) % 4;
- //myChildren.back().SetBottomSide( other.GetSide( otherBottomIndex ));
// collect vertices in mySides
if ( other.IsComplex() )
// collect vertices in mySides
if ( other.IsComplex() )
@@
-960,10
+963,10
@@
bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
//
TIDSortedElemSet emptySet, avoidSet;
avoidSet.insert( firstQuad );
//
TIDSortedElemSet emptySet, avoidSet;
avoidSet.insert( firstQuad );
- firstQuad = SMESH_Mesh
Editor
::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
+ firstQuad = SMESH_Mesh
Algos
::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
while ( firstQuad && !faceSubMesh->Contains( firstQuad )) {
avoidSet.insert( firstQuad );
while ( firstQuad && !faceSubMesh->Contains( firstQuad )) {
avoidSet.insert( firstQuad );
- firstQuad = SMESH_Mesh
Editor
::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
+ firstQuad = SMESH_Mesh
Algos
::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
}
if ( !firstQuad || !faceSubMesh->Contains( firstQuad ))
return error(ERR_LI("Error in _QuadFaceGrid::LoadGrid()"));
}
if ( !firstQuad || !faceSubMesh->Contains( firstQuad ))
return error(ERR_LI("Error in _QuadFaceGrid::LoadGrid()"));
@@
-993,7
+996,7
@@
bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
{
// next face
avoidSet.clear(); avoidSet.insert( quad );
{
// next face
avoidSet.clear(); avoidSet.insert( quad );
- quad = SMESH_Mesh
Editor
::FindFaceInSet( n1down, n1up, emptySet, avoidSet );
+ quad = SMESH_Mesh
Algos
::FindFaceInSet( n1down, n1up, emptySet, avoidSet );
if ( !quad || quad->NbNodes() % 4 > 0)
return error(ERR_LI("Error in _QuadFaceGrid::LoadGrid()"));
if ( !quad || quad->NbNodes() % 4 > 0)
return error(ERR_LI("Error in _QuadFaceGrid::LoadGrid()"));