mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: surfaceFeatureExtract: allow flipping. Code cleanup.
This commit is contained in:
@ -541,7 +541,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAllConstIter(dictionary, dict, iter)
|
forAllConstIter(dictionary, dict, iter)
|
||||||
{
|
{
|
||||||
dictionary surfaceDict = dict.subDict(iter().keyword());
|
const dictionary& surfaceDict = iter().dict();
|
||||||
|
|
||||||
const fileName surfFileName = iter().keyword();
|
const fileName surfFileName = iter().keyword();
|
||||||
const fileName sFeatFileName = surfFileName.lessExt().name();
|
const fileName sFeatFileName = surfFileName.lessExt().name();
|
||||||
@ -549,16 +549,16 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Surface : " << surfFileName << nl << endl;
|
Info<< "Surface : " << surfFileName << nl << endl;
|
||||||
|
|
||||||
const Switch writeVTK =
|
const Switch writeVTK =
|
||||||
surfaceDict.lookupOrAddDefault<Switch>("writeVTK", "off");
|
surfaceDict.lookupOrDefault<Switch>("writeVTK", "off");
|
||||||
const Switch writeObj =
|
const Switch writeObj =
|
||||||
surfaceDict.lookupOrAddDefault<Switch>("writeObj", "off");
|
surfaceDict.lookupOrDefault<Switch>("writeObj", "off");
|
||||||
|
|
||||||
const Switch curvature =
|
const Switch curvature =
|
||||||
surfaceDict.lookupOrAddDefault<Switch>("curvature", "off");
|
surfaceDict.lookupOrDefault<Switch>("curvature", "off");
|
||||||
const Switch featureProximity =
|
const Switch featureProximity =
|
||||||
surfaceDict.lookupOrAddDefault<Switch>("featureProximity", "off");
|
surfaceDict.lookupOrDefault<Switch>("featureProximity", "off");
|
||||||
const Switch closeness =
|
const Switch closeness =
|
||||||
surfaceDict.lookupOrAddDefault<Switch>("closeness", "off");
|
surfaceDict.lookupOrDefault<Switch>("closeness", "off");
|
||||||
|
|
||||||
const word extractionMethod = surfaceDict.lookup("extractionMethod");
|
const word extractionMethod = surfaceDict.lookup("extractionMethod");
|
||||||
|
|
||||||
@ -606,7 +606,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// Either construct features from surface & featureAngle or read set.
|
// Either construct features from surface & featureAngle or read set.
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
surfaceFeatures set(surf);
|
surfaceFeatures set(surf);
|
||||||
|
|
||||||
@ -697,7 +697,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (surfaceDict.isDict("subsetFeatures"))
|
if (surfaceDict.isDict("subsetFeatures"))
|
||||||
{
|
{
|
||||||
dictionary subsetDict = surfaceDict.subDict("subsetFeatures");
|
const dictionary& subsetDict = surfaceDict.subDict
|
||||||
|
(
|
||||||
|
"subsetFeatures"
|
||||||
|
);
|
||||||
|
|
||||||
if (subsetDict.found("insideBox"))
|
if (subsetDict.found("insideBox"))
|
||||||
{
|
{
|
||||||
@ -731,7 +734,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Switch manifoldEdges =
|
const Switch manifoldEdges =
|
||||||
subsetDict.lookupOrAddDefault<Switch>("manifoldEdges", "no");
|
subsetDict.lookupOrDefault<Switch>("manifoldEdges", "no");
|
||||||
|
|
||||||
if (manifoldEdges)
|
if (manifoldEdges)
|
||||||
{
|
{
|
||||||
@ -784,10 +787,17 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (surfaceDict.isDict("addFeatures"))
|
if (surfaceDict.isDict("addFeatures"))
|
||||||
{
|
{
|
||||||
const word addFeName = surfaceDict.subDict("addFeatures")["name"];
|
const dictionary& subsetDict = surfaceDict.subDict
|
||||||
|
(
|
||||||
|
"addFeatures"
|
||||||
|
);
|
||||||
|
|
||||||
|
const word addFeName = subsetDict["name"];
|
||||||
Info<< "Adding (without merging) features from " << addFeName
|
Info<< "Adding (without merging) features from " << addFeName
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
|
|
||||||
|
const Switch flip = subsetDict["flip"];
|
||||||
|
|
||||||
extendedFeatureEdgeMesh addFeMesh
|
extendedFeatureEdgeMesh addFeMesh
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -803,6 +813,14 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Read " << addFeMesh.name() << nl;
|
Info<< "Read " << addFeMesh.name() << nl;
|
||||||
writeStats(addFeMesh, Info);
|
writeStats(addFeMesh, Info);
|
||||||
|
|
||||||
|
if (flip)
|
||||||
|
{
|
||||||
|
Info<< "Flipping " << addFeMesh.name() << endl;
|
||||||
|
addFeMesh.flipNormals();
|
||||||
|
Info<< "After flipping " << addFeMesh.name() << nl;
|
||||||
|
writeStats(addFeMesh, Info);
|
||||||
|
}
|
||||||
|
|
||||||
feMesh.add(addFeMesh);
|
feMesh.add(addFeMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user