surfaceFeatures: Separated "closness" option into "faceCloseness" and "pointCloseness"
For complex geometries the calculation of surface face and point "closeness" can be quite time consuming and usually only one or other is required; the new options allow the user to specify which should be calculated and written.
This commit is contained in:
@ -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) 2018-2019 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -172,8 +172,10 @@ 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 closeness =
|
const Switch faceCloseness =
|
||||||
dict.lookupOrDefault<Switch>("closeness", "off");
|
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 "
|
||||||
@ -424,7 +426,7 @@ namespace Foam
|
|||||||
|
|
||||||
|
|
||||||
// Find distance between close features
|
// Find distance between close features
|
||||||
if (closeness)
|
if (faceCloseness || pointCloseness)
|
||||||
{
|
{
|
||||||
Info<< nl << "Extracting internal and external closeness of "
|
Info<< nl << "Extracting internal and external closeness of "
|
||||||
<< "surface." << endl;
|
<< "surface." << endl;
|
||||||
@ -442,13 +444,19 @@ namespace Foam
|
|||||||
surf
|
surf
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (faceCloseness)
|
||||||
{
|
{
|
||||||
Pair<tmp<triSurfaceScalarField>> closenessFields
|
Pair<tmp<triSurfaceScalarField>> closenessFields
|
||||||
(
|
(
|
||||||
searchSurf.extractCloseness()
|
searchSurf.extractCloseness()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Info<< " writing "
|
||||||
|
<< closenessFields.first()->name() << endl;
|
||||||
closenessFields.first()->write();
|
closenessFields.first()->write();
|
||||||
|
|
||||||
|
Info<< " writing "
|
||||||
|
<< closenessFields.second()->name() << endl;
|
||||||
closenessFields.second()->write();
|
closenessFields.second()->write();
|
||||||
|
|
||||||
if (writeVTK)
|
if (writeVTK)
|
||||||
@ -481,13 +489,19 @@ namespace Foam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pointCloseness)
|
||||||
{
|
{
|
||||||
Pair<tmp<triSurfacePointScalarField >> closenessFields
|
Pair<tmp<triSurfacePointScalarField >> closenessFields
|
||||||
(
|
(
|
||||||
searchSurf.extractPointCloseness()
|
searchSurf.extractPointCloseness()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Info<< " writing "
|
||||||
|
<< closenessFields.first()->name() << endl;
|
||||||
closenessFields.first()->write();
|
closenessFields.first()->write();
|
||||||
|
|
||||||
|
Info<< " writing "
|
||||||
|
<< closenessFields.second()->name() << endl;
|
||||||
closenessFields.second()->write();
|
closenessFields.second()->write();
|
||||||
|
|
||||||
if (writeVTK)
|
if (writeVTK)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
object surfaceFeatureExtractDict;
|
object surfaceFeaturesDict;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -99,8 +99,11 @@ surface2
|
|||||||
// points and edges
|
// points and edges
|
||||||
maxFeatureProximity 1;
|
maxFeatureProximity 1;
|
||||||
|
|
||||||
// Out put the closeness of surface elements to other surface elements.
|
// Output the closeness of surface elements to other surface elements.
|
||||||
closeness no;
|
faceCloseness no;
|
||||||
|
|
||||||
|
// Output the closeness of surface points to other surface elements.
|
||||||
|
pointCloseness no;
|
||||||
|
|
||||||
// Write features to obj format for postprocessing
|
// Write features to obj format for postprocessing
|
||||||
writeObj yes;
|
writeObj yes;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
object surfaceFeatureExtractDict;
|
object surfaceFeaturesDict;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -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) 2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,42 +40,45 @@ void Foam::triSurfaceMesh::drawHitProblem
|
|||||||
const pointIndexHitList& hitInfo
|
const pointIndexHitList& hitInfo
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const List<labelledTri>& tris = *this;
|
if (debug)
|
||||||
const pointField& points = this->points();
|
|
||||||
|
|
||||||
Info<< nl << "# findLineAll did not hit its own face."
|
|
||||||
<< nl << "# fi " << fi
|
|
||||||
<< nl << "# start " << start
|
|
||||||
<< nl << "# point " << p
|
|
||||||
<< nl << "# end " << end
|
|
||||||
<< nl << "# hitInfo " << hitInfo
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
meshTools::writeOBJ(Info, start);
|
|
||||||
meshTools::writeOBJ(Info, p);
|
|
||||||
meshTools::writeOBJ(Info, end);
|
|
||||||
|
|
||||||
Info<< "l 1 2 3" << endl;
|
|
||||||
|
|
||||||
meshTools::writeOBJ(Info, points[tris[fi][0]]);
|
|
||||||
meshTools::writeOBJ(Info, points[tris[fi][1]]);
|
|
||||||
meshTools::writeOBJ(Info, points[tris[fi][2]]);
|
|
||||||
|
|
||||||
Info<< "f 4 5 6" << endl;
|
|
||||||
|
|
||||||
forAll(hitInfo, hi)
|
|
||||||
{
|
{
|
||||||
label hfi = hitInfo[hi].index();
|
const List<labelledTri>& tris = *this;
|
||||||
|
const pointField& points = this->points();
|
||||||
|
|
||||||
meshTools::writeOBJ(Info, points[tris[hfi][0]]);
|
Info<< nl << "# findLineAll did not hit its own face."
|
||||||
meshTools::writeOBJ(Info, points[tris[hfi][1]]);
|
<< nl << "# fi " << fi
|
||||||
meshTools::writeOBJ(Info, points[tris[hfi][2]]);
|
<< nl << "# start " << start
|
||||||
|
<< nl << "# point " << p
|
||||||
Info<< "f "
|
<< nl << "# end " << end
|
||||||
<< 3*hi + 7 << " "
|
<< nl << "# hitInfo " << hitInfo
|
||||||
<< 3*hi + 8 << " "
|
|
||||||
<< 3*hi + 9
|
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
meshTools::writeOBJ(Info, start);
|
||||||
|
meshTools::writeOBJ(Info, p);
|
||||||
|
meshTools::writeOBJ(Info, end);
|
||||||
|
|
||||||
|
Info<< "l 1 2 3" << endl;
|
||||||
|
|
||||||
|
meshTools::writeOBJ(Info, points[tris[fi][0]]);
|
||||||
|
meshTools::writeOBJ(Info, points[tris[fi][1]]);
|
||||||
|
meshTools::writeOBJ(Info, points[tris[fi][2]]);
|
||||||
|
|
||||||
|
Info<< "f 4 5 6" << endl;
|
||||||
|
|
||||||
|
forAll(hitInfo, hi)
|
||||||
|
{
|
||||||
|
label hfi = hitInfo[hi].index();
|
||||||
|
|
||||||
|
meshTools::writeOBJ(Info, points[tris[hfi][0]]);
|
||||||
|
meshTools::writeOBJ(Info, points[tris[hfi][1]]);
|
||||||
|
meshTools::writeOBJ(Info, points[tris[hfi][2]]);
|
||||||
|
|
||||||
|
Info<< "f "
|
||||||
|
<< 3*hi + 7 << " "
|
||||||
|
<< 3*hi + 8 << " "
|
||||||
|
<< 3*hi + 9
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user