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
10c2e2fa
Commit
10c2e2fa
authored
12 years ago
by
laurence
Browse files
Options
Downloads
Patches
Plain Diff
BUG: extendedFeatureEdgeMesh: Replace slow algorithm for featurePointFeatureEdges
and prevent a divide by zero
parent
f0784197
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C
+23
-28
23 additions, 28 deletions
...xtendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C
with
23 additions
and
28 deletions
src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C
+
23
−
28
View file @
10c2e2fa
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
========= |
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
3
OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
License
License
...
@@ -59,14 +59,14 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
...
@@ -59,14 +59,14 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
DynamicList
<
vector
>
norms
;
DynamicList
<
vector
>
norms
;
vectorField
edgeDirections
(
nFeatEds
);
vectorField
edgeDirections
(
nFeatEds
);
labelListList
edgeNormals
(
nFeatEds
);
labelListList
edgeNormals
(
nFeatEds
);
labelListList
normalDirections
(
nFeatEds
);
DynamicList
<
label
>
regionEdges
;
DynamicList
<
label
>
regionEdges
;
// Keep track of the ordered feature point feature edges
// Keep track of the ordered feature point feature edges
labelListList
featurePointFeatureEdges
(
nFeatPts
);
labelListList
featurePointFeatureEdges
(
nFeatPts
);
forAll
(
featurePointFeatureEdges
,
pI
)
forAll
(
featurePointFeatureEdges
,
pI
)
{
{
featurePointFeatureEdges
[
pI
]
=
featurePointFeatureEdges
[
pI
]
=
pointEdges
[
featurePoints
[
pI
]];
labelList
(
pointEdges
[
featurePoints
[
pI
]].
size
(),
-
1
);
}
}
// Mapping between old and new indices, there is entry in the map for each
// Mapping between old and new indices, there is entry in the map for each
...
@@ -74,6 +74,10 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
...
@@ -74,6 +74,10 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
// >= 0 corresponds to the index
// >= 0 corresponds to the index
labelList
pointMap
(
sFeatLocalPts
.
size
(),
-
1
);
labelList
pointMap
(
sFeatLocalPts
.
size
(),
-
1
);
// Mapping between surface edge index and its feature edge index. -1 if it
// is not a feature edge
labelList
edgeMap
(
sFeatEds
.
size
(),
-
1
);
// Noting when the normal of a face has been used so not to duplicate
// Noting when the normal of a face has been used so not to duplicate
labelList
faceMap
(
surf
.
size
(),
-
1
);
labelList
faceMap
(
surf
.
size
(),
-
1
);
...
@@ -98,7 +102,11 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
...
@@ -98,7 +102,11 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
{
{
label
sFEI
=
featureEdges
[
i
];
label
sFEI
=
featureEdges
[
i
];
const
edge
&
fE
(
sFeatEds
[
sFEI
]);
edgeMap
[
sFEI
]
=
i
;
const
edge
&
fE
=
sFeatEds
[
sFEI
];
edgeDirections
[
i
]
=
fE
.
vec
(
sFeatLocalPts
);
// Check to see if the points have been already used
// Check to see if the points have been already used
if
(
pointMap
[
fE
.
start
()]
==
-
1
)
if
(
pointMap
[
fE
.
start
()]
==
-
1
)
...
@@ -150,51 +158,37 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
...
@@ -150,51 +158,37 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
edStatus
[
i
]
=
classifyEdge
(
norms
,
edgeNormals
[
i
],
fC0tofC1
);
edStatus
[
i
]
=
classifyEdge
(
norms
,
edgeNormals
[
i
],
fC0tofC1
);
edgeDirections
[
i
]
=
fE
.
vec
(
sFeatLocalPts
);
if
(
isRegionFeatureEdge
[
i
])
if
(
isRegionFeatureEdge
[
i
])
{
{
regionEdges
.
append
(
i
);
regionEdges
.
append
(
i
);
}
}
forAll
(
featurePointFeatureEdges
,
pI
)
{
const
labelList
&
fpfEdges
=
pointEdges
[
featurePoints
[
pI
]];
labelList
&
fpfe
=
featurePointFeatureEdges
[
pI
];
forAll
(
fpfEdges
,
eI
)
{
if
(
sFEI
==
fpfEdges
[
eI
])
{
fpfe
[
eI
]
=
i
;
}
}
}
}
}
// Populate feature point feature edges
DynamicList
<
label
>
newFeatureEdges
;
forAll
(
featurePointFeatureEdges
,
pI
)
forAll
(
featurePointFeatureEdges
,
pI
)
{
{
const
labelList
&
fpfe
=
featurePointFeatureEdges
[
pI
];
const
labelList
&
fpfe
=
featurePointFeatureEdges
[
pI
];
DynamicList
<
label
>
newFeatureEdges
(
fpfe
.
size
());
newFeatureEdges
.
setCapacity
(
fpfe
.
size
());
forAll
(
fpfe
,
eI
)
forAll
(
fpfe
,
eI
)
{
{
const
label
edgeIndex
=
fpfe
[
eI
];
const
label
oldEdgeIndex
=
fpfe
[
eI
];
const
label
newEdgeIndex
=
edgeMap
[
oldEdgeIndex
];
if
(
e
dgeIndex
!=
-
1
)
if
(
newE
dgeIndex
!=
-
1
)
{
{
newFeatureEdges
.
append
(
e
dgeIndex
);
newFeatureEdges
.
append
(
newE
dgeIndex
);
}
}
}
}
featurePointFeatureEdges
[
pI
]
=
newFeatureEdges
;
featurePointFeatureEdges
[
pI
]
.
transfer
(
newFeatureEdges
)
;
}
}
// Reorder the edges by classification
// Reorder the edges by classification
List
<
DynamicList
<
label
>
>
allEds
(
nEdgeTypes
);
List
<
DynamicList
<
label
>
>
allEds
(
nEdgeTypes
);
DynamicList
<
label
>&
externalEds
(
allEds
[
0
]);
DynamicList
<
label
>&
externalEds
(
allEds
[
0
]);
...
@@ -277,7 +271,8 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
...
@@ -277,7 +271,8 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges
edgeMesh
::
operator
=
(
edgeMesh
(
pts
,
eds
));
edgeMesh
::
operator
=
(
edgeMesh
(
pts
,
eds
));
// Initialise sorted edge related data
// Initialise sorted edge related data
edgeDirections_
=
edgeDirections
/
mag
(
edgeDirections
);
edgeDirections_
=
edgeDirections
/
(
mag
(
edgeDirections
)
+
VSMALL
);
edgeNormals_
=
edgeNormals
;
edgeNormals_
=
edgeNormals
;
regionEdges_
=
regionEdges
;
regionEdges_
=
regionEdges
;
...
...
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