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
22a54c7d
Commit
22a54c7d
authored
14 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
pp
parent
ee789fd3
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
Geo/GModel.cpp
+14
-9
14 additions, 9 deletions
Geo/GModel.cpp
with
14 additions
and
9 deletions
Geo/GModel.cpp
+
14
−
9
View file @
22a54c7d
...
@@ -988,7 +988,7 @@ void GModel::checkMeshCoherence(double tolerance)
...
@@ -988,7 +988,7 @@ void GModel::checkMeshCoherence(double tolerance)
int
numEle
=
getNumMeshElements
();
int
numEle
=
getNumMeshElements
();
if
(
!
numEle
)
return
;
if
(
!
numEle
)
return
;
Msg
::
Info
(
"Checking mesh coherence (%d elements)"
,
numEle
);
Msg
::
StatusBar
(
2
,
true
,
"Checking mesh coherence (%d elements)
...
"
,
numEle
);
SBoundingBox3d
bbox
=
bounds
();
SBoundingBox3d
bbox
=
bounds
();
double
lc
=
bbox
.
empty
()
?
1.
:
norm
(
SVector3
(
bbox
.
max
(),
bbox
.
min
()));
double
lc
=
bbox
.
empty
()
?
1.
:
norm
(
SVector3
(
bbox
.
max
(),
bbox
.
min
()));
...
@@ -999,6 +999,7 @@ void GModel::checkMeshCoherence(double tolerance)
...
@@ -999,6 +999,7 @@ void GModel::checkMeshCoherence(double tolerance)
// check for duplicate mesh vertices
// check for duplicate mesh vertices
{
{
Msg
::
Info
(
"Checking for duplicate vertices..."
);
std
::
vector
<
MVertex
*>
vertices
;
std
::
vector
<
MVertex
*>
vertices
;
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
)
vertices
.
insert
(
vertices
.
end
(),
entities
[
i
]
->
mesh_vertices
.
begin
(),
vertices
.
insert
(
vertices
.
end
(),
entities
[
i
]
->
mesh_vertices
.
begin
(),
...
@@ -1013,11 +1014,12 @@ void GModel::checkMeshCoherence(double tolerance)
...
@@ -1013,11 +1014,12 @@ void GModel::checkMeshCoherence(double tolerance)
vertices
[
i
]
->
x
(),
vertices
[
i
]
->
y
(),
vertices
[
i
]
->
z
());
vertices
[
i
]
->
x
(),
vertices
[
i
]
->
y
(),
vertices
[
i
]
->
z
());
num
++
;
num
++
;
}
}
if
(
num
)
Msg
::
Warning
(
"%d duplicate vert%s"
,
num
,
num
>
1
?
"ices"
:
"ex"
);
if
(
num
)
Msg
::
Error
(
"%d duplicate vert%s"
,
num
,
num
>
1
?
"ices"
:
"ex"
);
}
}
// check for duplicate elements
// check for duplicate elements
{
{
Msg
::
Info
(
"Checking for duplicate elements..."
);
std
::
vector
<
MVertex
*>
vertices
;
std
::
vector
<
MVertex
*>
vertices
;
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
)
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
getNumMeshElements
();
j
++
){
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
getNumMeshElements
();
j
++
){
...
@@ -1036,12 +1038,16 @@ void GModel::checkMeshCoherence(double tolerance)
...
@@ -1036,12 +1038,16 @@ void GModel::checkMeshCoherence(double tolerance)
}
}
delete
vertices
[
i
];
delete
vertices
[
i
];
}
}
if
(
num
)
Msg
::
Warning
(
"%d duplicate element%s"
,
num
,
num
>
1
?
"s"
:
""
);
if
(
num
)
Msg
::
Error
(
"%d duplicate element%s"
,
num
,
num
>
1
?
"s"
:
""
);
}
}
Msg
::
StatusBar
(
2
,
true
,
"Done checking mesh coherence"
);
}
}
int
GModel
::
removeDuplicateMeshVertices
(
double
tolerance
)
int
GModel
::
removeDuplicateMeshVertices
(
double
tolerance
)
{
{
Msg
::
StatusBar
(
2
,
true
,
"Removing duplicate mesh vertices..."
);
SBoundingBox3d
bbox
=
bounds
();
SBoundingBox3d
bbox
=
bounds
();
double
lc
=
bbox
.
empty
()
?
1.
:
norm
(
SVector3
(
bbox
.
max
(),
bbox
.
min
()));
double
lc
=
bbox
.
empty
()
?
1.
:
norm
(
SVector3
(
bbox
.
max
(),
bbox
.
min
()));
double
eps
=
lc
*
tolerance
;
double
eps
=
lc
*
tolerance
;
...
@@ -1109,8 +1115,10 @@ int GModel::removeDuplicateMeshVertices(double tolerance)
...
@@ -1109,8 +1115,10 @@ int GModel::removeDuplicateMeshVertices(double tolerance)
_associateEntityWithMeshVertices
();
_associateEntityWithMeshVertices
();
_storeVerticesInEntities
(
vertices
);
_storeVerticesInEntities
(
vertices
);
if
(
num
)
Msg
::
Info
(
"Removed %d duplicate mesh %s"
,
num
,
num
>
1
?
"vertices"
:
"vertex"
);
Msg
::
Info
(
"Removed %d duplicate mesh %s"
,
num
,
num
>
1
?
"vertices"
:
"vertex"
);
Msg
::
StatusBar
(
2
,
true
,
"Done removing duplicate mesh vertices"
);
return
num
;
return
num
;
}
}
...
@@ -1118,7 +1126,7 @@ void GModel::createTopologyFromMesh()
...
@@ -1118,7 +1126,7 @@ void GModel::createTopologyFromMesh()
{
{
removeDuplicateMeshVertices
(
CTX
::
instance
()
->
geom
.
tolerance
);
removeDuplicateMeshVertices
(
CTX
::
instance
()
->
geom
.
tolerance
);
Msg
::
Info
(
"Creating topology from mesh"
);
Msg
::
StatusBar
(
2
,
true
,
"Creating topology from mesh
...
"
);
double
t1
=
Cpu
();
double
t1
=
Cpu
();
// for each discreteRegion, create topology
// for each discreteRegion, create topology
...
@@ -1243,17 +1251,14 @@ void GModel::createTopologyFromMesh()
...
@@ -1243,17 +1251,14 @@ void GModel::createTopologyFromMesh()
createTopologyFromFaces
(
discFaces
);
createTopologyFromFaces
(
discFaces
);
double
t2
=
Cpu
();
double
t2
=
Cpu
();
Msg
::
Info
(
"C
reating topology from mesh
done
(%g s)"
,
t2
-
t1
);
Msg
::
StatusBar
(
2
,
true
,
"Done c
reating topology from mesh (%g s)"
,
t2
-
t1
);
//create old format (necessary for boundary layers)
//create old format (necessary for boundary layers)
exportDiscreteGEOInternals
();
exportDiscreteGEOInternals
();
}
}
void
GModel
::
createTopologyFromFaces
(
std
::
vector
<
discreteFace
*>
&
discFaces
)
void
GModel
::
createTopologyFromFaces
(
std
::
vector
<
discreteFace
*>
&
discFaces
)
{
{
std
::
vector
<
discreteEdge
*>
discEdges
;
std
::
vector
<
discreteEdge
*>
discEdges
;
for
(
eiter
it
=
firstEdge
();
it
!=
lastEdge
();
it
++
){
for
(
eiter
it
=
firstEdge
();
it
!=
lastEdge
();
it
++
){
if
((
*
it
)
->
geomType
()
==
GEntity
::
DiscreteCurve
)
if
((
*
it
)
->
geomType
()
==
GEntity
::
DiscreteCurve
)
...
...
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