Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
f443931e
Commit
f443931e
authored
12 years ago
by
laurence
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Make set an autoPtr. Remove flip switch.
parent
9f61b912
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C
+16
-31
16 additions, 31 deletions
...ies/surface/surfaceFeatureExtract/surfaceFeatureExtract.C
with
16 additions
and
31 deletions
applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C
+
16
−
31
View file @
f443931e
...
@@ -761,7 +761,7 @@ int main(int argc, char *argv[])
...
@@ -761,7 +761,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
)
;
autoPtr
<
surfaceFeatures
>
set
;
scalar
includedAngle
=
-
1
;
scalar
includedAngle
=
-
1
;
...
@@ -781,7 +781,7 @@ int main(int argc, char *argv[])
...
@@ -781,7 +781,7 @@ int main(int argc, char *argv[])
Info
<<
nl
<<
"Reading existing feature edges from file "
Info
<<
nl
<<
"Reading existing feature edges from file "
<<
featureEdgeFile
<<
endl
;
<<
featureEdgeFile
<<
endl
;
set
=
surfaceFeatures
(
surf
,
eMesh
.
points
(),
eMesh
.
edges
());
set
.
set
(
new
surfaceFeatures
(
surf
,
eMesh
.
points
(),
eMesh
.
edges
())
)
;
}
}
else
if
(
extractionMethod
==
"extractFromSurface"
)
else
if
(
extractionMethod
==
"extractFromSurface"
)
{
{
...
@@ -796,7 +796,7 @@ int main(int argc, char *argv[])
...
@@ -796,7 +796,7 @@ int main(int argc, char *argv[])
Info
<<
nl
<<
"Constructing feature set from included angle "
Info
<<
nl
<<
"Constructing feature set from included angle "
<<
includedAngle
<<
endl
;
<<
includedAngle
<<
endl
;
set
=
surfaceFeatures
(
surf
,
includedAngle
);
set
.
set
(
new
surfaceFeatures
(
surf
,
includedAngle
)
)
;
}
}
else
else
{
{
...
@@ -807,16 +807,6 @@ int main(int argc, char *argv[])
...
@@ -807,16 +807,6 @@ int main(int argc, char *argv[])
<<
exit
(
FatalError
);
<<
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
// Trim set
// ~~~~~~~~
// ~~~~~~~~
...
@@ -838,7 +828,7 @@ int main(int argc, char *argv[])
...
@@ -838,7 +828,7 @@ int main(int argc, char *argv[])
Info
<<
"Removing features with number of edges < "
Info
<<
"Removing features with number of edges < "
<<
minElem
<<
endl
;
<<
minElem
<<
endl
;
set
.
trimFeatures
(
minLen
,
minElem
);
set
()
.
trimFeatures
(
minLen
,
minElem
);
}
}
}
}
...
@@ -847,7 +837,7 @@ int main(int argc, char *argv[])
...
@@ -847,7 +837,7 @@ int main(int argc, char *argv[])
// ~~~~~~
// ~~~~~~
// Convert to marked edges, points
// Convert to marked edges, points
List
<
surfaceFeatures
::
edgeStatus
>
edgeStat
(
set
.
toStatus
());
List
<
surfaceFeatures
::
edgeStatus
>
edgeStat
(
set
()
.
toStatus
());
if
(
surfaceDict
.
isDict
(
"subsetFeatures"
))
if
(
surfaceDict
.
isDict
(
"subsetFeatures"
))
{
{
...
@@ -940,6 +930,16 @@ int main(int argc, char *argv[])
...
@@ -940,6 +930,16 @@ int main(int argc, char *argv[])
surfaceFeatures
newSet
(
surf
);
surfaceFeatures
newSet
(
surf
);
newSet
.
setFromStatus
(
edgeStat
);
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)
//if (writeObj)
//{
//{
// newSet.writeObj("final");
// newSet.writeObj("final");
...
@@ -956,17 +956,10 @@ int main(int argc, char *argv[])
...
@@ -956,17 +956,10 @@ int main(int argc, char *argv[])
if
(
surfaceDict
.
isDict
(
"addFeatures"
))
if
(
surfaceDict
.
isDict
(
"addFeatures"
))
{
{
const
dictionary
&
subsetDict
=
surfaceDict
.
subDict
const
word
addFeName
=
surfaceDict
.
subDict
(
"addFeatures"
)[
"name"
];
(
"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
...
@@ -982,14 +975,6 @@ int main(int argc, char *argv[])
...
@@ -982,14 +975,6 @@ 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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment