Commit 82a481a6 authored by Mark Olesen's avatar Mark Olesen
Browse files

PrimitivePatchExtra cosmetic changes

parent 7bb09fe4
......@@ -49,7 +49,7 @@ PrimitivePatchExtra
const Field<PointType>& points
)
:
PrimitivePatch<Face, FaceList, PointField, PointType>(faces, points),
ParentType(faces, points),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
{}
......@@ -69,7 +69,7 @@ PrimitivePatchExtra
const PrimitivePatchExtra<Face, FaceList, PointField, PointType>& pp
)
:
PrimitivePatch<Face, FaceList, PointField, PointType>(pp),
ParentType(pp),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
{}
......@@ -102,7 +102,7 @@ template
void Foam::PrimitivePatchExtra<Face, FaceList, PointField, PointType>::
clearOut()
{
PrimitivePatch<Face, FaceList, PointField, PointType>::clearOut();
ParentType::clearOut();
clearTopology();
}
......@@ -117,7 +117,7 @@ template
void Foam::PrimitivePatchExtra<Face, FaceList, PointField, PointType>::
clearTopology()
{
PrimitivePatch<Face, FaceList, PointField, PointType>::clearTopology();
ParentType::clearTopology();
deleteDemandDrivenData(sortedEdgeFacesPtr_);
deleteDemandDrivenData(edgeOwnerPtr_);
}
......
......@@ -70,7 +70,7 @@ public:
private:
// Private typedefs
typedef PrimitivePatch<Face, FaceList, PointField, PointType> TemplateType;
typedef PrimitivePatch<Face, FaceList, PointField, PointType> ParentType;
// Private data
......
......@@ -49,15 +49,19 @@ calcSortedEdgeFaces() const
{
if (sortedEdgeFacesPtr_)
{
FatalErrorIn("PrimitivePatchExtra<Face, FaceList, PointField>::calcSortedEdgeFaces()")
FatalErrorIn
(
"PrimitivePatchExtra<Face, FaceList, PointField>::"
"calcSortedEdgeFaces()"
)
<< "sortedEdgeFacesPtr_ already set"
<< abort(FatalError);
}
const labelListList& eFaces = TemplateType::edgeFaces();
const edgeList& edgeLst = TemplateType::edges();
const pointField& locPointLst = TemplateType::localPoints();
const List<Face>& locFaceLst = TemplateType::localFaces();
const labelListList& eFaces = this->edgeFaces();
const edgeList& edgeLst = this->edges();
const Field<PointType>& locPointLst = this->localPoints();
const List<Face>& locFaceLst = this->localFaces();
// create the lists for the various results. (resized on completion)
sortedEdgeFacesPtr_ = new labelListList(eFaces.size());
......@@ -146,21 +150,22 @@ calcEdgeOwner() const
{
if (edgeOwnerPtr_)
{
FatalErrorIn("PrimitivePatchExtra<Face, FaceList, PointField>::calcEdgeOwner()")
FatalErrorIn
(
"PrimitivePatchExtra<Face, FaceList, PointField>::"
"calcEdgeOwner()"
)
<< "edgeOwnerPtr_ already set"
<< abort(FatalError);
}
// create the owner list
edgeOwnerPtr_ = new labelList
(
TemplateType::nEdges()
);
edgeOwnerPtr_ = new labelList(this->nEdges());
labelList& edgeOwner = *edgeOwnerPtr_;
const edgeList& edgeLst = TemplateType::edges();
const labelListList& eFaces = TemplateType::edgeFaces();
const List<Face>& locFaceLst = TemplateType::localFaces();
const edgeList& edgeLst = this->edges();
const labelListList& eFaces = this->edgeFaces();
const List<Face>& locFaceLst = this->localFaces();
forAll(edgeLst, edgeI)
......@@ -192,7 +197,11 @@ calcEdgeOwner() const
if (edgeOwner[edgeI] == -1)
{
FatalErrorIn("PrimitivePatchExtra<Face, FaceList, PointField>::calcEdgeOwner()")
FatalErrorIn
(
"PrimitivePatchExtra<Face, FaceList, PointField>::"
"calcEdgeOwner()"
)
<< "Edge " << edgeI << " vertices:" << e
<< " is used by faces " << myFaces
<< " vertices:"
......
......@@ -44,8 +44,8 @@ checkEdges
const bool verbose
) const
{
const labelListList& eFaces = TemplateType::edgeFaces();
const edgeList& edgeLst = TemplateType::edges();
const labelListList& eFaces = this->edgeFaces();
const edgeList& edgeLst = this->edges();
forAll(eFaces, edgeI)
{
......@@ -55,7 +55,10 @@ checkEdges
// interior edges have two faces
if (myFaces.size() == 0)
{
FatalErrorIn("PrimitivePatchExtra::checkEdges(bool verbose)")
FatalErrorIn
(
"PrimitivePatchExtra::checkEdges(bool verbose)"
)
<< "Edge " << edgeI << " with vertices " << edgeLst[edgeI]
<< " has no edgeFaces"
<< exit(FatalError);
......@@ -65,7 +68,8 @@ checkEdges
WarningIn
(
"PrimitivePatchExtra::checkEdges(bool verbose)"
) << "Edge " << edgeI << " with vertices " << edgeLst[edgeI]
)
<< "Edge " << edgeI << " with vertices " << edgeLst[edgeI]
<< " has more than 2 faces connected to it : " << myFaces
<< endl;
}
......@@ -89,11 +93,11 @@ checkOrientation
) const
{
const FaceList<Face>& faceLst = *this;
const edgeList& edgeLst = TemplateType::edges();
const labelListList& faceEs = TemplateType::faceEdges();
const label numEdges = TemplateType::nEdges();
const pointField& pointLst = TemplateType::points();
const vectorField& normLst = TemplateType::faceNormals();
const edgeList& edgeLst = this->edges();
const labelListList& faceEs = this->faceEdges();
const label numEdges = this->nEdges();
const Field<PointType>& pointLst = this->points();
const vectorField& normLst = this->faceNormals();
// Check edge normals, face normals, point normals.
forAll(faceEs, faceI)
......@@ -102,7 +106,10 @@ checkOrientation
if (edgeLabels.size() < 3)
{
FatalErrorIn("PrimitivePatchExtra::checkOrientation(bool)")
FatalErrorIn
(
"PrimitivePatchExtra::checkOrientation(bool)"
)
<< "face " << faceLst[faceI]
<< " has fewer than 3 edges. Edges:" << edgeLabels
<< exit(FatalError);
......@@ -116,9 +123,10 @@ checkOrientation
WarningIn
(
"PrimitivePatchExtra::checkOrientation(bool)"
) << "edge number " << edgeLabels[i] << " on face " << faceI
)
<< "edge number " << edgeLabels[i] << " on face " << faceI
<< " out-of-range\n"
<< "This usually means that the input surface has "
<< "This usually means the input surface has "
<< "edges with more than 2 faces connected.\n"
<< endl;
valid = false;
......@@ -141,20 +149,23 @@ checkOrientation
const vector pointNormal((p1 - p0) ^ (p2 - p0));
if ((pointNormal & normLst[faceI]) < 0)
{
FatalErrorIn("PrimitivePatchExtra::checkOrientation(bool)")
<< "Normal calculated from points not consistent with"
" faceNormal" << endl
<< "face: " << f << endl
<< "points: " << p0 << ' ' << p1 << ' ' << p2 << endl
<< "pointNormal:" << pointNormal << endl
FatalErrorIn
(
"PrimitivePatchExtra::checkOrientation(bool)"
)
<< "Normal calculated from points not consistent with "
<< "faceNormal" << nl
<< "face: " << f << nl
<< "points: " << p0 << ' ' << p1 << ' ' << p2 << nl
<< "pointNormal:" << pointNormal << nl
<< "faceNormal:" << normLst[faceI]
<< exit(FatalError);
}
}
const labelListList& eFaces = TemplateType::edgeFaces();
const pointField& locPointsLst = TemplateType::localPoints();
const labelListList& eFaces = this->edgeFaces();
const pointField& locPointsLst = this->localPoints();
// Storage for holding status of edge.
// True if normal flips across this edge
......@@ -182,7 +193,10 @@ checkOrientation
borderEdge[edgeI] = true;
if (verbose)
{
WarningIn("PrimitivePatchExtra::checkOrientation(bool)")
WarningIn
(
"PrimitivePatchExtra::checkOrientation(bool)"
)
<< "face orientation incorrect." << nl
<< "edge[" << edgeI << "] " << e
<< " between faces " << neighbours << ":" << nl
......@@ -195,10 +209,13 @@ checkOrientation
{
if (verbose)
{
WarningIn("PrimitivePatchExtra::checkOrientation(bool)")
<< "Wrong number of edge neighbours." << endl
WarningIn
(
"PrimitivePatchExtra::checkOrientation(bool)"
)
<< "Wrong number of edge neighbours." << nl
<< "edge[" << edgeI << "] " << e
<< "with points:" << locPointsLst[e.start()]
<< " with points:" << locPointsLst[e.start()]
<< ' ' << locPointsLst[e.end()]
<< " has neighbours:" << neighbours << endl;
}
......
......@@ -48,8 +48,8 @@ void Foam::PrimitivePatchExtra<Face, FaceList, PointField, PointType>::markZone
// List of faces whose faceZone has been set.
labelList changedFaces(1, faceI);
const labelListList& faceEs = TemplateType::faceEdges();
const labelListList& eFaces = TemplateType::edgeFaces();
const labelListList& faceEs = this->faceEdges();
const labelListList& eFaces = this->edgeFaces();
while (true)
{
......@@ -124,8 +124,8 @@ markZones
labelList& faceZone
) const
{
const label numEdges = TemplateType::nEdges();
const label numFaces = TemplateType::size();
const label numEdges = this->nEdges();
const label numFaces = this->size();
if (borderEdge.size() != numEdges)
{
......@@ -190,8 +190,8 @@ subsetMap
labelList& faceMap
) const
{
const List<Face>& locFaces = TemplateType::localFaces();
const label numPoints = TemplateType::nPoints();
const List<Face>& locFaces = this->localFaces();
const label numPoints = this->nPoints();
label faceI = 0;
label pointI = 0;
......
Supports Markdown
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