Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
1a57575c
Commit
1a57575c
authored
16 years ago
by
Stefen Guzik
Browse files
Options
Downloads
Patches
Plain Diff
2D BC detection tweak
parent
2df4856e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Geo/MZoneBoundary.cpp
+21
-11
21 additions, 11 deletions
Geo/MZoneBoundary.cpp
with
21 additions
and
11 deletions
Geo/MZoneBoundary.cpp
+
21
−
11
View file @
1a57575c
...
...
@@ -152,7 +152,7 @@ class BCPatchIndex
* zoneBoVec - (O) updated with domain boundary information for the
* vertex
* patch - (O) record BC patch index for an entity
* warnNormFromElem - (I) wether a warning about obtaining normals from
* warnNormFromElem - (I) w
h
ether a warning about obtaining normals from
* elements has already been given.
* (O) set to true if warning given in this call
*
...
...
@@ -202,6 +202,8 @@ void updateBoVec
* and from which the normal will be determined
* faces - (I) All faces on the boundary connected to 'vertex'
* boNormal - (O) The normal to the boundary face (edge in 2D)
* onlyFace - (I) If >= 0, only use this face to determine the
* interior vertex and normal to the mesh plane.
* returns - (O) 0 - success
* 1 - parFromPoint() failed
*
...
...
@@ -210,7 +212,7 @@ void updateBoVec
int
edge_normal
(
const
MVertex
*
const
vertex
,
const
int
zoneIndex
,
const
GEdge
*
const
gEdge
,
const
CCon
::
FaceVector
<
MZoneBoundary
<
2
>::
GlobalVertexData
<
MEdge
>::
FaceDataB
>
&
faces
,
SVector3
&
boNormal
)
&
faces
,
SVector3
&
boNormal
,
const
int
onlyFace
=
-
1
)
{
const
double
par
=
gEdge
->
parFromPoint
(
vertex
->
point
());
...
...
@@ -225,8 +227,13 @@ int edge_normal
// The interior point and mesh plane normal are computed from all elements in
// the zone.
int
cFace
=
0
;
const
int
nFace
=
faces
.
size
();
for
(
int
iFace
=
0
;
iFace
!=
nFace
;
++
iFace
)
{
int
iFace
=
0
;
int
nFace
=
faces
.
size
();
if
(
onlyFace
>=
0
)
{
iFace
=
onlyFace
;
nFace
=
onlyFace
+
1
;
}
for
(;
iFace
!=
nFace
;
++
iFace
)
{
if
(
faces
[
iFace
].
zoneIndex
==
zoneIndex
)
{
++
cFace
;
interior
+=
faces
[
iFace
].
parentElement
->
barycenter
();
...
...
@@ -288,7 +295,7 @@ void updateBoVec<2, MEdge>
// Get the edge entities that are connected to the vertex
std
::
list
<
GEdge
*>
gEdgeList
=
ent
->
edges
();
// Find edge entities that are connected to elements in the zone
std
::
vector
<
GEdge
*
>
useGEdge
;
std
::
vector
<
std
::
pair
<
GEdge
*
,
int
>
>
useGEdge
;
const
int
nFace
=
faces
.
size
();
for
(
int
iFace
=
0
;
iFace
!=
nFace
;
++
iFace
)
{
if
(
zoneIndex
==
faces
[
iFace
].
zoneIndex
)
{
...
...
@@ -302,7 +309,8 @@ void updateBoVec<2, MEdge>
// edge entities that will be used to determine the normal
GEntity
*
const
ent2
=
vertex2
->
onWhat
();
if
(
ent2
->
dim
()
==
1
)
{
useGEdge
.
push_back
(
static_cast
<
GEdge
*>
(
ent2
));
useGEdge
.
push_back
(
std
::
pair
<
GEdge
*
,
int
>
(
static_cast
<
GEdge
*>
(
ent2
),
iFace
));
}
}
}
...
...
@@ -321,7 +329,7 @@ void updateBoVec<2, MEdge>
case
1
:
{
const
GEdge
*
const
gEdge
=
static_cast
<
const
GEdge
*>
(
useGEdge
[
0
]);
static_cast
<
const
GEdge
*>
(
useGEdge
[
0
]
.
first
);
SVector3
boNormal
;
if
(
edge_normal
(
vertex
,
zoneIndex
,
gEdge
,
faces
,
boNormal
))
goto
getNormalFromElements
;
...
...
@@ -337,16 +345,18 @@ void updateBoVec<2, MEdge>
{
// Get the first normal
const
GEdge
*
const
gEdge1
=
static_cast
<
const
GEdge
*>
(
useGEdge
[
0
]);
static_cast
<
const
GEdge
*>
(
useGEdge
[
0
]
.
first
);
SVector3
boNormal1
;
if
(
edge_normal
(
vertex
,
zoneIndex
,
gEdge1
,
faces
,
boNormal1
))
if
(
edge_normal
(
vertex
,
zoneIndex
,
gEdge1
,
faces
,
boNormal1
,
useGEdge
[
0
].
second
))
goto
getNormalFromElements
;
// Get the second normal
const
GEdge
*
const
gEdge2
=
static_cast
<
const
GEdge
*>
(
useGEdge
[
1
]);
static_cast
<
const
GEdge
*>
(
useGEdge
[
1
]
.
first
);
SVector3
boNormal2
;
if
(
edge_normal
(
vertex
,
zoneIndex
,
gEdge2
,
faces
,
boNormal2
))
if
(
edge_normal
(
vertex
,
zoneIndex
,
gEdge2
,
faces
,
boNormal2
,
useGEdge
[
1
].
second
))
goto
getNormalFromElements
;
if
(
dot
(
boNormal1
,
boNormal2
)
<
0.98
)
{
...
...
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