Commit 79593777 authored by mattijs's avatar mattijs
Browse files

avoid cellEdges

parent 1b2c360e
......@@ -282,8 +282,7 @@ const Foam::labelList& Foam::polyPatch::meshEdges() const
primitivePatch::meshEdges
(
boundaryMesh().mesh().edges(),
boundaryMesh().mesh().cellEdges(),
faceCells()
boundaryMesh().mesh().pointEdges()
)
);
}
......
......@@ -362,16 +362,27 @@ const Foam::labelList& Foam::faceZone::meshEdges() const
{
if (!mePtr_)
{
labelList faceCells(size());
const labelList& own = zoneMesh().mesh().faceOwner();
const labelList& faceLabels = *this;
forAll (faceCells, faceI)
{
faceCells[faceI] = own[faceLabels[faceI]];
}
//labelList faceCells(size());
//
//const labelList& own = zoneMesh().mesh().faceOwner();
//
//const labelList& faceLabels = *this;
//
//forAll (faceCells, faceI)
//{
// faceCells[faceI] = own[faceLabels[faceI]];
//}
//
//mePtr_ =
// new labelList
// (
// operator()().meshEdges
// (
// zoneMesh().mesh().edges(),
// zoneMesh().mesh().cellEdges(),
// faceCells
// )
// );
mePtr_ =
new labelList
......@@ -379,8 +390,7 @@ const Foam::labelList& Foam::faceZone::meshEdges() const
operator()().meshEdges
(
zoneMesh().mesh().edges(),
zoneMesh().mesh().cellEdges(),
faceCells
zoneMesh().mesh().pointEdges()
)
);
}
......
......@@ -348,7 +348,8 @@ public:
// index in the edge list. If the edge is not found, return -1
label whichEdge(const edge& e) const;
//- Return labels of patch edges in the global edge list
//- Return labels of patch edges in the global edge list using
// cell addressing
labelList meshEdges
(
const edgeList& allEdges,
......@@ -356,6 +357,14 @@ public:
const labelList& faceCells
) const;
//- Return labels of patch edges in the global edge list using
// basic edge addressing.
labelList meshEdges
(
const edgeList& allEdges,
const labelListList& pointEdges
) const;
//- Return face normals for patch
const Field<PointType>& faceNormals() const;
......
......@@ -111,6 +111,60 @@ labelList PrimitivePatch<Face, FaceList, PointField, PointType>::meshEdges
}
template
<
class Face,
template<class> class FaceList,
class PointField,
class PointType
>
labelList PrimitivePatch<Face, FaceList, PointField, PointType>::meshEdges
(
const edgeList& allEdges,
const labelListList& pointEdges
) const
{
if (debug)
{
Info<< "labelList PrimitivePatch<Face, FaceList, PointField, PointType>"
<< "::meshEdges() : "
<< "calculating labels of patch edges in mesh edge list"
<< endl;
}
// get reference to the list of edges on the patch
const edgeList& PatchEdges = edges();
// create the storage
labelList meshEdges(PatchEdges.size());
// get reference to the points on the patch
const labelList& pp = meshPoints();
// WARNING: Remember that local edges address into local point list;
// local-to-global point label translation is necessary
forAll (PatchEdges, edgeI)
{
const label globalPointI = pp[PatchEdges[edgeI].start()];
const edge curEdge(globalPointI, pp[PatchEdges[edgeI].end()]);
const labelList& pe = pointEdges[globalPointI];
forAll (pe, i)
{
if (allEdges[pe[i]] == curEdge)
{
meshEdges[edgeI] = pe[i];
break;
}
}
}
return meshEdges;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
......
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