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
5fb00803
Commit
5fb00803
authored
14 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
better orientation algo (also ok if no vertices inside the face)
parent
a8ea4a8e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/meshGFace.cpp
+18
-12
18 additions, 12 deletions
Mesh/meshGFace.cpp
with
18 additions
and
12 deletions
Mesh/meshGFace.cpp
+
18
−
12
View file @
5fb00803
...
@@ -788,7 +788,6 @@ static bool meshGenerator(GFace *gf, int RECUR_ITER,
...
@@ -788,7 +788,6 @@ static bool meshGenerator(GFace *gf, int RECUR_ITER,
}
}
}
}
if
(
Msg
::
GetVerbosity
()
==
10
){
if
(
Msg
::
GetVerbosity
()
==
10
){
GEdge
*
ge
=
new
discreteEdge
(
gf
->
model
(),
1000
,
0
,
0
);
GEdge
*
ge
=
new
discreteEdge
(
gf
->
model
(),
1000
,
0
,
0
);
MElementOctree
octree
(
gf
->
model
());
MElementOctree
octree
(
gf
->
model
());
...
@@ -1799,6 +1798,8 @@ void orientMeshGFace::operator()(GFace *gf)
...
@@ -1799,6 +1798,8 @@ void orientMeshGFace::operator()(GFace *gf)
if
(
gf
->
geomType
()
==
GEntity
::
ProjectionFace
)
return
;
if
(
gf
->
geomType
()
==
GEntity
::
ProjectionFace
)
return
;
if
(
gf
->
geomType
()
==
GEntity
::
CompoundSurface
)
return
;
if
(
gf
->
geomType
()
==
GEntity
::
CompoundSurface
)
return
;
if
(
!
gf
->
getNumMeshElements
())
return
;
// In old versions we did not reorient transfinite surface meshes;
// In old versions we did not reorient transfinite surface meshes;
// we could add the following to provide backward compatibility:
// we could add the following to provide backward compatibility:
// if(gf->meshAttributes.Method == MESH_TRANSFINITE) return;
// if(gf->meshAttributes.Method == MESH_TRANSFINITE) return;
...
@@ -1815,12 +1816,18 @@ void orientMeshGFace::operator()(GFace *gf)
...
@@ -1815,12 +1816,18 @@ void orientMeshGFace::operator()(GFace *gf)
for
(
unsigned
int
i
=
0
;
i
<
gf
->
getNumMeshElements
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
gf
->
getNumMeshElements
();
i
++
){
MElement
*
e
=
gf
->
getMeshElement
(
i
);
MElement
*
e
=
gf
->
getMeshElement
(
i
);
SPoint2
param
(
0.
,
0.
);
bool
ok
=
true
;
for
(
int
j
=
0
;
j
<
e
->
getNumVertices
();
j
++
){
for
(
int
j
=
0
;
j
<
e
->
getNumVertices
();
j
++
){
MVertex
*
v
=
e
->
getVertex
(
j
);
SPoint2
p
;
SPoint2
param
;
bool
ok
=
reparamMeshVertexOnFace
(
e
->
getVertex
(
j
),
gf
,
p
);
if
(
reparamMeshVertexOnFace
(
v
,
gf
,
param
)){
if
(
!
ok
)
break
;
SVector3
ne
=
e
->
getFace
(
0
).
normal
();
param
+=
p
;
}
if
(
ok
){
param
*=
1.
/
e
->
getNumVertices
();
SVector3
nf
=
gf
->
normal
(
param
);
SVector3
nf
=
gf
->
normal
(
param
);
SVector3
ne
=
e
->
getFace
(
0
).
normal
();
if
(
dot
(
ne
,
nf
)
<
0
){
if
(
dot
(
ne
,
nf
)
<
0
){
Msg
::
Debug
(
"Reverting orientation of mesh in face %d"
,
gf
->
tag
());
Msg
::
Debug
(
"Reverting orientation of mesh in face %d"
,
gf
->
tag
());
for
(
unsigned
int
k
=
0
;
k
<
gf
->
getNumMeshElements
();
k
++
)
for
(
unsigned
int
k
=
0
;
k
<
gf
->
getNumMeshElements
();
k
++
)
...
@@ -1829,6 +1836,5 @@ void orientMeshGFace::operator()(GFace *gf)
...
@@ -1829,6 +1836,5 @@ void orientMeshGFace::operator()(GFace *gf)
return
;
return
;
}
}
}
}
}
Msg
::
Warning
(
"Could not orient mesh in face %d"
,
gf
->
tag
());
Msg
::
Warning
(
"Could not orient mesh in face %d"
,
gf
->
tag
());
}
}
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