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)
|
||||
{
|
||||
dictionary surfaceDict = dict.subDict(iter().keyword());
|
||||
const dictionary& surfaceDict = iter().dict();
|
||||
|
||||
const fileName surfFileName = iter().keyword();
|
||||
const fileName sFeatFileName = surfFileName.lessExt().name();
|
||||
@ -549,16 +549,16 @@ int main(int argc, char *argv[])
|
||||
Info<< "Surface : " << surfFileName << nl << endl;
|
||||
|
||||
const Switch writeVTK =
|
||||
surfaceDict.lookupOrAddDefault<Switch>("writeVTK", "off");
|
||||
surfaceDict.lookupOrDefault<Switch>("writeVTK", "off");
|
||||
const Switch writeObj =
|
||||
surfaceDict.lookupOrAddDefault<Switch>("writeObj", "off");
|
||||
surfaceDict.lookupOrDefault<Switch>("writeObj", "off");
|
||||
|
||||
const Switch curvature =
|
||||
surfaceDict.lookupOrAddDefault<Switch>("curvature", "off");
|
||||
surfaceDict.lookupOrDefault<Switch>("curvature", "off");
|
||||
const Switch featureProximity =
|
||||
surfaceDict.lookupOrAddDefault<Switch>("featureProximity", "off");
|
||||
surfaceDict.lookupOrDefault<Switch>("featureProximity", "off");
|
||||
const Switch closeness =
|
||||
surfaceDict.lookupOrAddDefault<Switch>("closeness", "off");
|
||||
surfaceDict.lookupOrDefault<Switch>("closeness", "off");
|
||||
|
||||
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.
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
surfaceFeatures set(surf);
|
||||
|
||||
@ -697,7 +697,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (surfaceDict.isDict("subsetFeatures"))
|
||||
{
|
||||
dictionary subsetDict = surfaceDict.subDict("subsetFeatures");
|
||||
const dictionary& subsetDict = surfaceDict.subDict
|
||||
(
|
||||
"subsetFeatures"
|
||||
);
|
||||
|
||||
if (subsetDict.found("insideBox"))
|
||||
{
|
||||
@ -731,7 +734,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
const Switch manifoldEdges =
|
||||
subsetDict.lookupOrAddDefault<Switch>("manifoldEdges", "no");
|
||||
subsetDict.lookupOrDefault<Switch>("manifoldEdges", "no");
|
||||
|
||||
if (manifoldEdges)
|
||||
{
|
||||
@ -784,10 +787,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
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
|
||||
<< nl << endl;
|
||||
|
||||
const Switch flip = subsetDict["flip"];
|
||||
|
||||
extendedFeatureEdgeMesh addFeMesh
|
||||
(
|
||||
IOobject
|
||||
@ -803,6 +813,14 @@ int main(int argc, char *argv[])
|
||||
Info<< "Read " << addFeMesh.name() << nl;
|
||||
writeStats(addFeMesh, Info);
|
||||
|
||||
if (flip)
|
||||
{
|
||||
Info<< "Flipping " << addFeMesh.name() << endl;
|
||||
addFeMesh.flipNormals();
|
||||
Info<< "After flipping " << addFeMesh.name() << nl;
|
||||
writeStats(addFeMesh, Info);
|
||||
}
|
||||
|
||||
feMesh.add(addFeMesh);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user