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
20cce391
Commit
20cce391
authored
8 years ago
by
Koen Hillewaert
Browse files
Options
Downloads
Patches
Plain Diff
copying mesh periodicity when reclassifying/matching a mesh onto a CAD
parent
3dc94e00
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Geo/GeomMeshMatcher.cpp
+48
-0
48 additions, 0 deletions
Geo/GeomMeshMatcher.cpp
with
48 additions
and
0 deletions
Geo/GeomMeshMatcher.cpp
+
48
−
0
View file @
20cce391
...
@@ -581,6 +581,49 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
...
@@ -581,6 +581,49 @@ int GeomMeshMatcher::forceTomatch(GModel *geom, GModel *mesh, const double TOL)
return
0
;
return
0
;
}
}
template
<
class
GEType
>
static
void
copy_periodicity
(
std
::
vector
<
Pair
<
GEType
*
,
GEType
*>
>&
eCor
)
{
typename
std
::
multimap
<
GEType
*
,
GEType
*>
eMap
;
// (eCor.begin(),eCor.end());
typename
std
::
vector
<
Pair
<
GEType
*
,
GEType
*>
>::
iterator
eIter
=
eCor
.
begin
();
for
(;
eIter
!=
eCor
.
end
();
++
eIter
)
{
eMap
.
insert
(
std
::
make_pair
(
eIter
->
second
(),
eIter
->
first
()));
}
typename
std
::
multimap
<
GEType
*
,
GEType
*>::
iterator
srcIter
=
eMap
.
begin
();
for
(;
srcIter
!=
eMap
.
end
();
++
srcIter
)
{
GEType
*
oldTgt
=
srcIter
->
first
;
GEType
*
oldSrc
=
dynamic_cast
<
GEType
*>
(
oldTgt
->
meshMaster
());
if
(
oldSrc
!=
NULL
&&
oldSrc
!=
oldTgt
)
{
std
::
cout
<<
"Copying connection from "
<<
oldTgt
->
tag
()
<<
" - "
<<
oldSrc
->
tag
()
<<
std
::
endl
;
GEType
*
newTgt
=
srcIter
->
second
;
typename
std
::
map
<
GEType
*
,
GEType
*>::
iterator
tgtIter
=
eMap
.
find
(
oldSrc
);
if
(
tgtIter
==
eMap
.
end
())
{
std
::
cout
<<
"Checking corresponding edge for "
<<
newTgt
<<
std
::
endl
;
std
::
cout
<<
"Tag "
<<
newTgt
->
tag
()
<<
std
::
endl
;
throw
;
}
GEType
*
newSrc
=
tgtIter
->
second
;
std
::
cout
<<
"replacing by "
<<
newTgt
->
tag
()
<<
" - "
<<
newSrc
->
tag
()
<<
std
::
endl
;
std
::
cout
<<
"Transformation has "
<<
oldTgt
->
affineTransform
.
size
()
<<
" components "
<<
std
::
endl
;
std
::
vector
<
double
>::
iterator
tIter
=
oldTgt
->
affineTransform
.
begin
();
for
(;
tIter
!=
oldTgt
->
affineTransform
.
end
();
++
tIter
)
std
::
cout
<<
" "
<<
*
tIter
;
std
::
cout
<<
std
::
endl
;
newTgt
->
setMeshMaster
(
newSrc
,
oldTgt
->
affineTransform
);
}
}
}
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
){
to
->
deleteMesh
();
to
->
deleteMesh
();
if
(
from
)
{
if
(
from
)
{
...
@@ -740,6 +783,11 @@ int GeomMeshMatcher::match(GModel *geom, GModel *mesh)
...
@@ -740,6 +783,11 @@ int GeomMeshMatcher::match(GModel *geom, GModel *mesh)
std
::
vector
<
Pair
<
GRegion
*
,
GRegion
*>
>
*
coresp_r
=
matchRegions
(
geom
,
mesh
,
coresp_f
,
ok
);
std
::
vector
<
Pair
<
GRegion
*
,
GRegion
*>
>
*
coresp_r
=
matchRegions
(
geom
,
mesh
,
coresp_f
,
ok
);
std
::
map
<
MVertex
*
,
MVertex
*>
_mesh_to_geom
;
std
::
map
<
MVertex
*
,
MVertex
*>
_mesh_to_geom
;
copy_periodicity
(
*
coresp_v
);
copy_periodicity
(
*
coresp_e
);
copy_periodicity
(
*
coresp_f
);
copy_vertices
(
geom
,
mesh
,
_mesh_to_geom
,
coresp_v
,
coresp_e
,
coresp_f
,
coresp_r
);
copy_vertices
(
geom
,
mesh
,
_mesh_to_geom
,
coresp_v
,
coresp_e
,
coresp_f
,
coresp_r
);
copy_elements
(
geom
,
mesh
,
_mesh_to_geom
,
coresp_v
,
coresp_e
,
coresp_f
,
coresp_r
);
copy_elements
(
geom
,
mesh
,
_mesh_to_geom
,
coresp_v
,
coresp_e
,
coresp_f
,
coresp_r
);
...
...
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