-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESH : implementaion of SMESH idl descriptions
+// SMESH SMESH : implementation of SMESH idl descriptions
// File : StdMeshers_CompositeHexa_3D.cxx
// Module : SMESH
// Created : Tue Nov 25 11:04:59 2008
//================================================================================
/*!
- * \brief Convertor of a pair of integers to a sole index
+ * \brief Converter of a pair of integers to a sole index
*/
struct _Indexer
{
*/
//================================================================================
-StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, int studyId, SMESH_Gen* gen)
- :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, SMESH_Gen* gen)
+ :SMESH_3D_Algo(hypId, gen)
{
_name = "CompositeHexa_3D";
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit /shape type
if ( !TopExp::CommonVertex( E1, E2, V )) return false;
const SMDS_MeshNode* n = SMESH_Algo::VertexNode( V, mesh.GetMeshDS() );
- if ( !n ) return false;
+ if ( !n ) return SMESH_Algo::IsContinuous( E1, E2 ); // meshed by "composite segment"
SMESHDS_SubMesh* sm = mesh.GetSubMeshContaining( F )->GetSubMeshDS();
if ( !sm ) return false;
int nbQuads = 0;
SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(SMDSAbs_Face);
+ if ( !fIt->more() )
+ return SMESH_Algo::IsContinuous( E1, E2 ); // meshed by "composite segment"
while ( fIt->more() )
{
const SMDS_MeshElement* f = fIt->next();
return nbQuads == 2;
}
+ //================================================================================
+ /*!
+ * \brief Return true if a vertex holds a node and this node is used by some quadrangle
+ */
+ //================================================================================
+
+ // bool isMeshedVertex( TopoDS_Vertex& V,
+ // const SMESH_Mesh& mesh )
+ // {
+ // const SMDS_MeshNode* n = SMESH_Algo::VertexNode( V, mesh.GetMeshDS() );
+ // if ( !n ) return false;
+
+ // SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(SMDSAbs_Face);
+ // while ( fIt->more() )
+ // {
+ // const SMDS_MeshElement* f = fIt->next();
+ // if ( f->NbCornerNodes() == 4 )
+ // return true;
+ // }
+ // return false;
+ // }
+
//================================================================================
/*!
* \brief Finds VERTEXes located at block corners
if ( !fTop )
return error(COMPERR_BAD_SHAPE);
- // orient bottom egde of faces along axes of the unit box
+ // orient bottom edge of faces along axes of the unit box
fBottom->ReverseEdges();
fBack ->ReverseEdges();
fLeft ->ReverseEdges();
* \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 - success sign
*/
//================================================================================
nbSeg1 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
}
- // Get an 1D size of a box side ortogonal to lessComplexSide
+ // Get an 1D size of a box side orthogonal to lessComplexSide
int nbSeg2 = 0;
_QuadFaceGrid* ortoSide =
lessComplexSide->FindAdjacentForSide( Q_LEFT, boxFaceContainer, B_UNDEFINED );
nbSeg2 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
}
- // Get an 2D size of a box side ortogonal to lessComplexSide
+ // Get an 2D size of a box side orthogonal to lessComplexSide
int nbFaces = 0, nbQuadFace = 0;
list< TopoDS_Face > sideFaces;
if ( ortoSide->IsComplex() )
while ( !edges.empty()) {
sideEdges.clear();
sideEdges.splice( sideEdges.end(), edges, edges.begin());// edges.front()->sideEdges.back()
+ if ( SMESH_Algo::isDegenerated( sideEdges.back() ))
+ continue;
while ( !edges.empty() ) {
- if ( SMESH_Algo::IsContinuous( sideEdges.back(), edges.front() )) {
- sideEdges.splice( sideEdges.end(), edges, edges.begin());
- }
- else if ( SMESH_Algo::IsContinuous( sideEdges.front(), edges.back() )) {
- sideEdges.splice( sideEdges.begin(), edges, --edges.end());
- }
- else if ( isContinuousMesh( sideEdges.back(), edges.front(), f, mesh )) {
+ if ( isContinuousMesh( sideEdges.back(), edges.front(), f, mesh )) {
sideEdges.splice( sideEdges.end(), edges, edges.begin());
}
else if ( isContinuousMesh( sideEdges.front(), edges.back(), f, mesh )) {
myGrid.resize( myIndexer.size() );
- // strore 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
nodes);
if ( !ok ) return false;
+ // skip nodes on VERTEXes not included in faces
+ if ( !nodes.begin()->second->GetInverseElementIterator(SMDSAbs_Face)->more() )
+ nodes.erase( nodes.begin() );
+ if ( !nodes.empty() &&
+ !nodes.rbegin()->second->GetInverseElementIterator(SMDSAbs_Face)->more() )
+ nodes.erase( --nodes.end() );
+
bool forward = ( edge->Orientation() == TopAbs_FORWARD );
if ( reverse ) forward = !forward;
if ( forward )