Commit 8eb41606 authored by Franjo's avatar Franjo
Browse files

Subsets containing points where the mesh is tangled

parent be692131
......@@ -285,6 +285,17 @@ void meshOptimizer::untangleMeshFV
} while( nBadFaces );
if( nBadFaces != 0 )
{
label subsetId = mesh_.faceSubsetIndex("badFaces");
if( subsetId >= 0 )
mesh_.removeFaceSubset(subsetId);
subsetId = mesh_.addFaceSubset("badFaces");
forAllConstIter(labelHashSet, badFaces, it)
mesh_.addFaceToSubset(subsetId, it.key());
}
Info << "Finished untangling the mesh" << endl;
}
......
......@@ -83,7 +83,7 @@ meshSurfaceOptimizer::meshSurfaceOptimizer(const meshSurfaceEngine& surface)
octreePtr_(NULL),
triMeshPtr_(NULL),
enforceConstraints_(false),
badPointsSubsetName_()
badPointsSubsetName_("invertedBoundaryPoints")
{
classifySurfaceVertices();
}
......@@ -97,7 +97,7 @@ meshSurfaceOptimizer::meshSurfaceOptimizer(const meshSurfacePartitioner& mPart)
octreePtr_(NULL),
triMeshPtr_(NULL),
enforceConstraints_(false),
badPointsSubsetName_()
badPointsSubsetName_("invertedBoundaryPoints")
{
classifySurfaceVertices();
}
......@@ -115,7 +115,7 @@ meshSurfaceOptimizer::meshSurfaceOptimizer
octreePtr_(&octree),
triMeshPtr_(NULL),
enforceConstraints_(false),
badPointsSubsetName_()
badPointsSubsetName_("invertedBoundaryPoints")
{
classifySurfaceVertices();
}
......@@ -133,7 +133,7 @@ meshSurfaceOptimizer::meshSurfaceOptimizer
octreePtr_(&octree),
triMeshPtr_(NULL),
enforceConstraints_(false),
badPointsSubsetName_()
badPointsSubsetName_("invertedBoundaryPoints")
{
classifySurfaceVertices();
}
......
......@@ -542,6 +542,23 @@ bool meshSurfaceOptimizer::untangleSurface
deleteDemandDrivenData(mapperPtr);
if( nInvertedTria != 0 )
{
//- the procedure has given up without success
//- there exist some remaining inverted faces in the mesh
polyMeshGen& mesh =
const_cast<polyMeshGen&>(surfaceEngine_.mesh());
label subsetId = mesh.pointSubsetIndex(badPointsSubsetName_);
if( subsetId >= 0 )
mesh.removePointSubset(subsetId);
subsetId = mesh.addPointSubset(badPointsSubsetName_);
forAll(smoothVertex, bpI)
if( smoothVertex[bpI] )
mesh.addPointToSubset(subsetId, bPoints[bpI]);
}
Info << "Finished untangling the surface of the volume mesh" << endl;
return changed;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment