surfaceFeatures: Added optional input of maximum angle between opposite points considered close

To handle the additional optional specification for the closeness calculation
these settings are now is a sub-dictionary of surfaceFeaturesDict, e.g.

    closeness
    {
        // Output the closeness of surface elements to other surface elements.
        faceCloseness           no;

        // Output the closeness of surface points to other surface elements.
        pointCloseness          yes;

        // Optional maximum angle between opposite points considered close
        internalAngleTolerance  80;
        externalAngleTolerance  80;
    }
This commit is contained in:
Henry Weller
2020-03-16 19:29:28 +00:00
parent 99982d0358
commit fbe98c6e84
4 changed files with 53 additions and 16 deletions

View File

@ -172,10 +172,6 @@ namespace Foam
dict.lookupOrDefault<Switch>("curvature", "off");
const Switch featureProximity =
dict.lookupOrDefault<Switch>("featureProximity", "off");
const Switch faceCloseness =
dict.lookupOrDefault<Switch>("faceCloseness", "off");
const Switch pointCloseness =
dict.lookupOrDefault<Switch>("pointCloseness", "off");
Info<< nl << "Feature line extraction is only valid on closed manifold "
@ -426,11 +422,34 @@ namespace Foam
// Find distance between close features
if (faceCloseness || pointCloseness)
if (dict.isDict("closeness"))
{
Info<< nl << "Extracting internal and external closeness of "
<< "surface." << endl;
const dictionary& closenessDict = dict.subDict("closeness");
const Switch faceCloseness =
closenessDict.lookupOrDefault<Switch>("faceCloseness", "off");
const Switch pointCloseness =
closenessDict.lookupOrDefault<Switch>("pointCloseness", "off");
const scalar internalAngleTolerance
(
closenessDict.lookupOrDefault<scalar>
(
"internalAngleTolerance", 80
)
);
const scalar externalAngleTolerance
(
closenessDict.lookupOrDefault<scalar>
(
"externalAngleTolerance", 80
)
);
// Searchable triSurface
const triSurfaceMesh searchSurf
(
@ -448,7 +467,11 @@ namespace Foam
{
Pair<tmp<triSurfaceScalarField>> closenessFields
(
searchSurf.extractCloseness()
searchSurf.extractCloseness
(
internalAngleTolerance,
externalAngleTolerance
)
);
Info<< " writing "
@ -491,7 +514,11 @@ namespace Foam
{
Pair<tmp<triSurfacePointScalarField >> closenessFields
(
searchSurf.extractPointCloseness(10, 10)
searchSurf.extractPointCloseness
(
internalAngleTolerance,
externalAngleTolerance
)
);
Info<< " writing "

View File

@ -100,12 +100,19 @@ surface2
// points and edges
maxFeatureProximity 1;
closeness
{
// Output the closeness of surface elements to other surface elements.
faceCloseness no;
// Output the closeness of surface points to other surface elements.
pointCloseness no;
// Optional maximum angle between opposite points considered close
internalAngleTolerance 80;
externalAngleTolerance 80;
}
// Write features to obj format for postprocessing
writeObj yes;
verboseObj no;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -318,7 +318,7 @@ public:
Pair<tmp<triSurfaceScalarField>> extractCloseness
(
const scalar internalAngleTolerance = 80,
const scalar externalAngleTolerance = 10
const scalar externalAngleTolerance = 80
) const;
//- Return a pair of triSurfaceScalarPointFields representing the
@ -326,7 +326,7 @@ public:
Pair<tmp<triSurfacePointScalarField>> extractPointCloseness
(
const scalar internalAngleTolerance = 80,
const scalar externalAngleTolerance = 10
const scalar externalAngleTolerance = 80
) const;

View File

@ -47,8 +47,11 @@ pipeWall
// - 180: selects all edges
includedAngle 150;
closeness
{
// Output the closeness of surface points to other surface elements.
pointCloseness yes;
}
writeVTK yes;
}