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:
@ -172,10 +172,6 @@ namespace Foam
|
|||||||
dict.lookupOrDefault<Switch>("curvature", "off");
|
dict.lookupOrDefault<Switch>("curvature", "off");
|
||||||
const Switch featureProximity =
|
const Switch featureProximity =
|
||||||
dict.lookupOrDefault<Switch>("featureProximity", "off");
|
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 "
|
Info<< nl << "Feature line extraction is only valid on closed manifold "
|
||||||
@ -426,11 +422,34 @@ namespace Foam
|
|||||||
|
|
||||||
|
|
||||||
// Find distance between close features
|
// Find distance between close features
|
||||||
if (faceCloseness || pointCloseness)
|
if (dict.isDict("closeness"))
|
||||||
{
|
{
|
||||||
Info<< nl << "Extracting internal and external closeness of "
|
Info<< nl << "Extracting internal and external closeness of "
|
||||||
<< "surface." << endl;
|
<< "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
|
// Searchable triSurface
|
||||||
const triSurfaceMesh searchSurf
|
const triSurfaceMesh searchSurf
|
||||||
(
|
(
|
||||||
@ -448,7 +467,11 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
Pair<tmp<triSurfaceScalarField>> closenessFields
|
Pair<tmp<triSurfaceScalarField>> closenessFields
|
||||||
(
|
(
|
||||||
searchSurf.extractCloseness()
|
searchSurf.extractCloseness
|
||||||
|
(
|
||||||
|
internalAngleTolerance,
|
||||||
|
externalAngleTolerance
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< " writing "
|
Info<< " writing "
|
||||||
@ -491,7 +514,11 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
Pair<tmp<triSurfacePointScalarField >> closenessFields
|
Pair<tmp<triSurfacePointScalarField >> closenessFields
|
||||||
(
|
(
|
||||||
searchSurf.extractPointCloseness(10, 10)
|
searchSurf.extractPointCloseness
|
||||||
|
(
|
||||||
|
internalAngleTolerance,
|
||||||
|
externalAngleTolerance
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< " writing "
|
Info<< " writing "
|
||||||
|
|||||||
@ -100,11 +100,18 @@ surface2
|
|||||||
// points and edges
|
// points and edges
|
||||||
maxFeatureProximity 1;
|
maxFeatureProximity 1;
|
||||||
|
|
||||||
// Output the closeness of surface elements to other surface elements.
|
closeness
|
||||||
faceCloseness no;
|
{
|
||||||
|
// Output the closeness of surface elements to other surface elements.
|
||||||
|
faceCloseness no;
|
||||||
|
|
||||||
// Output the closeness of surface points to other surface elements.
|
// Output the closeness of surface points to other surface elements.
|
||||||
pointCloseness no;
|
pointCloseness no;
|
||||||
|
|
||||||
|
// Optional maximum angle between opposite points considered close
|
||||||
|
internalAngleTolerance 80;
|
||||||
|
externalAngleTolerance 80;
|
||||||
|
}
|
||||||
|
|
||||||
// Write features to obj format for postprocessing
|
// Write features to obj format for postprocessing
|
||||||
writeObj yes;
|
writeObj yes;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -318,7 +318,7 @@ public:
|
|||||||
Pair<tmp<triSurfaceScalarField>> extractCloseness
|
Pair<tmp<triSurfaceScalarField>> extractCloseness
|
||||||
(
|
(
|
||||||
const scalar internalAngleTolerance = 80,
|
const scalar internalAngleTolerance = 80,
|
||||||
const scalar externalAngleTolerance = 10
|
const scalar externalAngleTolerance = 80
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Return a pair of triSurfaceScalarPointFields representing the
|
//- Return a pair of triSurfaceScalarPointFields representing the
|
||||||
@ -326,7 +326,7 @@ public:
|
|||||||
Pair<tmp<triSurfacePointScalarField>> extractPointCloseness
|
Pair<tmp<triSurfacePointScalarField>> extractPointCloseness
|
||||||
(
|
(
|
||||||
const scalar internalAngleTolerance = 80,
|
const scalar internalAngleTolerance = 80,
|
||||||
const scalar externalAngleTolerance = 10
|
const scalar externalAngleTolerance = 80
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,8 +47,11 @@ pipeWall
|
|||||||
// - 180: selects all edges
|
// - 180: selects all edges
|
||||||
includedAngle 150;
|
includedAngle 150;
|
||||||
|
|
||||||
// Output the closeness of surface points to other surface elements.
|
closeness
|
||||||
pointCloseness yes;
|
{
|
||||||
|
// Output the closeness of surface points to other surface elements.
|
||||||
|
pointCloseness yes;
|
||||||
|
}
|
||||||
|
|
||||||
writeVTK yes;
|
writeVTK yes;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user