Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
f443931e
Commit
f443931e
authored
Dec 11, 2012
by
laurence
Browse files
ENH: Make set an autoPtr. Remove flip switch.
parent
9f61b912
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C
View file @
f443931e
...
...
@@ -761,7 +761,7 @@ int main(int argc, char *argv[])
// Either construct features from surface & featureAngle or read set.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
surfaceFeatures
set
(
surf
)
;
autoPtr
<
surfaceFeatures
>
set
;
scalar
includedAngle
=
-
1
;
...
...
@@ -781,7 +781,7 @@ int main(int argc, char *argv[])
Info
<<
nl
<<
"Reading existing feature edges from file "
<<
featureEdgeFile
<<
endl
;
set
=
surfaceFeatures
(
surf
,
eMesh
.
points
(),
eMesh
.
edges
());
set
.
set
(
new
surfaceFeatures
(
surf
,
eMesh
.
points
(),
eMesh
.
edges
())
)
;
}
else
if
(
extractionMethod
==
"extractFromSurface"
)
{
...
...
@@ -796,7 +796,7 @@ int main(int argc, char *argv[])
Info
<<
nl
<<
"Constructing feature set from included angle "
<<
includedAngle
<<
endl
;
set
=
surfaceFeatures
(
surf
,
includedAngle
);
set
.
set
(
new
surfaceFeatures
(
surf
,
includedAngle
)
)
;
}
else
{
...
...
@@ -807,16 +807,6 @@ int main(int argc, char *argv[])
<<
exit
(
FatalError
);
}
Info
<<
nl
<<
"Initial feature set:"
<<
nl
<<
" feature points : "
<<
set
.
featurePoints
().
size
()
<<
nl
<<
" feature edges : "
<<
set
.
featureEdges
().
size
()
<<
nl
<<
" of which"
<<
nl
<<
" region edges : "
<<
set
.
nRegionEdges
()
<<
nl
<<
" external edges : "
<<
set
.
nExternalEdges
()
<<
nl
<<
" internal edges : "
<<
set
.
nInternalEdges
()
<<
nl
<<
endl
;
// Trim set
// ~~~~~~~~
...
...
@@ -838,7 +828,7 @@ int main(int argc, char *argv[])
Info
<<
"Removing features with number of edges < "
<<
minElem
<<
endl
;
set
.
trimFeatures
(
minLen
,
minElem
);
set
()
.
trimFeatures
(
minLen
,
minElem
);
}
}
...
...
@@ -847,7 +837,7 @@ int main(int argc, char *argv[])
// ~~~~~~
// Convert to marked edges, points
List
<
surfaceFeatures
::
edgeStatus
>
edgeStat
(
set
.
toStatus
());
List
<
surfaceFeatures
::
edgeStatus
>
edgeStat
(
set
()
.
toStatus
());
if
(
surfaceDict
.
isDict
(
"subsetFeatures"
))
{
...
...
@@ -940,6 +930,16 @@ int main(int argc, char *argv[])
surfaceFeatures
newSet
(
surf
);
newSet
.
setFromStatus
(
edgeStat
);
Info
<<
nl
<<
"Initial feature set:"
<<
nl
<<
" feature points : "
<<
newSet
.
featurePoints
().
size
()
<<
nl
<<
" feature edges : "
<<
newSet
.
featureEdges
().
size
()
<<
nl
<<
" of which"
<<
nl
<<
" region edges : "
<<
newSet
.
nRegionEdges
()
<<
nl
<<
" external edges : "
<<
newSet
.
nExternalEdges
()
<<
nl
<<
" internal edges : "
<<
newSet
.
nInternalEdges
()
<<
nl
<<
endl
;
//if (writeObj)
//{
// newSet.writeObj("final");
...
...
@@ -956,17 +956,10 @@ int main(int argc, char *argv[])
if
(
surfaceDict
.
isDict
(
"addFeatures"
))
{
const
dictionary
&
subsetDict
=
surfaceDict
.
subDict
(
"addFeatures"
);
const
word
addFeName
=
subsetDict
[
"name"
];
const
word
addFeName
=
surfaceDict
.
subDict
(
"addFeatures"
)[
"name"
];
Info
<<
"Adding (without merging) features from "
<<
addFeName
<<
nl
<<
endl
;
const
Switch
flip
=
subsetDict
[
"flip"
];
extendedFeatureEdgeMesh
addFeMesh
(
IOobject
...
...
@@ -982,14 +975,6 @@ 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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment