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
f80a2484
Commit
f80a2484
authored
11 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
check topology of input 1D mesh; if it has a boundary, abort
parent
f702dfc3
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
+19
-5
19 additions, 5 deletions
Mesh/meshGFace.cpp
with
19 additions
and
5 deletions
Mesh/meshGFace.cpp
+
19
−
5
View file @
f80a2484
...
@@ -543,7 +543,8 @@ static bool recoverEdge(BDS_Mesh *m, GEdge *ge,
...
@@ -543,7 +543,8 @@ static bool recoverEdge(BDS_Mesh *m, GEdge *ge,
return
true
;
return
true
;
}
}
void
BDS2GMSH
(
BDS_Mesh
*
m
,
GFace
*
gf
,
std
::
map
<
BDS_Point
*
,
MVertex
*
,
PointLessThan
>
&
recoverMap
)
void
BDS2GMSH
(
BDS_Mesh
*
m
,
GFace
*
gf
,
std
::
map
<
BDS_Point
*
,
MVertex
*
,
PointLessThan
>
&
recoverMap
)
{
{
{
{
std
::
set
<
BDS_Point
*
,
PointLessThan
>::
iterator
itp
=
m
->
points
.
begin
();
std
::
set
<
BDS_Point
*
,
PointLessThan
>::
iterator
itp
=
m
->
points
.
begin
();
...
@@ -585,7 +586,6 @@ void BDS2GMSH(BDS_Mesh *m, GFace *gf, std::map<BDS_Point*, MVertex*, PointLessTh
...
@@ -585,7 +586,6 @@ void BDS2GMSH(BDS_Mesh *m, GFace *gf, std::map<BDS_Point*, MVertex*, PointLessTh
}
}
}
}
static
void
addOrRemove
(
MVertex
*
v1
,
MVertex
*
v2
,
std
::
set
<
MEdge
,
Less_Edge
>
&
bedges
)
static
void
addOrRemove
(
MVertex
*
v1
,
MVertex
*
v2
,
std
::
set
<
MEdge
,
Less_Edge
>
&
bedges
)
{
{
MEdge
e
(
v1
,
v2
);
MEdge
e
(
v1
,
v2
);
...
@@ -933,7 +933,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
...
@@ -933,7 +933,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
}
}
// build a set with all points of the boundaries
// build a set with all points of the boundaries
std
::
set
<
MVertex
*>
all_vertices
;
std
::
set
<
MVertex
*>
all_vertices
,
boundary
;
std
::
list
<
GEdge
*>::
iterator
ite
=
edges
.
begin
();
std
::
list
<
GEdge
*>::
iterator
ite
=
edges
.
begin
();
while
(
ite
!=
edges
.
end
()){
while
(
ite
!=
edges
.
end
()){
if
((
*
ite
)
->
isSeam
(
gf
))
return
false
;
if
((
*
ite
)
->
isSeam
(
gf
))
return
false
;
...
@@ -943,6 +943,14 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
...
@@ -943,6 +943,14 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
MVertex
*
v2
=
(
*
ite
)
->
lines
[
i
]
->
getVertex
(
1
);
MVertex
*
v2
=
(
*
ite
)
->
lines
[
i
]
->
getVertex
(
1
);
all_vertices
.
insert
(
v1
);
all_vertices
.
insert
(
v1
);
all_vertices
.
insert
(
v2
);
all_vertices
.
insert
(
v2
);
if
(
boundary
.
find
(
v1
)
==
boundary
.
end
())
boundary
.
insert
(
v1
);
else
boundary
.
erase
(
v1
);
if
(
boundary
.
find
(
v2
)
==
boundary
.
end
())
boundary
.
insert
(
v2
);
else
boundary
.
erase
(
v2
);
}
}
}
}
else
else
...
@@ -950,6 +958,12 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
...
@@ -950,6 +958,12 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
++
ite
;
++
ite
;
}
}
if
(
boundary
.
size
()){
Msg
::
Error
(
"The 1D mesh seems not to be forming a closed loop"
);
gf
->
meshStatistics
.
status
=
GFace
::
FAILED
;
return
false
;
}
std
::
list
<
GEdge
*>
emb_edges
=
gf
->
embeddedEdges
();
std
::
list
<
GEdge
*>
emb_edges
=
gf
->
embeddedEdges
();
ite
=
emb_edges
.
begin
();
ite
=
emb_edges
.
begin
();
while
(
ite
!=
emb_edges
.
end
()){
while
(
ite
!=
emb_edges
.
end
()){
...
@@ -980,7 +994,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
...
@@ -980,7 +994,7 @@ bool meshGenerator(GFace *gf, int RECUR_ITER,
if
(
all_vertices
.
size
()
<
3
){
if
(
all_vertices
.
size
()
<
3
){
Msg
::
Warning
(
"Mesh Generation of Model Face %d Skipped: "
Msg
::
Warning
(
"Mesh Generation of Model Face %d Skipped: "
"Only %d
M
esh
V
ertices on
T
he
C
ontours"
,
"Only %d
m
esh
v
ertices on
t
he
c
ontours"
,
gf
->
tag
(),
all_vertices
.
size
());
gf
->
tag
(),
all_vertices
.
size
());
gf
->
meshStatistics
.
status
=
GFace
::
DONE
;
gf
->
meshStatistics
.
status
=
GFace
::
DONE
;
return
true
;
return
true
;
...
@@ -1802,7 +1816,7 @@ static bool meshGeneratorPeriodic(GFace *gf, bool debug = true)
...
@@ -1802,7 +1816,7 @@ static bool meshGeneratorPeriodic(GFace *gf, bool debug = true)
}
}
if
(
!
ok
){
if
(
!
ok
){
gf
->
meshStatistics
.
status
=
GFace
::
FAILED
;
gf
->
meshStatistics
.
status
=
GFace
::
FAILED
;
Msg
::
Error
(
"The 1D
M
esh seems not to be forming a closed loop"
);
Msg
::
Error
(
"The 1D
m
esh seems not to be forming a closed loop"
);
delete
m
;
delete
m
;
return
false
;
return
false
;
}
}
...
...
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