mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use face_type instead of FaceType typedef
This commit is contained in:
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -35,7 +36,7 @@ static void markPointNbrs
|
|||||||
boolList& okToCollapse
|
boolList& okToCollapse
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = surf.localFaces()[facei];
|
const triSurface::face_type& f = surf.localFaces()[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
@ -109,7 +110,7 @@ label collapseEdge(triSurface& surf, const scalar minLen)
|
|||||||
if (okToCollapse[facei])
|
if (okToCollapse[facei])
|
||||||
{
|
{
|
||||||
// Check edge lengths.
|
// Check edge lengths.
|
||||||
const triSurface::FaceType& f = localFaces[facei];
|
const triSurface::face_type& f = localFaces[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -459,7 +459,7 @@ label sharedFace
|
|||||||
|
|
||||||
const edge& e = surf.edges()[sharedEdgeI];
|
const edge& e = surf.edges()[sharedEdgeI];
|
||||||
|
|
||||||
const triSurface::FaceType& f = surf.localFaces()[firstFacei];
|
const triSurface::face_type& f = surf.localFaces()[firstFacei];
|
||||||
|
|
||||||
label startIndex = f.find(e.start());
|
label startIndex = f.find(e.start());
|
||||||
|
|
||||||
@ -611,13 +611,13 @@ void renumberFaces
|
|||||||
const triSurface& surf,
|
const triSurface& surf,
|
||||||
const labelList& pointMap,
|
const labelList& pointMap,
|
||||||
const Map<label>& faceToEdge,
|
const Map<label>& faceToEdge,
|
||||||
List<triSurface::FaceType>& newTris
|
List<triSurface::face_type>& newTris
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAllConstIters(faceToEdge, iter)
|
forAllConstIters(faceToEdge, iter)
|
||||||
{
|
{
|
||||||
const label facei = iter.key();
|
const label facei = iter.key();
|
||||||
const triSurface::FaceType& f = surf.localFaces()[facei];
|
const triSurface::face_type& f = surf.localFaces()[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
@ -932,7 +932,7 @@ int main(int argc, char *argv[])
|
|||||||
// Check if faces use unmoved points.
|
// Check if faces use unmoved points.
|
||||||
forAll(newTris, facei)
|
forAll(newTris, facei)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = newTris[facei];
|
const triSurface::face_type& f = newTris[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -54,7 +55,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
|||||||
scalarField& pointDistance = *pointDistancePtr_;
|
scalarField& pointDistance = *pointDistancePtr_;
|
||||||
|
|
||||||
const pointField& fromPatchPoints = fromPatch_.localPoints();
|
const pointField& fromPatchPoints = fromPatch_.localPoints();
|
||||||
const List<typename FromPatch::FaceType>& fromPatchFaces =
|
const List<typename FromPatch::face_type>& fromPatchFaces =
|
||||||
fromPatch_.localFaces();
|
fromPatch_.localFaces();
|
||||||
|
|
||||||
const pointField& toPatchPoints = toPatch_.localPoints();
|
const pointField& toPatchPoints = toPatch_.localPoints();
|
||||||
@ -79,7 +80,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
|||||||
{
|
{
|
||||||
doWeights = false;
|
doWeights = false;
|
||||||
|
|
||||||
const typename FromPatch::FaceType& hitFace =
|
const typename FromPatch::face_type& hitFace =
|
||||||
fromPatchFaces[proj[pointi].hitObject()];
|
fromPatchFaces[proj[pointi].hitObject()];
|
||||||
|
|
||||||
point hitPoint = Zero;
|
point hitPoint = Zero;
|
||||||
@ -284,7 +285,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
|
|||||||
// A hit exists
|
// A hit exists
|
||||||
faceAddressing[facei] = proj[facei].hitObject();
|
faceAddressing[facei] = proj[facei].hitObject();
|
||||||
|
|
||||||
const typename FromPatch::FaceType& hitFace =
|
const typename FromPatch::face_type& hitFace =
|
||||||
fromPatchFaces[faceAddressing[facei]];
|
fromPatchFaces[faceAddressing[facei]];
|
||||||
|
|
||||||
pointHit curHit =
|
pointHit curHit =
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -58,7 +59,7 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::pointInterpolate
|
|||||||
|
|
||||||
Field<Type>& result = tresult.ref();
|
Field<Type>& result = tresult.ref();
|
||||||
|
|
||||||
const List<typename FromPatch::FaceType>& fromPatchLocalFaces =
|
const List<typename FromPatch::face_type>& fromPatchLocalFaces =
|
||||||
fromPatch_.localFaces();
|
fromPatch_.localFaces();
|
||||||
|
|
||||||
const FieldField<Field, scalar>& weights = pointWeights();
|
const FieldField<Field, scalar>& weights = pointWeights();
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -60,7 +61,7 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToPointWeights() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pointField& points = patch_.localPoints();
|
const pointField& points = patch_.localPoints();
|
||||||
const List<typename Patch::FaceType>& faces = patch_.localFaces();
|
const List<typename Patch::face_type>& faces = patch_.localFaces();
|
||||||
|
|
||||||
faceToPointWeightsPtr_ = new scalarListList(points.size());
|
faceToPointWeightsPtr_ = new scalarListList(points.size());
|
||||||
scalarListList& weights = *faceToPointWeightsPtr_;
|
scalarListList& weights = *faceToPointWeightsPtr_;
|
||||||
@ -116,7 +117,7 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToEdgeWeights() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pointField& points = patch_.localPoints();
|
const pointField& points = patch_.localPoints();
|
||||||
const List<typename Patch::FaceType>& faces = patch_.localFaces();
|
const List<typename Patch::face_type>& faces = patch_.localFaces();
|
||||||
const edgeList& edges = patch_.edges();
|
const edgeList& edges = patch_.edges();
|
||||||
const labelListList& edgeFaces = patch_.edgeFaces();
|
const labelListList& edgeFaces = patch_.edgeFaces();
|
||||||
|
|
||||||
@ -253,7 +254,7 @@ tmp<Field<Type>> PrimitivePatchInterpolation<Patch>::pointToFaceInterpolate
|
|||||||
|
|
||||||
Field<Type>& result = tresult.ref();
|
Field<Type>& result = tresult.ref();
|
||||||
|
|
||||||
const List<typename Patch::FaceType>& localFaces = patch_.localFaces();
|
const List<typename Patch::face_type>& localFaces = patch_.localFaces();
|
||||||
|
|
||||||
forAll(result, facei)
|
forAll(result, facei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -219,7 +219,7 @@ void Foam::PatchTools::calcBounds
|
|||||||
nPoints = 0;
|
nPoints = 0;
|
||||||
bb = boundBox::invertedBox;
|
bb = boundBox::invertedBox;
|
||||||
|
|
||||||
for (const Face& f : p)
|
for (const auto& f : p)
|
||||||
{
|
{
|
||||||
for (const label pointi : f)
|
for (const label pointi : f)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2015-2019 OpenCFD Ltd.
|
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -51,7 +51,6 @@ void Foam::treeDataPrimitivePatch<PatchType>::update()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
template<class PatchType>
|
template<class PatchType>
|
||||||
Foam::treeDataPrimitivePatch<PatchType>::treeDataPrimitivePatch
|
Foam::treeDataPrimitivePatch<PatchType>::treeDataPrimitivePatch
|
||||||
(
|
(
|
||||||
@ -166,8 +165,8 @@ Foam::volumeType Foam::treeDataPrimitivePatch<PatchType>::getVolumeType
|
|||||||
<< " nearest face:" << facei;
|
<< " nearest face:" << facei;
|
||||||
}
|
}
|
||||||
|
|
||||||
const typename PatchType::FaceType& localF = patch_.localFaces()[facei];
|
const typename PatchType::face_type& localF = patch_.localFaces()[facei];
|
||||||
const typename PatchType::FaceType& f = patch_[facei];
|
const typename PatchType::face_type& f = patch_[facei];
|
||||||
const pointField& points = patch_.points();
|
const pointField& points = patch_.points();
|
||||||
const labelList& mp = patch_.meshPoints();
|
const labelList& mp = patch_.meshPoints();
|
||||||
|
|
||||||
@ -380,7 +379,7 @@ bool Foam::treeDataPrimitivePatch<PatchType>::overlaps
|
|||||||
// 2. Check if one or more face points inside
|
// 2. Check if one or more face points inside
|
||||||
|
|
||||||
const pointField& points = patch_.points();
|
const pointField& points = patch_.points();
|
||||||
const typename PatchType::FaceType& f = patch_[index];
|
const typename PatchType::face_type& f = patch_[index];
|
||||||
|
|
||||||
if (cubeBb.containsAny(points, f))
|
if (cubeBb.containsAny(points, f))
|
||||||
{
|
{
|
||||||
@ -478,7 +477,7 @@ void Foam::treeDataPrimitivePatch<PatchType>::findNearestOp::operator()
|
|||||||
|
|
||||||
for (const label index : indices)
|
for (const label index : indices)
|
||||||
{
|
{
|
||||||
const typename PatchType::FaceType& f = patch[index];
|
const typename PatchType::face_type& f = patch[index];
|
||||||
|
|
||||||
const pointHit nearHit = f.nearestPoint(sample, points);
|
const pointHit nearHit = f.nearestPoint(sample, points);
|
||||||
const scalar distSqr = sqr(nearHit.distance());
|
const scalar distSqr = sqr(nearHit.distance());
|
||||||
@ -560,7 +559,7 @@ bool Foam::treeDataPrimitivePatch<PatchType>::findSelfIntersectOp::operator()
|
|||||||
const treeDataPrimitivePatch<PatchType>& shape = tree_.shapes();
|
const treeDataPrimitivePatch<PatchType>& shape = tree_.shapes();
|
||||||
const PatchType& patch = shape.patch();
|
const PatchType& patch = shape.patch();
|
||||||
|
|
||||||
const typename PatchType::FaceType& f = patch.localFaces()[index];
|
const typename PatchType::face_type& f = patch.localFaces()[index];
|
||||||
const edge& e = patch.edges()[edgeID_];
|
const edge& e = patch.edges()[edgeID_];
|
||||||
|
|
||||||
if (!f.found(e[0]) && !f.found(e[1]))
|
if (!f.found(e[0]) && !f.found(e[1]))
|
||||||
@ -586,7 +585,7 @@ bool Foam::treeDataPrimitivePatch<PatchType>::findIntersection
|
|||||||
const PatchType& patch = shape.patch();
|
const PatchType& patch = shape.patch();
|
||||||
|
|
||||||
const pointField& points = patch.points();
|
const pointField& points = patch.points();
|
||||||
const typename PatchType::FaceType& f = patch[index];
|
const typename PatchType::face_type& f = patch[index];
|
||||||
|
|
||||||
// Do quick rejection test
|
// Do quick rejection test
|
||||||
if (shape.cacheBb_)
|
if (shape.cacheBb_)
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -38,9 +39,9 @@ void Foam::meshTools::writeOBJ
|
|||||||
|
|
||||||
label vertI = 0;
|
label vertI = 0;
|
||||||
|
|
||||||
forAll(faceLabels, i)
|
for (const label facei : faceLabels)
|
||||||
{
|
{
|
||||||
const FaceType& f = faces[faceLabels[i]];
|
const FaceType& f = faces[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -92,7 +92,7 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const
|
|||||||
facesPerEdge.clear();
|
facesPerEdge.clear();
|
||||||
for (const label facei : pFaces)
|
for (const label facei : pFaces)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = triSurface::operator[](facei);
|
const triSurface::face_type& f = triSurface::operator[](facei);
|
||||||
const label fp = f.find(pointi);
|
const label fp = f.find(pointi);
|
||||||
|
|
||||||
// Something weird: if I expand the code of addFaceToEdge in both
|
// Something weird: if I expand the code of addFaceToEdge in both
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2015 OpenCFD Ltd.
|
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -43,7 +43,7 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(edgeIntersections, 0);
|
defineTypeNameAndDebug(edgeIntersections, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Foam::scalar Foam::edgeIntersections::alignedCos_ = Foam::cos(degToRad(89.0));
|
Foam::scalar Foam::edgeIntersections::alignedCos_ = Foam::cos(degToRad(89.0));
|
||||||
@ -383,14 +383,12 @@ bool Foam::edgeIntersections::offsetPerturb
|
|||||||
bool hasPerturbed = false;
|
bool hasPerturbed = false;
|
||||||
|
|
||||||
// For all hits on edge
|
// For all hits on edge
|
||||||
forAll(hits, i)
|
for (const pointIndexHit& pHit : hits)
|
||||||
{
|
{
|
||||||
const pointIndexHit& pHit = hits[i];
|
|
||||||
|
|
||||||
// Classify point on face of surface2
|
// Classify point on face of surface2
|
||||||
label surf2Facei = pHit.index();
|
const label surf2Facei = pHit.index();
|
||||||
|
|
||||||
const triSurface::FaceType& f2 = surf2.localFaces()[surf2Facei];
|
const triSurface::face_type& f2 = surf2.localFaces()[surf2Facei];
|
||||||
const pointField& surf2Pts = surf2.localPoints();
|
const pointField& surf2Pts = surf2.localPoints();
|
||||||
|
|
||||||
const point ctr = f2.centre(surf2Pts);
|
const point ctr = f2.centre(surf2Pts);
|
||||||
@ -440,7 +438,6 @@ bool Foam::edgeIntersections::offsetPerturb
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct null
|
|
||||||
Foam::edgeIntersections::edgeIntersections()
|
Foam::edgeIntersections::edgeIntersections()
|
||||||
:
|
:
|
||||||
List<List<pointIndexHit>>(),
|
List<List<pointIndexHit>>(),
|
||||||
@ -475,7 +472,6 @@ Foam::edgeIntersections::edgeIntersections
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
Foam::edgeIntersections::edgeIntersections
|
Foam::edgeIntersections::edgeIntersections
|
||||||
(
|
(
|
||||||
const List<List<pointIndexHit>>& intersections,
|
const List<List<pointIndexHit>>& intersections,
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2015-2018 OpenCFD Ltd.
|
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -41,7 +41,7 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(surfaceIntersection, 0);
|
defineTypeNameAndDebug(surfaceIntersection, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Foam::Enum
|
const Foam::Enum
|
||||||
@ -283,7 +283,7 @@ void Foam::surfaceIntersection::classifyHit
|
|||||||
|
|
||||||
// Classify point on surface2
|
// Classify point on surface2
|
||||||
|
|
||||||
const triSurface::FaceType& f2 = surf2.localFaces()[surf2Facei];
|
const triSurface::face_type& f2 = surf2.localFaces()[surf2Facei];
|
||||||
const pointField& surf1Pts = surf1.localPoints();
|
const pointField& surf1Pts = surf1.localPoints();
|
||||||
const pointField& surf2Pts = surf2.localPoints();
|
const pointField& surf2Pts = surf2.localPoints();
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,24 +35,31 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(orientedSurface, 0);
|
defineTypeNameAndDebug(orientedSurface, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
// True if edge is used in opposite order in faces
|
||||||
|
template<class Face>
|
||||||
|
static inline bool consistentEdge
|
||||||
|
(
|
||||||
|
const edge& e,
|
||||||
|
const Face& f0,
|
||||||
|
const Face& f1
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return (f0.edgeDirection(e) > 0) ^ (f1.edgeDirection(e) > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// Return true if edge is used in opposite order in faces
|
|
||||||
bool Foam::orientedSurface::consistentEdge
|
|
||||||
(
|
|
||||||
const edge& e,
|
|
||||||
const triSurface::FaceType& f0,
|
|
||||||
const triSurface::FaceType& f1
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return (f0.edgeDirection(e) > 0) ^ (f1.edgeDirection(e) > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::labelList Foam::orientedSurface::faceToEdge
|
Foam::labelList Foam::orientedSurface::faceToEdge
|
||||||
(
|
(
|
||||||
const triSurface& s,
|
const triSurface& s,
|
||||||
@ -61,13 +69,11 @@ Foam::labelList Foam::orientedSurface::faceToEdge
|
|||||||
labelList changedEdges(3*changedFaces.size());
|
labelList changedEdges(3*changedFaces.size());
|
||||||
label changedI = 0;
|
label changedI = 0;
|
||||||
|
|
||||||
forAll(changedFaces, i)
|
for (const label facei : changedFaces)
|
||||||
{
|
{
|
||||||
const labelList& fEdges = s.faceEdges()[changedFaces[i]];
|
for (const label edgei : s.faceEdges()[facei])
|
||||||
|
|
||||||
forAll(fEdges, j)
|
|
||||||
{
|
{
|
||||||
changedEdges[changedI++] = fEdges[j];
|
changedEdges[changedI++] = edgei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changedEdges.setSize(changedI);
|
changedEdges.setSize(changedI);
|
||||||
@ -86,10 +92,8 @@ Foam::labelList Foam::orientedSurface::edgeToFace
|
|||||||
labelList changedFaces(2*changedEdges.size());
|
labelList changedFaces(2*changedEdges.size());
|
||||||
label changedI = 0;
|
label changedI = 0;
|
||||||
|
|
||||||
forAll(changedEdges, i)
|
for (const label edgeI : changedEdges)
|
||||||
{
|
{
|
||||||
label edgeI = changedEdges[i];
|
|
||||||
|
|
||||||
const labelList& eFaces = s.edgeFaces()[edgeI];
|
const labelList& eFaces = s.edgeFaces()[edgeI];
|
||||||
|
|
||||||
if (eFaces.size() < 2)
|
if (eFaces.size() < 2)
|
||||||
@ -98,11 +102,11 @@ Foam::labelList Foam::orientedSurface::edgeToFace
|
|||||||
}
|
}
|
||||||
else if (eFaces.size() == 2)
|
else if (eFaces.size() == 2)
|
||||||
{
|
{
|
||||||
label face0 = eFaces[0];
|
const label face0 = eFaces[0];
|
||||||
label face1 = eFaces[1];
|
const label face1 = eFaces[1];
|
||||||
|
|
||||||
const triSurface::FaceType& f0 = s.localFaces()[face0];
|
const triSurface::face_type& f0 = s.localFaces()[face0];
|
||||||
const triSurface::FaceType& f1 = s.localFaces()[face1];
|
const triSurface::face_type& f1 = s.localFaces()[face1];
|
||||||
|
|
||||||
if (flip[face0] == UNVISITED)
|
if (flip[face0] == UNVISITED)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -45,7 +46,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward Declarations
|
||||||
class triSurfaceSearch;
|
class triSurfaceSearch;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -72,14 +73,6 @@ private:
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Return true if edge is used in opposite order in faces
|
|
||||||
static bool consistentEdge
|
|
||||||
(
|
|
||||||
const edge& e,
|
|
||||||
const triSurface::FaceType& f0,
|
|
||||||
const triSurface::FaceType& f1
|
|
||||||
);
|
|
||||||
|
|
||||||
//- From changed faces get the changed edges
|
//- From changed faces get the changed edges
|
||||||
static labelList faceToEdge
|
static labelList faceToEdge
|
||||||
(
|
(
|
||||||
@ -145,7 +138,7 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
orientedSurface();
|
orientedSurface();
|
||||||
|
|
||||||
//- Construct from triSurface and sample point which is either
|
//- Construct from triSurface and sample point which is either
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -1062,7 +1062,7 @@ void Foam::triSurfaceTools::snapToEnd
|
|||||||
if (current.elementType() == triPointRef::NONE)
|
if (current.elementType() == triPointRef::NONE)
|
||||||
{
|
{
|
||||||
// endpoint on point; current on triangle
|
// endpoint on point; current on triangle
|
||||||
const triSurface::FaceType& f = s.localFaces()[current.index()];
|
const triSurface::face_type& f = s.localFaces()[current.index()];
|
||||||
|
|
||||||
if (f.found(end.index()))
|
if (f.found(end.index()))
|
||||||
{
|
{
|
||||||
@ -1443,7 +1443,7 @@ Foam::label Foam::triSurfaceTools::oppositeVertex
|
|||||||
const label edgeI
|
const label edgeI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = surf.localFaces()[facei];
|
const triSurface::face_type& f = surf.localFaces()[facei];
|
||||||
const edge& e = surf.edges()[edgeI];
|
const edge& e = surf.edges()[edgeI];
|
||||||
|
|
||||||
for (const label pointi : f)
|
for (const label pointi : f)
|
||||||
@ -1958,7 +1958,7 @@ Foam::vector Foam::triSurfaceTools::surfaceNormal
|
|||||||
const point& nearestPt
|
const point& nearestPt
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = surf[nearestFacei];
|
const triSurface::face_type& f = surf[nearestFacei];
|
||||||
const pointField& points = surf.points();
|
const pointField& points = surf.points();
|
||||||
|
|
||||||
label nearType, nearLabel;
|
label nearType, nearLabel;
|
||||||
@ -1989,7 +1989,7 @@ Foam::vector Foam::triSurfaceTools::surfaceNormal
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Nearest to point
|
// Nearest to point
|
||||||
const triSurface::FaceType& localF = surf.localFaces()[nearestFacei];
|
const triSurface::face_type& localF = surf.localFaces()[nearestFacei];
|
||||||
return surf.pointNormals()[localF[nearLabel]];
|
return surf.pointNormals()[localF[nearLabel]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2039,7 +2039,7 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
|
|||||||
const label nearestFacei
|
const label nearestFacei
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = surf[nearestFacei];
|
const triSurface::face_type& f = surf[nearestFacei];
|
||||||
const pointField& points = surf.points();
|
const pointField& points = surf.points();
|
||||||
|
|
||||||
// Find where point is on face
|
// Find where point is on face
|
||||||
@ -2135,7 +2135,7 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
|
|||||||
// above (nearType == triPointRef::EDGE).
|
// above (nearType == triPointRef::EDGE).
|
||||||
|
|
||||||
|
|
||||||
const triSurface::FaceType& localF = surf.localFaces()[nearestFacei];
|
const triSurface::face_type& localF = surf.localFaces()[nearestFacei];
|
||||||
label nearPointi = localF[nearLabel];
|
label nearPointi = localF[nearLabel];
|
||||||
|
|
||||||
const edgeList& edges = surf.edges();
|
const edgeList& edges = surf.edges();
|
||||||
|
|||||||
@ -1106,19 +1106,16 @@ Foam::label Foam::distributedTriSurfaceMesh::findOtherFace
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const triSurface& surf = static_cast<const triSurface&>(*this);
|
const triSurface& surf = static_cast<const triSurface&>(*this);
|
||||||
const triSurface::FaceType& nearF = surf[nearFacei];
|
const triSurface::face_type& nearF = surf[nearFacei];
|
||||||
|
|
||||||
const edge e(nearF[nearLabel], nearF[nearF.fcIndex(nearLabel)]);
|
const edge e(nearF[nearLabel], nearF[nearF.fcIndex(nearLabel)]);
|
||||||
|
|
||||||
const labelList& pFaces = pointFaces[e[0]];
|
const labelList& pFaces = pointFaces[e[0]];
|
||||||
forAll(pFaces, pFacei)
|
for (const label facei : pFaces)
|
||||||
{
|
{
|
||||||
const label facei = pFaces[pFacei];
|
|
||||||
if (facei != nearFacei)
|
if (facei != nearFacei)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = surf[facei];
|
int dir = surf[facei].edgeDirection(e);
|
||||||
|
|
||||||
int dir = f.edgeDirection(e);
|
|
||||||
if (dir != 0)
|
if (dir != 0)
|
||||||
{
|
{
|
||||||
return facei;
|
return facei;
|
||||||
@ -1151,9 +1148,8 @@ void Foam::distributedTriSurfaceMesh::calcFaceFaces
|
|||||||
{
|
{
|
||||||
const edge e(f[fp], f[f.fcIndex(fp)]);
|
const edge e(f[fp], f[f.fcIndex(fp)]);
|
||||||
const labelList& pFaces = pointFaces[f[fp]];
|
const labelList& pFaces = pointFaces[f[fp]];
|
||||||
forAll(pFaces, pFacei)
|
for (const label otherFacei : pFaces)
|
||||||
{
|
{
|
||||||
const label otherFacei = pFaces[pFacei];
|
|
||||||
if (otherFacei != facei)
|
if (otherFacei != facei)
|
||||||
{
|
{
|
||||||
if (s[otherFacei].edgeDirection(e) != 0)
|
if (s[otherFacei].edgeDirection(e) != 0)
|
||||||
@ -1223,8 +1219,8 @@ void Foam::distributedTriSurfaceMesh::surfaceSide
|
|||||||
|
|
||||||
forAll(triangleIndex, i)
|
forAll(triangleIndex, i)
|
||||||
{
|
{
|
||||||
label facei = triangleIndex[i];
|
const label facei = triangleIndex[i];
|
||||||
const triSurface::FaceType& f = surf[facei];
|
const triSurface::face_type& f = surf[facei];
|
||||||
const point& sample = localSamples[i];
|
const point& sample = localSamples[i];
|
||||||
|
|
||||||
// Find where point is on face
|
// Find where point is on face
|
||||||
@ -1287,10 +1283,9 @@ void Foam::distributedTriSurfaceMesh::surfaceSide
|
|||||||
scalar maxCosAngle = -GREAT;
|
scalar maxCosAngle = -GREAT;
|
||||||
labelPair maxEdgeFaces(-1, -1);
|
labelPair maxEdgeFaces(-1, -1);
|
||||||
|
|
||||||
forAll(pFaces, pFacei)
|
for (const label facei : pFaces)
|
||||||
{
|
{
|
||||||
label facei = pFaces[pFacei];
|
const triSurface::face_type& f = surf[facei];
|
||||||
const triSurface::FaceType& f = surf[facei];
|
|
||||||
|
|
||||||
label fp = f.find(pointi);
|
label fp = f.find(pointi);
|
||||||
label p1 = f[f.fcIndex(fp)];
|
label p1 = f[f.fcIndex(fp)];
|
||||||
@ -1716,10 +1711,8 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
|||||||
// Find bounding box for all triangles on new distribution.
|
// Find bounding box for all triangles on new distribution.
|
||||||
forAll(s, trii)
|
forAll(s, trii)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = s[trii];
|
|
||||||
|
|
||||||
treeBoundBox& bb = bbs[distribution[trii]][0];
|
treeBoundBox& bb = bbs[distribution[trii]][0];
|
||||||
bb.add(s.points(), f);
|
bb.add(s.points(), s[trii]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now combine for all processors and convert to correct format.
|
// Now combine for all processors and convert to correct format.
|
||||||
@ -1767,10 +1760,8 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
|||||||
// Find bounding box for all triangles on new distribution.
|
// Find bounding box for all triangles on new distribution.
|
||||||
forAll(s, trii)
|
forAll(s, trii)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = s[trii];
|
|
||||||
|
|
||||||
treeBoundBox& bb = bbs[distribution[trii]][0];
|
treeBoundBox& bb = bbs[distribution[trii]][0];
|
||||||
bb.add(s.points(), f);
|
bb.add(s.points(), s[trii]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now combine for all processors and convert to correct format.
|
// Now combine for all processors and convert to correct format.
|
||||||
@ -1967,10 +1958,8 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
|||||||
// // Find bounding box for all triangles on new distribution.
|
// // Find bounding box for all triangles on new distribution.
|
||||||
// forAll(s, trii)
|
// forAll(s, trii)
|
||||||
// {
|
// {
|
||||||
// const triSurface::FaceType& f = s[trii];
|
|
||||||
//
|
|
||||||
// treeBoundBox& bb = bbs[distribution[trii]][0];
|
// treeBoundBox& bb = bbs[distribution[trii]][0];
|
||||||
// bb.add(s.points(), f);
|
// bb.add(s.points(), s[trii]);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Now combine for all processors and convert to correct format.
|
// // Now combine for all processors and convert to correct format.
|
||||||
@ -2073,9 +2062,8 @@ Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
|
|||||||
|
|
||||||
forAll(s, trii)
|
forAll(s, trii)
|
||||||
{
|
{
|
||||||
const triSurface::FaceType& f = s[trii];
|
|
||||||
treeBoundBox& bb = bbs[distribution[trii]][0];
|
treeBoundBox& bb = bbs[distribution[trii]][0];
|
||||||
bb.add(s.points(), f);
|
bb.add(s.points(), s[trii]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now combine for all processors and convert to correct format.
|
// Now combine for all processors and convert to correct format.
|
||||||
@ -2160,12 +2148,8 @@ void Foam::distributedTriSurfaceMesh::subsetMeshMap
|
|||||||
newToOldFaces[facei++] = oldFacei;
|
newToOldFaces[facei++] = oldFacei;
|
||||||
|
|
||||||
// Renumber labels for face
|
// Renumber labels for face
|
||||||
const triSurface::FaceType& f = s[oldFacei];
|
for (const label oldPointi : s[oldFacei])
|
||||||
|
|
||||||
forAll(f, fp)
|
|
||||||
{
|
{
|
||||||
label oldPointi = f[fp];
|
|
||||||
|
|
||||||
if (oldToNewPoints[oldPointi] == -1)
|
if (oldToNewPoints[oldPointi] == -1)
|
||||||
{
|
{
|
||||||
oldToNewPoints[oldPointi] = pointi;
|
oldToNewPoints[oldPointi] = pointi;
|
||||||
@ -2273,12 +2257,8 @@ Foam::triSurface Foam::distributedTriSurfaceMesh::subsetMesh
|
|||||||
if (include[oldFacei])
|
if (include[oldFacei])
|
||||||
{
|
{
|
||||||
// Renumber labels for face
|
// Renumber labels for face
|
||||||
const triSurface::FaceType& f = s[oldFacei];
|
for (const label oldPointi : s[oldFacei])
|
||||||
|
|
||||||
forAll(f, fp)
|
|
||||||
{
|
{
|
||||||
label oldPointi = f[fp];
|
|
||||||
|
|
||||||
if (oldToNewPoints[oldPointi] == -1)
|
if (oldToNewPoints[oldPointi] == -1)
|
||||||
{
|
{
|
||||||
oldToNewPoints[oldPointi] = pointi;
|
oldToNewPoints[oldPointi] = pointi;
|
||||||
|
|||||||
Reference in New Issue
Block a user