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
d23e8e67
Commit
d23e8e67
authored
13 years ago
by
Bastien Gorissen
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug with smoothing of matched meshes
parent
7d5c07b1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/GeomMeshMatcher.cpp
+3
-13
3 additions, 13 deletions
Geo/GeomMeshMatcher.cpp
Mesh/HighOrder.cpp
+5
-1
5 additions, 1 deletion
Mesh/HighOrder.cpp
with
8 additions
and
14 deletions
Geo/GeomMeshMatcher.cpp
+
3
−
13
View file @
d23e8e67
...
...
@@ -567,9 +567,10 @@ 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
){
to
->
deleteMesh
();
if
(
from
)
{
to
->
deleteMesh
();
for
(
unsigned
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
()
;
i
++
){
//
to->deleteMesh();
for
(
unsigned
int
i
=
0
;
i
<
1
;
i
++
){
MVertex
*
v_from
=
from
->
mesh_vertices
[
i
];
MVertex
*
v_to
=
new
MVertex
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
(),
to
);
to
->
mesh_vertices
.
push_back
(
v_to
);
...
...
@@ -597,15 +598,6 @@ static void copy_vertices (GEdge* to, GEdge* from, std::map<MVertex*,MVertex*> &
return
;
}
if
(
from
->
getBeginVertex
()
==
from
->
getEndVertex
())
{
MVertex
*
v_from
=
from
->
getBeginVertex
()
->
mesh_vertices
[
0
];
double
t
;
GPoint
gp
=
to
->
closestPoint
(
SPoint3
(
v_from
->
x
(),
v_from
->
y
(),
v_from
->
z
()),
t
);
MEdgeVertex
*
v_to
=
new
MEdgeVertex
(
gp
.
x
(),
gp
.
y
(),
gp
.
z
(),
to
,
gp
.
u
()
);
to
->
mesh_vertices
.
push_back
(
v_to
);
_mesh_to_geom
[
v_from
]
=
v_to
;
}
for
(
unsigned
int
i
=
0
;
i
<
from
->
mesh_vertices
.
size
();
i
++
){
MVertex
*
v_from
=
from
->
mesh_vertices
[
i
];
double
t
;
...
...
@@ -719,7 +711,5 @@ int GeomMeshMatcher::match(GModel *geom, GModel *mesh)
copy_vertices
(
geom
,
mesh
,
_mesh_to_geom
,
coresp_v
,
coresp_e
,
coresp_f
);
copy_elements
(
geom
,
mesh
,
_mesh_to_geom
,
coresp_v
,
coresp_e
,
coresp_f
);
geom
->
removeDuplicateMeshVertices
(
1e-8
);
return
1
;
}
This diff is collapsed.
Click to expand it.
Mesh/HighOrder.cpp
+
5
−
1
View file @
d23e8e67
...
...
@@ -128,6 +128,7 @@ static bool computeEquidistantParameters(GEdge *ge, double u0, double uN, int N,
return
computeEquidistantParameters0
(
ge
,
u0
,
uN
,
N
,
u
,
underRelax
);
else
if
(
method_for_computing_intermediary_points
==
1
)
// use projection
return
computeEquidistantParameters1
(
ge
,
u0
,
uN
,
N
,
u
,
underRelax
);
return
false
;
}
static
double
mylength
(
GFace
*
gf
,
int
i
,
double
*
u
,
double
*
v
)
...
...
@@ -251,6 +252,7 @@ static bool computeEquidistantParameters(GFace *gf, double u0, double uN,
return
computeEquidistantParameters0
(
gf
,
u0
,
uN
,
v0
,
vN
,
N
,
u
,
v
);
else
if
(
method_for_computing_intermediary_points
==
1
)
// use projection
return
computeEquidistantParameters1
(
gf
,
u0
,
uN
,
v0
,
vN
,
N
,
u
,
v
);
return
false
;
}
...
...
@@ -288,6 +290,7 @@ static void getEdgeVertices(GEdge *ge, MElement *ele, std::vector<MVertex*> &ve,
if
(
computeEquidistantParameters
(
ge
,
std
::
min
(
u0
,
u1
),
std
::
max
(
u0
,
u1
),
nPts
+
2
,
US
,
relax
))
break
;
relax
/=
2.0
;
if
(
relax
<
1.e-2
)
break
;
...
...
@@ -585,7 +588,7 @@ static void reorientQuadPoints(std::vector<MVertex*> &vtcs, int orientation,
}
order
-=
2
;
if
(
start
>=
vtcs
.
size
())
break
;
if
(
start
>=
(
int
)
vtcs
.
size
())
break
;
}
}
...
...
@@ -1331,6 +1334,7 @@ void SetOrderN(GModel *m, int order, bool linear, bool incomplete)
v
.
insert
(
v
.
begin
(),
(
*
it
)
->
triangles
.
begin
(),
(
*
it
)
->
triangles
.
end
());
v
.
insert
(
v
.
end
(),
(
*
it
)
->
quadrangles
.
begin
(),
(
*
it
)
->
quadrangles
.
end
());
hot
.
applySmoothingTo
(
v
,
(
*
it
));
//hot.applySmoothingTo(v, .1,0);
}
// hot.ensureMinimumDistorsion(0.1);
checkHighOrderTriangles
(
"Final surface mesh"
,
m
,
bad
,
worst
);
...
...
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