Commit bc1bdf9b authored by Franjo's avatar Franjo
Browse files

Bug fixes + additional FEATUREEDGE type

parent 4c2044ec
......@@ -69,7 +69,7 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
problematicPoint[bp[it.key()]] = true;
//- classify edges
edgeTypes_.setSize(edges.size());
edgeType_.setSize(edges.size());
# ifdef USE_OMP
label nThreads = 3 * omp_get_num_procs();
......@@ -81,12 +81,6 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
# pragma omp parallel num_threads(nThreads)
# endif
{
# ifdef USE_OMP
# pragma omp for schedule(static, 1)
# endif
forAll(edgeTypes_, edgeI)
edgeTypes_[edgeI] = NONE;
// TODO: this is not valid for non-manifold meshes
//- start checking feature edges
# ifdef USE_OMP
......@@ -94,26 +88,34 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
# endif
forAll(edgeFaces, edgeI)
{
edgeType_[edgeI] = NONE;
if( edgeFaces.sizeOfRow(edgeI) == 2 )
{
const label f0 = edgeFaces(edgeI, 0);
const label f1 = edgeFaces(edgeI, 1);
if( facePatch[f0] == facePatch[f1] )
edgeTypes_[edgeI] |= PATCHEDGE;
{
edgeType_[edgeI] |= PATCHEDGE;
}
else
{
edgeType_[edgeI] |= FEATUREEDGE;
}
const edge e = edges[edgeI];
//- check if the surface is tangled there
if( problematicPoint[bp[e.start()]] )
{
edgeTypes_[edgeI] |= UNDETERMINED;
edgeType_[edgeI] |= UNDETERMINED;
continue;
}
if( problematicPoint[bp[e.end()]] )
{
edgeTypes_[edgeI] |= UNDETERMINED;
edgeType_[edgeI] |= UNDETERMINED;
continue;
}
......@@ -128,7 +130,7 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
if( tet0.mag() > -VSMALL )
{
edgeTypes_[edgeI] |= CONCAVEEDGE;
edgeType_[edgeI] |= CONCAVEEDGE;
continue;
}
......@@ -142,11 +144,11 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
if( tet1.mag() > -VSMALL )
{
edgeTypes_[edgeI] |= CONCAVEEDGE;
edgeType_[edgeI] |= CONCAVEEDGE;
continue;
}
edgeTypes_[edgeI] |= CONVEXEDGE;
edgeType_[edgeI] |= CONVEXEDGE;
}
}
}
......@@ -175,7 +177,13 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
forAllConstIter(Map<label>, otherPatch, eIter)
{
if( eIter() == facePatch[edgeFaces(eIter.key(), 0)] )
continue;
{
edgeType_[eIter()] |= PATCHEDGE;
}
else
{
edgeType_[eIter()] |= FEATUREEDGE;
}
const edge& e = edges[eIter.key()];
if
......@@ -184,7 +192,7 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
problematicPoint[bp[e.end()]]
)
{
edgeTypes_[eIter.key()] |= UNDETERMINED;
edgeType_[eIter.key()] |= UNDETERMINED;
continue;
}
......@@ -231,7 +239,7 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
if ( tet0.mag() > -VSMALL )
{
edgeTypes_[edgeI] |= CONCAVEEDGE;
edgeType_[edgeI] |= CONCAVEEDGE;
continue;
}
......@@ -245,11 +253,11 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
if ( tet1.mag() > -VSMALL )
{
edgeTypes_[edgeI] |= CONCAVEEDGE;
edgeType_[edgeI] |= CONCAVEEDGE;
continue;
}
edgeTypes_[edgeI] |= CONVEXEDGE;
edgeType_[edgeI] |= CONVEXEDGE;
}
}
......@@ -264,27 +272,36 @@ void meshSurfaceCheckEdgeTypes::classifyEdges()
surfaceEngine_.boundaryPoints()[bpI]
);
forAll(edgeTypes_, edgeI)
const label convexId = mesh_.addPointSubset("convexFeatures");
const label concaveId = mesh_.addPointSubset("concaveFeatures");
const label undeterminedId = mesh_.addPointSubset("undetermnedFeatures");
const label patchId = mesh_.addPointSubset("patchPoints");
forAll(edgeType_, edgeI)
{
if( edgeTypes_[edgeI] & CONVEXEDGE )
if( edgeType_[edgeI] & CONVEXEDGE )
{
Info <<"Edge " << edgeI << " is convex" << endl;
mesh_.addPointToSubset(convexId, edges[edgeI].start());
mesh_.addPointToSubset(convexId, edges[edgeI].end());
}
else if( edgeTypes_[edgeI] & CONCAVEEDGE )
if( edgeType_[edgeI] & CONCAVEEDGE )
{
Info << "Edge " << edgeI << " is concave" << endl;
mesh_.addPointToSubset(concaveId, edges[edgeI].start());
mesh_.addPointToSubset(concaveId, edges[edgeI].end());
}
else if( edgeTypes_[edgeI] & UNDETERMINED )
if( edgeType_[edgeI] & UNDETERMINED )
{
Info << "Edge " << edgeI << " is not determined" << endl;
mesh_.addPointToSubset(undeterminedId, edges[edgeI].start());
mesh_.addPointToSubset(undeterminedId, edges[edgeI].end());
}
else if( edgeTypes_[edgeI] & PATCHEDGE )
if( edgeType_[edgeI] & PATCHEDGE )
{
Info << "Edge " << edgeI << " is a patch edge" << endl;
}
else
{
Info << "Drekec spekec" << edgeI << endl;
mesh_.addPointToSubset(patchId, edges[edgeI].start());
mesh_.addPointToSubset(patchId, edges[edgeI].end());
}
}
# endif
......@@ -298,7 +315,7 @@ meshSurfaceCheckEdgeTypes::meshSurfaceCheckEdgeTypes
)
:
surfaceEngine_(mse),
edgeTypes_()
edgeType_()
{
classifyEdges();
}
......@@ -314,9 +331,9 @@ void meshSurfaceCheckEdgeTypes::convexEdges(labelLongList& convexEdges) const
{
convexEdges.clear();
forAll(edgeTypes_, eI)
forAll(edgeType_, eI)
{
if( edgeTypes_[eI] & CONVEXEDGE )
if( edgeType_[eI] & CONVEXEDGE )
convexEdges.append(eI);
}
}
......@@ -325,9 +342,9 @@ void meshSurfaceCheckEdgeTypes::concaveEdges(labelLongList& concaveEdges) const
{
concaveEdges.clear();
forAll(edgeTypes_, eI)
forAll(edgeType_, eI)
{
if( edgeTypes_[eI] & CONCAVEEDGE )
if( edgeType_[eI] & CONCAVEEDGE )
concaveEdges.append(eI);
}
}
......
......@@ -60,7 +60,7 @@ class meshSurfaceCheckEdgeTypes
const meshSurfaceEngine& surfaceEngine_;
//- a list which classifies each edge
List<direction> edgeTypes_;
List<direction> edgeType_;
// Private member functions
//- check feature edges and classify them
......@@ -83,9 +83,10 @@ public:
{
NONE = 0,
PATCHEDGE = 1,
CONVEXEDGE = 2,
CONCAVEEDGE = 4,
UNDETERMINED = 8
FEATUREEDGE = 2,
CONVEXEDGE = 4,
CONCAVEEDGE = 8,
UNDETERMINED = 16
};
// Constructors
......@@ -101,7 +102,7 @@ public:
//- return the information about classified edges
const List<direction>& edgeTypes() const
{
return edgeTypes_;
return edgeType_;
}
//- return indices of convex edges
......
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