mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Switch on and off curvature and closeness testing.
This commit is contained in:
@ -150,7 +150,7 @@ void drawHitProblem
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scalarField curvature(const triSurface& surf)
|
scalarField calcCurvature(const triSurface& surf)
|
||||||
{
|
{
|
||||||
scalarField k(surf.points().size(), 0);
|
scalarField k(surf.points().size(), 0);
|
||||||
|
|
||||||
@ -400,6 +400,16 @@ int main(int argc, char *argv[])
|
|||||||
"writeObj",
|
"writeObj",
|
||||||
"write extendedFeatureEdgeMesh obj files"
|
"write extendedFeatureEdgeMesh obj files"
|
||||||
);
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"writeVTK",
|
||||||
|
"write extendedFeatureEdgeMesh vtk files"
|
||||||
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"calcCurvature",
|
||||||
|
"calculate curvature and closeness fields"
|
||||||
|
);
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"closeness",
|
"closeness",
|
||||||
@ -422,7 +432,13 @@ int main(int argc, char *argv[])
|
|||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
if (env("FOAM_SIGFPE"))
|
bool writeVTK = args.optionFound("writeVTK");
|
||||||
|
|
||||||
|
bool writeObj = args.optionFound("writeObj");
|
||||||
|
|
||||||
|
bool curvature = args.optionFound("curvature");
|
||||||
|
|
||||||
|
if (curvature && env("FOAM_SIGFPE"))
|
||||||
{
|
{
|
||||||
WarningIn(args.executable())
|
WarningIn(args.executable())
|
||||||
<< "Detected floating point exception trapping (FOAM_SIGFPE)."
|
<< "Detected floating point exception trapping (FOAM_SIGFPE)."
|
||||||
@ -436,10 +452,6 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Feature line extraction is only valid on closed manifold surfaces."
|
Info<< "Feature line extraction is only valid on closed manifold surfaces."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
bool writeVTK = args.optionFound("writeVTK");
|
|
||||||
|
|
||||||
bool writeObj = args.optionFound("writeObj");
|
|
||||||
|
|
||||||
const fileName surfFileName = args[1];
|
const fileName surfFileName = args[1];
|
||||||
const fileName outFileName = args[2];
|
const fileName outFileName = args[2];
|
||||||
|
|
||||||
@ -669,6 +681,13 @@ int main(int argc, char *argv[])
|
|||||||
surf
|
surf
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!curvature)
|
||||||
|
{
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Find close features
|
// Find close features
|
||||||
|
|
||||||
// // Dummy trim operation to mark features
|
// // Dummy trim operation to mark features
|
||||||
@ -736,7 +755,8 @@ int main(int argc, char *argv[])
|
|||||||
// )
|
// )
|
||||||
// );
|
// );
|
||||||
|
|
||||||
// Examine curvature, feature proximity and internal and external closeness.
|
Info<< "Examine curvature, feature proximity and internal and "
|
||||||
|
<< "external closeness." << endl;
|
||||||
|
|
||||||
// Internal and external closeness
|
// Internal and external closeness
|
||||||
|
|
||||||
@ -930,7 +950,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
externalClosenessField.write();
|
externalClosenessField.write();
|
||||||
|
|
||||||
scalarField k = curvature(surf);
|
scalarField k = calcCurvature(surf);
|
||||||
|
|
||||||
// Modify the curvature values on feature edges and points to be zero.
|
// Modify the curvature values on feature edges and points to be zero.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user