mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Move longestEdge function to face.H as a global function
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -829,4 +829,26 @@ Foam::label Foam::face::trianglesQuads
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::longestEdge(const face& f, const pointField& pts)
|
||||
{
|
||||
const edgeList& eds = f.edges();
|
||||
|
||||
label longestEdgeI = -1;
|
||||
scalar longestEdgeLength = -SMALL;
|
||||
|
||||
forAll(eds, edI)
|
||||
{
|
||||
scalar edgeLength = eds[edI].mag(pts);
|
||||
|
||||
if (edgeLength > longestEdgeLength)
|
||||
{
|
||||
longestEdgeI = edI;
|
||||
longestEdgeLength = edgeLength;
|
||||
}
|
||||
}
|
||||
|
||||
return longestEdgeI;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -408,6 +408,12 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// Global functions
|
||||
|
||||
//- Find the longest edge on a face. Face point labels index into pts.
|
||||
label longestEdge(const face& f, const pointField& pts);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -42,32 +42,6 @@ defineTypeNameAndDebug(edgeCollapser, 0);
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::edgeCollapser::longestEdge
|
||||
(
|
||||
const face& f,
|
||||
const pointField& pts
|
||||
)
|
||||
{
|
||||
const edgeList& eds = f.edges();
|
||||
|
||||
label longestEdgeI = -1;
|
||||
scalar longestEdgeLength = -SMALL;
|
||||
|
||||
forAll(eds, edI)
|
||||
{
|
||||
scalar edgeLength = eds[edI].mag(pts);
|
||||
|
||||
if (edgeLength > longestEdgeLength)
|
||||
{
|
||||
longestEdgeI = edI;
|
||||
longestEdgeLength = edgeLength;
|
||||
}
|
||||
}
|
||||
|
||||
return longestEdgeI;
|
||||
}
|
||||
|
||||
|
||||
Foam::HashSet<Foam::label> Foam::edgeCollapser::checkBadFaces
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
|
||||
@ -262,9 +262,6 @@ public:
|
||||
|
||||
// Check
|
||||
|
||||
//- Find the longest edge in a face
|
||||
static label longestEdge(const face& f, const pointField& pts);
|
||||
|
||||
//- Calls motionSmoother::checkMesh and returns a set of bad faces
|
||||
static HashSet<label> checkBadFaces
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user