PR: tools for crack meshing : when building pyramids on complex shapes, orientation detection is difficult (concavities) and can be helped if a group of faces correctly oriented is provided. (check the presence of a group named "skinFaces")

This commit is contained in:
prascle 2012-09-04 14:06:32 +00:00
parent 16fcf4dea0
commit 80cf9ab761

View File

@ -28,6 +28,8 @@
#include "SMESH_Algo.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_Group.hxx"
#include "SMESHDS_GroupBase.hxx"
#include <IntAna_IntConicQuad.hxx>
#include <IntAna_Quadric.hxx>
@ -38,7 +40,9 @@
#include <TopoDS.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
#include "utilities.h"
#include <string>
#include <numeric>
#include <limits>
@ -898,6 +902,36 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
if ( aMesh.NbQuadrangles() < 1 )
return false;
// find if there is a group of faces identified as skin faces, with normal going outside the volume
std::string groupName = "skinFaces";
SMESHDS_GroupBase* groupDS = 0;
SMESH_Mesh::GroupIteratorPtr groupIt = aMesh.GetGroups();
while ( groupIt->more() )
{
groupDS = 0;
SMESH_Group * group = groupIt->next();
if ( !group ) continue;
groupDS = group->GetGroupDS();
if ( !groupDS || groupDS->IsEmpty() )
{
groupDS = 0;
continue;
}
if (groupDS->GetType() != SMDSAbs_Face)
{
groupDS = 0;
continue;
}
std::string grpName = group->GetName();
if (grpName == groupName)
{
MESSAGE("group skinFaces provided");
break;
}
else
groupDS = 0;
}
vector<const SMDS_MeshElement*> myPyramids;
SMESH_MesherHelper helper(aMesh);
helper.IsQuadraticSubMesh(aMesh.GetShapeToMesh());
@ -1062,6 +1096,10 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
}
}
// if the face belong to the group of skinFaces, do not build a pyramid outside
if (groupDS && groupDS->Contains(face))
intersected[0] = false;
// Create one or two pyramids
for ( int isRev = 0; isRev < 2; ++isRev )