mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: calcPointEdges: Use invertManyToMany. Comment out the edge sorting.
This commit is contained in:
@ -28,6 +28,7 @@ Description
|
|||||||
|
|
||||||
#include "PrimitivePatch.H"
|
#include "PrimitivePatch.H"
|
||||||
#include "SLList.H"
|
#include "SLList.H"
|
||||||
|
#include "ListOps.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
@ -62,34 +63,11 @@ calcPointEdges() const
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
const edgeList& e = edges();
|
pointEdgesPtr_ = new labelListList(meshPoints().size());
|
||||||
|
|
||||||
// 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());
|
|
||||||
|
|
||||||
labelListList& pe = *pointEdgesPtr_;
|
labelListList& pe = *pointEdgesPtr_;
|
||||||
|
|
||||||
forAll(pointEdges, pointI)
|
invertManyToMany(pe.size(), edges(), pe);
|
||||||
{
|
|
||||||
const SLList<label>& pEdge = pointEdges[pointI];
|
|
||||||
|
|
||||||
pe[pointI].setSize(pEdge.size());
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
forAllConstIter(SLList<label>, pEdge, iter)
|
|
||||||
{
|
|
||||||
pe[pointI][i++] = iter();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -97,6 +75,76 @@ calcPointEdges() const
|
|||||||
<< "calcPointEdges() finished calculating pointEdges"
|
<< "calcPointEdges() finished calculating pointEdges"
|
||||||
<< endl;
|
<< 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;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user