Skip to content
Snippets Groups Projects
Commit a2c8736f authored by laurence's avatar laurence
Browse files

ENH: calcPointEdges: Use invertManyToMany. Comment out the edge sorting.

parent f443931e
Branches
Tags
No related merge requests found
......@@ -28,6 +28,7 @@ Description
#include "PrimitivePatch.H"
#include "SLList.H"
#include "ListOps.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
......@@ -62,34 +63,11 @@ calcPointEdges() const
<< abort(FatalError);
}
const edgeList& e = edges();
// set up storage for pointEdges
List<SLList<label> > pointEdges(meshPoints().size());
forAll(e, edgeI)
{
pointEdges[e[edgeI].start()].append(edgeI);
pointEdges[e[edgeI].end()].append(edgeI);
}
// sort out the list
pointEdgesPtr_ = new labelListList(pointEdges.size());
pointEdgesPtr_ = new labelListList(meshPoints().size());
labelListList& pe = *pointEdgesPtr_;
forAll(pointEdges, pointI)
{
const SLList<label>& pEdge = pointEdges[pointI];
pe[pointI].setSize(pEdge.size());
label i = 0;
forAllConstIter(SLList<label>, pEdge, iter)
{
pe[pointI][i++] = iter();
}
}
invertManyToMany(pe.size(), edges(), pe);
if (debug)
{
......@@ -97,6 +75,76 @@ calcPointEdges() const
<< "calcPointEdges() finished calculating pointEdges"
<< endl;
}
// Now order the edges of each point according to whether they share a
// face
// DynamicList<label> newEdgeList;
// forAll(pe, pointI)
// {
// const labelList& pEdges = pe[pointI];
// label edgeI = pEdges[0];
// label prevFaceI = edgeFaces()[edgeI][0];
// newEdgeList.clear();
// newEdgeList.setCapacity(pEdges.size());
// do
// {
// newEdgeList.append(edgeI);
// // Cross edge to next face
// const labelList& eFaces = edgeFaces()[edgeI];
// if (eFaces.size() != 2)
// {
// break;
// }
// label faceI = eFaces[0];
// if (faceI == prevFaceI)
// {
// faceI = eFaces[1];
// }
// // Cross face to next edge
// const labelList& fEdges = faceEdges()[faceI];
// forAll(fEdges, feI)
// {
// const label nextEdgeI = fEdges[feI];
// const edge& nextEdge = edges()[nextEdgeI];
// if
// (
// nextEdgeI != edgeI
// && (nextEdge.start() == pointI || nextEdge.end() == pointI)
// )
// {
// edgeI = nextEdgeI;
// break;
// }
// }
// prevFaceI = faceI;
// } while (edgeI != pEdges[0]);
// if (newEdgeList.size() == pEdges.size())
// {
// pe[pointI] = newEdgeList;
// }
// }
// if (debug)
// {
// Info<< "PrimitivePatch<Face, FaceList, PointField, PointType>::"
// << "calcPointEdges() finished ordering pointEdges"
// << endl;
// }
}
......
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