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
64ad7e84
Commit
64ad7e84
authored
13 years ago
by
Bastien Gorissen
Browse files
Options
Downloads
Patches
Plain Diff
Removing warnings
parent
98796b8c
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/GeomMeshMatcher.cpp
+15
-14
15 additions, 14 deletions
Geo/GeomMeshMatcher.cpp
with
15 additions
and
14 deletions
Geo/GeomMeshMatcher.cpp
+
15
−
14
View file @
64ad7e84
...
@@ -33,6 +33,7 @@ template <class T> void getIntersection(std::vector<T>& res,
...
@@ -33,6 +33,7 @@ template <class T> void getIntersection(std::vector<T>& res,
std
::
vector
<
std
::
list
<
T
>
>&
lists
)
std
::
vector
<
std
::
list
<
T
>
>&
lists
)
{
{
res
.
clear
();
res
.
clear
();
std
::
list
<
T
>
first_list
=
lists
[
0
];
std
::
list
<
T
>
first_list
=
lists
[
0
];
bool
allsame
=
true
;
bool
allsame
=
true
;
for
(
typename
std
::
list
<
T
>::
iterator
item
=
first_list
.
begin
();
for
(
typename
std
::
list
<
T
>::
iterator
item
=
first_list
.
begin
();
...
@@ -516,7 +517,7 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
...
@@ -516,7 +517,7 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
// printf("creating edges\n");
// printf("creating edges\n");
for
(
GModel
::
eiter
it
=
mesh
->
firstEdge
();
it
!=
mesh
->
lastEdge
();
++
it
){
for
(
GModel
::
eiter
it
=
mesh
->
firstEdge
();
it
!=
mesh
->
lastEdge
();
++
it
){
// printf("edge %d\n",(*it)->tag());
// printf("edge %d\n",(*it)->tag());
for
(
int
i
=
0
;
i
<
(
*
it
)
->
lines
.
size
();
i
++
){
for
(
u
int
i
=
0
;
i
<
(
*
it
)
->
lines
.
size
();
i
++
){
// printf("medge %d %d\n",(*it)->lines[i]->getVertex(0)->getNum(),(*it)->lines[i]->getVertex(1)->getNum());
// printf("medge %d %d\n",(*it)->lines[i]->getVertex(0)->getNum(),(*it)->lines[i]->getVertex(1)->getNum());
MVertex
*
v1
=
geom
->
getMeshVertexByTag
((
*
it
)
->
lines
[
i
]
->
getVertex
(
0
)
->
getNum
());
MVertex
*
v1
=
geom
->
getMeshVertexByTag
((
*
it
)
->
lines
[
i
]
->
getVertex
(
0
)
->
getNum
());
MVertex
*
v2
=
geom
->
getMeshVertexByTag
((
*
it
)
->
lines
[
i
]
->
getVertex
(
1
)
->
getNum
());
MVertex
*
v2
=
geom
->
getMeshVertexByTag
((
*
it
)
->
lines
[
i
]
->
getVertex
(
1
)
->
getNum
());
...
@@ -541,7 +542,7 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
...
@@ -541,7 +542,7 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
}
}
// printf("creating faces\n");
// printf("creating faces\n");
for
(
GModel
::
fiter
it
=
mesh
->
firstFace
();
it
!=
mesh
->
lastFace
();
++
it
){
for
(
GModel
::
fiter
it
=
mesh
->
firstFace
();
it
!=
mesh
->
lastFace
();
++
it
){
for
(
int
i
=
0
;
i
<
(
*
it
)
->
triangles
.
size
();
i
++
){
for
(
u
int
i
=
0
;
i
<
(
*
it
)
->
triangles
.
size
();
i
++
){
MVertex
*
v1
=
geom
->
getMeshVertexByTag
((
*
it
)
->
triangles
[
i
]
->
getVertex
(
0
)
->
getNum
());
MVertex
*
v1
=
geom
->
getMeshVertexByTag
((
*
it
)
->
triangles
[
i
]
->
getVertex
(
0
)
->
getNum
());
MVertex
*
v2
=
geom
->
getMeshVertexByTag
((
*
it
)
->
triangles
[
i
]
->
getVertex
(
1
)
->
getNum
());
MVertex
*
v2
=
geom
->
getMeshVertexByTag
((
*
it
)
->
triangles
[
i
]
->
getVertex
(
1
)
->
getNum
());
MVertex
*
v3
=
geom
->
getMeshVertexByTag
((
*
it
)
->
triangles
[
i
]
->
getVertex
(
2
)
->
getNum
());
MVertex
*
v3
=
geom
->
getMeshVertexByTag
((
*
it
)
->
triangles
[
i
]
->
getVertex
(
2
)
->
getNum
());
...
@@ -549,7 +550,7 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
...
@@ -549,7 +550,7 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
else
if
(
v2
->
onWhat
()
->
dim
()
==
2
)((
GFace
*
)
v2
->
onWhat
())
->
triangles
.
push_back
(
new
MTriangle
(
v1
,
v2
,
v3
));
else
if
(
v2
->
onWhat
()
->
dim
()
==
2
)((
GFace
*
)
v2
->
onWhat
())
->
triangles
.
push_back
(
new
MTriangle
(
v1
,
v2
,
v3
));
else
if
(
v3
->
onWhat
()
->
dim
()
==
2
)((
GFace
*
)
v3
->
onWhat
())
->
triangles
.
push_back
(
new
MTriangle
(
v1
,
v2
,
v3
));
else
if
(
v3
->
onWhat
()
->
dim
()
==
2
)((
GFace
*
)
v3
->
onWhat
())
->
triangles
.
push_back
(
new
MTriangle
(
v1
,
v2
,
v3
));
}
}
for
(
int
i
=
0
;
i
<
(
*
it
)
->
quadrangles
.
size
();
i
++
){
for
(
u
int
i
=
0
;
i
<
(
*
it
)
->
quadrangles
.
size
();
i
++
){
MVertex
*
v1
=
geom
->
getMeshVertexByTag
((
*
it
)
->
quadrangles
[
i
]
->
getVertex
(
0
)
->
getNum
());
MVertex
*
v1
=
geom
->
getMeshVertexByTag
((
*
it
)
->
quadrangles
[
i
]
->
getVertex
(
0
)
->
getNum
());
MVertex
*
v2
=
geom
->
getMeshVertexByTag
((
*
it
)
->
quadrangles
[
i
]
->
getVertex
(
1
)
->
getNum
());
MVertex
*
v2
=
geom
->
getMeshVertexByTag
((
*
it
)
->
quadrangles
[
i
]
->
getVertex
(
1
)
->
getNum
());
MVertex
*
v3
=
geom
->
getMeshVertexByTag
((
*
it
)
->
quadrangles
[
i
]
->
getVertex
(
2
)
->
getNum
());
MVertex
*
v3
=
geom
->
getMeshVertexByTag
((
*
it
)
->
quadrangles
[
i
]
->
getVertex
(
2
)
->
getNum
());
...
@@ -568,7 +569,7 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
...
@@ -568,7 +569,7 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
static
void
copy_vertices
(
GVertex
*
to
,
GVertex
*
from
,
std
::
map
<
MVertex
*
,
MVertex
*>
&
_mesh_to_geom
){
static
void
copy_vertices
(
GVertex
*
to
,
GVertex
*
from
,
std
::
map
<
MVertex
*
,
MVertex
*>
&
_mesh_to_geom
){
if
(
from
)
{
if
(
from
)
{
to
->
deleteMesh
();
to
->
deleteMesh
();
for
(
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
for
(
u
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
MVertex
*
v_from
=
from
->
mesh_vertices
[
i
];
MVertex
*
v_from
=
from
->
mesh_vertices
[
i
];
MVertex
*
v_to
=
new
MVertex
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
(),
to
);
MVertex
*
v_to
=
new
MVertex
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
(),
to
);
to
->
mesh_vertices
.
push_back
(
v_to
);
to
->
mesh_vertices
.
push_back
(
v_to
);
...
@@ -578,7 +579,7 @@ static void copy_vertices (GVertex *to, GVertex *from, std::map<MVertex*,MVertex
...
@@ -578,7 +579,7 @@ static void copy_vertices (GVertex *to, GVertex *from, std::map<MVertex*,MVertex
}
}
static
void
copy_vertices
(
GRegion
*
to
,
GRegion
*
from
,
std
::
map
<
MVertex
*
,
MVertex
*>
&
_mesh_to_geom
){
static
void
copy_vertices
(
GRegion
*
to
,
GRegion
*
from
,
std
::
map
<
MVertex
*
,
MVertex
*>
&
_mesh_to_geom
){
to
->
deleteMesh
();
to
->
deleteMesh
();
for
(
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
for
(
u
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
MVertex
*
v_from
=
from
->
mesh_vertices
[
i
];
MVertex
*
v_from
=
from
->
mesh_vertices
[
i
];
MVertex
*
v_to
=
new
MVertex
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
(),
to
);
MVertex
*
v_to
=
new
MVertex
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
(),
to
);
to
->
mesh_vertices
.
push_back
(
v_to
);
to
->
mesh_vertices
.
push_back
(
v_to
);
...
@@ -605,7 +606,7 @@ static void copy_vertices (GEdge* to, GEdge* from, std::map<MVertex*,MVertex*> &
...
@@ -605,7 +606,7 @@ static void copy_vertices (GEdge* to, GEdge* from, std::map<MVertex*,MVertex*> &
_mesh_to_geom
[
v_from
]
=
v_to
;
_mesh_to_geom
[
v_from
]
=
v_to
;
}
}
for
(
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
for
(
u
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
MVertex
*
v_from
=
from
->
mesh_vertices
[
i
];
MVertex
*
v_from
=
from
->
mesh_vertices
[
i
];
double
t
;
double
t
;
GPoint
gp
=
to
->
closestPoint
(
SPoint3
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
()),
t
);
GPoint
gp
=
to
->
closestPoint
(
SPoint3
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
()),
t
);
...
@@ -617,7 +618,7 @@ static void copy_vertices (GEdge* to, GEdge* from, std::map<MVertex*,MVertex*> &
...
@@ -617,7 +618,7 @@ static void copy_vertices (GEdge* to, GEdge* from, std::map<MVertex*,MVertex*> &
}
}
static
void
copy_vertices
(
GFace
*
geom
,
GFace
*
mesh
,
std
::
map
<
MVertex
*
,
MVertex
*>
&
_mesh_to_geom
){
static
void
copy_vertices
(
GFace
*
geom
,
GFace
*
mesh
,
std
::
map
<
MVertex
*
,
MVertex
*>
&
_mesh_to_geom
){
// printf("Starting Face %d, with %d vertices\n", geom->tag(), mesh->mesh_vertices.size());
// printf("Starting Face %d, with %d vertices\n", geom->tag(), mesh->mesh_vertices.size());
for
(
int
i
=
0
;
i
<
mesh
->
mesh_vertices
.
size
();
i
++
){
for
(
u
int
i
=
0
;
i
<
mesh
->
mesh_vertices
.
size
();
i
++
){
MVertex
*
v_from
=
mesh
->
mesh_vertices
[
i
];
MVertex
*
v_from
=
mesh
->
mesh_vertices
[
i
];
double
uv
[
2
];
double
uv
[
2
];
GPoint
gp
=
geom
->
closestPoint
(
SPoint3
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
()),
uv
);
GPoint
gp
=
geom
->
closestPoint
(
SPoint3
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
()),
uv
);
...
@@ -644,7 +645,7 @@ static void copy_elements (std::vector<ELEMENT*> &to,
...
@@ -644,7 +645,7 @@ static void copy_elements (std::vector<ELEMENT*> &to,
std
::
map
<
MVertex
*
,
MVertex
*>
&
_mesh_to_geom
){
std
::
map
<
MVertex
*
,
MVertex
*>
&
_mesh_to_geom
){
MElementFactory
toto
;
MElementFactory
toto
;
to
.
clear
();
to
.
clear
();
for
(
int
i
=
0
;
i
<
from
.
size
();
i
++
){
for
(
u
int
i
=
0
;
i
<
from
.
size
();
i
++
){
ELEMENT
*
e
=
from
[
i
];
ELEMENT
*
e
=
from
[
i
];
std
::
vector
<
MVertex
*>
nodes
;
std
::
vector
<
MVertex
*>
nodes
;
for
(
int
j
=
0
;
j
<
e
->
getNumVertices
();
j
++
)
{
for
(
int
j
=
0
;
j
<
e
->
getNumVertices
();
j
++
)
{
...
@@ -664,11 +665,11 @@ void copy_vertices (GModel *geom, GModel *mesh, std::map<MVertex*,MVertex*> &_me
...
@@ -664,11 +665,11 @@ void copy_vertices (GModel *geom, GModel *mesh, std::map<MVertex*,MVertex*> &_me
std
::
vector
<
Pair
<
GFace
*
,
GFace
*>
>
*
coresp_f
){
std
::
vector
<
Pair
<
GFace
*
,
GFace
*>
>
*
coresp_f
){
// copy all elements
// copy all elements
for
(
int
i
=
0
;
i
<
coresp_v
->
size
();
++
i
)
for
(
u
int
i
=
0
;
i
<
coresp_v
->
size
();
++
i
)
copy_vertices
((
*
coresp_v
)[
i
].
first
(),(
*
coresp_v
)[
i
].
second
(),
_mesh_to_geom
);
copy_vertices
((
*
coresp_v
)[
i
].
first
(),(
*
coresp_v
)[
i
].
second
(),
_mesh_to_geom
);
for
(
int
i
=
0
;
i
<
coresp_e
->
size
();
++
i
)
for
(
u
int
i
=
0
;
i
<
coresp_e
->
size
();
++
i
)
copy_vertices
((
*
coresp_e
)[
i
].
first
(),(
*
coresp_e
)[
i
].
second
(),
_mesh_to_geom
);
copy_vertices
((
*
coresp_e
)[
i
].
first
(),(
*
coresp_e
)[
i
].
second
(),
_mesh_to_geom
);
for
(
int
i
=
0
;
i
<
coresp_f
->
size
();
++
i
)
for
(
u
int
i
=
0
;
i
<
coresp_f
->
size
();
++
i
)
copy_vertices
((
*
coresp_f
)[
i
].
first
(),(
*
coresp_f
)[
i
].
second
(),
_mesh_to_geom
);
copy_vertices
((
*
coresp_f
)[
i
].
first
(),(
*
coresp_f
)[
i
].
second
(),
_mesh_to_geom
);
for
(
GModel
::
riter
rit
=
geom
->
firstRegion
()
;
rit
!=
geom
->
lastRegion
();
rit
++
)
for
(
GModel
::
riter
rit
=
geom
->
firstRegion
()
;
rit
!=
geom
->
lastRegion
();
rit
++
)
copy_vertices
(
*
rit
,
mesh
->
getRegionByTag
((
*
rit
)
->
tag
()),
_mesh_to_geom
);
copy_vertices
(
*
rit
,
mesh
->
getRegionByTag
((
*
rit
)
->
tag
()),
_mesh_to_geom
);
...
@@ -679,13 +680,13 @@ void copy_elements (GModel *geom, GModel *mesh, std::map<MVertex*,MVertex*> &_me
...
@@ -679,13 +680,13 @@ void copy_elements (GModel *geom, GModel *mesh, std::map<MVertex*,MVertex*> &_me
std
::
vector
<
Pair
<
GFace
*
,
GFace
*>
>
*
coresp_f
){
std
::
vector
<
Pair
<
GFace
*
,
GFace
*>
>
*
coresp_f
){
// copy all elements
// copy all elements
for
(
int
i
=
0
;
i
<
coresp_v
->
size
();
++
i
)
for
(
u
int
i
=
0
;
i
<
coresp_v
->
size
();
++
i
)
copy_elements
<
MPoint
>
((
*
coresp_v
)[
i
].
first
()
->
points
,(
*
coresp_v
)[
i
].
second
()
->
points
,
_mesh_to_geom
);
copy_elements
<
MPoint
>
((
*
coresp_v
)[
i
].
first
()
->
points
,(
*
coresp_v
)[
i
].
second
()
->
points
,
_mesh_to_geom
);
for
(
int
i
=
0
;
i
<
coresp_e
->
size
();
++
i
)
for
(
u
int
i
=
0
;
i
<
coresp_e
->
size
();
++
i
)
copy_elements
<
MLine
>
((
*
coresp_e
)[
i
].
first
()
->
lines
,(
*
coresp_e
)[
i
].
second
()
->
lines
,
_mesh_to_geom
);
copy_elements
<
MLine
>
((
*
coresp_e
)[
i
].
first
()
->
lines
,(
*
coresp_e
)[
i
].
second
()
->
lines
,
_mesh_to_geom
);
for
(
int
i
=
0
;
i
<
coresp_f
->
size
();
++
i
){
for
(
u
int
i
=
0
;
i
<
coresp_f
->
size
();
++
i
){
copy_elements
<
MTriangle
>
((
*
coresp_f
)[
i
].
first
()
->
triangles
,(
*
coresp_f
)[
i
].
second
()
->
triangles
,
_mesh_to_geom
);
copy_elements
<
MTriangle
>
((
*
coresp_f
)[
i
].
first
()
->
triangles
,(
*
coresp_f
)[
i
].
second
()
->
triangles
,
_mesh_to_geom
);
copy_elements
<
MQuadrangle
>
((
*
coresp_f
)[
i
].
first
()
->
quadrangles
,(
*
coresp_f
)[
i
].
second
()
->
quadrangles
,
_mesh_to_geom
);
copy_elements
<
MQuadrangle
>
((
*
coresp_f
)[
i
].
first
()
->
quadrangles
,(
*
coresp_f
)[
i
].
second
()
->
quadrangles
,
_mesh_to_geom
);
}
}
...
...
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