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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
8b77da7b
Commit
8b77da7b
authored
Apr 17, 2016
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
3276aa0c
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/meshGFaceOptimize.cpp
+36
-35
36 additions, 35 deletions
Mesh/meshGFaceOptimize.cpp
with
36 additions
and
35 deletions
Mesh/meshGFaceOptimize.cpp
+
36
−
35
View file @
8b77da7b
...
@@ -382,7 +382,6 @@ double surfaceFaceUV(MElement *t,GFace *gf, bool maximal = true)
...
@@ -382,7 +382,6 @@ double surfaceFaceUV(MElement *t,GFace *gf, bool maximal = true)
}
}
}
}
int
_removeThreeTrianglesNodes
(
GFace
*
gf
)
int
_removeThreeTrianglesNodes
(
GFace
*
gf
)
{
{
v2t_cont
adj
;
v2t_cont
adj
;
...
@@ -545,7 +544,6 @@ static bool _tryToCollapseThatVertex (GFace *gf,
...
@@ -545,7 +544,6 @@ static bool _tryToCollapseThatVertex (GFace *gf,
MVertex
*
v1
,
MVertex
*
v1
,
MVertex
*
v2
)
MVertex
*
v2
)
{
{
std
::
vector
<
MElement
*>
e
=
e1
;
std
::
vector
<
MElement
*>
e
=
e1
;
e
.
insert
(
e
.
end
(),
e2
.
begin
(),
e2
.
end
());
e
.
insert
(
e
.
end
(),
e2
.
begin
(),
e2
.
end
());
...
@@ -650,8 +648,6 @@ static bool _isItAGoodIdeaToMoveThatVertex (GFace *gf,
...
@@ -650,8 +648,6 @@ static bool _isItAGoodIdeaToMoveThatVertex (GFace *gf,
return
true
;
return
true
;
}
}
static
int
_removeDiamonds
(
GFace
*
gf
)
static
int
_removeDiamonds
(
GFace
*
gf
)
{
{
v2t_cont
adj
;
v2t_cont
adj
;
...
@@ -796,7 +792,7 @@ void _relocateVertex(GFace *gf, MVertex *ver,
...
@@ -796,7 +792,7 @@ void _relocateVertex(GFace *gf, MVertex *ver,
// printf("%g ",F);
// printf("%g ",F);
after
+=
adj
*
F
;
after
+=
adj
*
F
;
COUNT
+=
F
;
COUNT
+=
F
;
//
//
double RATIO = lt[i]->getVolume()/pow(metric[0]*metric[2]-metric[1]*metric[1],0.5);
// double RATIO = lt[i]->getVolume()/pow(metric[0]*metric[2]-metric[1]*metric[1],0.5);
}
}
// printf("\n");
// printf("\n");
after
*=
(
1.0
/
COUNT
);
after
*=
(
1.0
/
COUNT
);
...
@@ -821,7 +817,6 @@ void _relocateVertex(GFace *gf, MVertex *ver,
...
@@ -821,7 +817,6 @@ void _relocateVertex(GFace *gf, MVertex *ver,
}
}
}
}
void
laplaceSmoothing
(
GFace
*
gf
,
int
niter
,
bool
infinity_norm
)
void
laplaceSmoothing
(
GFace
*
gf
,
int
niter
,
bool
infinity_norm
)
{
{
if
(
!
niter
)
return
;
if
(
!
niter
)
return
;
...
@@ -837,7 +832,8 @@ void laplaceSmoothing(GFace *gf, int niter, bool infinity_norm)
...
@@ -837,7 +832,8 @@ void laplaceSmoothing(GFace *gf, int niter, bool infinity_norm)
}
}
}
}
bool
edgeSwapDelProj
(
MVertex
*
v1
,
MVertex
*
v2
,
MVertex
*
v3
,
MVertex
*
v4
){
bool
edgeSwapDelProj
(
MVertex
*
v1
,
MVertex
*
v2
,
MVertex
*
v3
,
MVertex
*
v4
)
{
MTriangle
t1
(
v1
,
v2
,
v3
);
MTriangle
t1
(
v1
,
v2
,
v3
);
MTriangle
t2
(
v2
,
v1
,
v4
);
MTriangle
t2
(
v2
,
v1
,
v4
);
...
@@ -850,7 +846,6 @@ bool edgeSwapDelProj (MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4){
...
@@ -850,7 +846,6 @@ bool edgeSwapDelProj (MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4){
return
false
;
return
false
;
}
}
bool
edgeSwap
(
std
::
set
<
swapquad
>
&
configs
,
MTri3
*
t1
,
GFace
*
gf
,
int
iLocalEdge
,
bool
edgeSwap
(
std
::
set
<
swapquad
>
&
configs
,
MTri3
*
t1
,
GFace
*
gf
,
int
iLocalEdge
,
std
::
vector
<
MTri3
*>
&
newTris
,
const
swapCriterion
&
cr
,
bidimMeshData
&
data
)
std
::
vector
<
MTri3
*>
&
newTris
,
const
swapCriterion
&
cr
,
bidimMeshData
&
data
)
{
{
...
@@ -902,8 +897,10 @@ bool edgeSwap(std::set<swapquad> &configs, MTri3 *t1, GFace *gf, int iLocalEdge,
...
@@ -902,8 +897,10 @@ bool edgeSwap(std::set<swapquad> &configs, MTri3 *t1, GFace *gf, int iLocalEdge,
int
index2
=
data
.
getIndex
(
v2
);
int
index2
=
data
.
getIndex
(
v2
);
int
index3
=
data
.
getIndex
(
v3
);
int
index3
=
data
.
getIndex
(
v3
);
int
index4
=
data
.
getIndex
(
v4
);
int
index4
=
data
.
getIndex
(
v4
);
double
edgeCenter
[
2
]
=
{(
data
.
Us
[
index1
]
+
data
.
Us
[
index2
]
+
data
.
Us
[
index3
]
+
data
.
Us
[
index4
])
*
.25
,
double
edgeCenter
[
2
]
=
{(
data
.
Us
[
index1
]
+
data
.
Us
[
index2
]
+
(
data
.
Vs
[
index1
]
+
data
.
Vs
[
index2
]
+
data
.
Vs
[
index3
]
+
data
.
Vs
[
index4
])
*
.25
};
data
.
Us
[
index3
]
+
data
.
Us
[
index4
])
*
.25
,
(
data
.
Vs
[
index1
]
+
data
.
Vs
[
index2
]
+
data
.
Vs
[
index3
]
+
data
.
Vs
[
index4
])
*
.25
};
double
uv4
[
2
]
=
{
data
.
Us
[
index4
],
data
.
Vs
[
index4
]};
double
uv4
[
2
]
=
{
data
.
Us
[
index4
],
data
.
Vs
[
index4
]};
double
metric
[
3
];
double
metric
[
3
];
buildMetric
(
gf
,
edgeCenter
,
metric
);
buildMetric
(
gf
,
edgeCenter
,
metric
);
...
@@ -949,11 +946,15 @@ bool edgeSwap(std::set<swapquad> &configs, MTri3 *t1, GFace *gf, int iLocalEdge,
...
@@ -949,11 +946,15 @@ bool edgeSwap(std::set<swapquad> &configs, MTri3 *t1, GFace *gf, int iLocalEdge,
int
i21
=
data
.
getIndex
(
t2b
->
getVertex
(
1
));
int
i21
=
data
.
getIndex
(
t2b
->
getVertex
(
1
));
int
i22
=
data
.
getIndex
(
t2b
->
getVertex
(
2
));
int
i22
=
data
.
getIndex
(
t2b
->
getVertex
(
2
));
double
lc1
=
0.3333333333
*
(
data
.
vSizes
[
i10
]
+
data
.
vSizes
[
i11
]
+
data
.
vSizes
[
i12
]);
double
lc1
=
0.3333333333
*
(
data
.
vSizes
[
i10
]
+
data
.
vSizes
[
i11
]
+
double
lcBGM1
=
0.3333333333
*
(
data
.
vSizesBGM
[
i10
]
+
data
.
vSizesBGM
[
i11
]
+
data
.
vSizesBGM
[
i12
]);
data
.
vSizes
[
i12
]);
double
lcBGM1
=
0.3333333333
*
(
data
.
vSizesBGM
[
i10
]
+
data
.
vSizesBGM
[
i11
]
+
data
.
vSizesBGM
[
i12
]);
double
lc2
=
0.3333333333
*
(
data
.
vSizes
[
i20
]
+
data
.
vSizes
[
i21
]
+
data
.
vSizes
[
i22
]);
double
lc2
=
0.3333333333
*
(
data
.
vSizes
[
i20
]
+
data
.
vSizes
[
i21
]
+
double
lcBGM2
=
0.3333333333
*
(
data
.
vSizesBGM
[
i20
]
+
data
.
vSizesBGM
[
i21
]
+
data
.
vSizesBGM
[
i22
]);
data
.
vSizes
[
i22
]);
double
lcBGM2
=
0.3333333333
*
(
data
.
vSizesBGM
[
i20
]
+
data
.
vSizesBGM
[
i21
]
+
data
.
vSizesBGM
[
i22
]);
MTri3
*
t1b3
=
new
MTri3
(
t1b
,
Extend1dMeshIn2dSurfaces
()
?
MTri3
*
t1b3
=
new
MTri3
(
t1b
,
Extend1dMeshIn2dSurfaces
()
?
std
::
min
(
lc1
,
lcBGM1
)
:
lcBGM1
,
0
,
&
data
,
gf
);
std
::
min
(
lc1
,
lcBGM1
)
:
lcBGM1
,
0
,
&
data
,
gf
);
...
@@ -1151,7 +1152,8 @@ static int _recombineIntoQuads(GFace *gf, double minqual, bool cubicGraph = 1)
...
@@ -1151,7 +1152,8 @@ static int _recombineIntoQuads(GFace *gf, double minqual, bool cubicGraph = 1)
// FIXME !
// FIXME !
if
(
an
==
100000
/*|| an == 1000*/
){
if
(
an
==
100000
/*|| an == 1000*/
){
// toProcess.push_back(std::make_pair(n2t[i1],n2t[i2]));
// toProcess.push_back(std::make_pair(n2t[i1],n2t[i2]));
// Msg::Warning("Extra edge found in blossom algorithm, optimization will be required");
// Msg::Warning("Extra edge found in blossom algorithm, optimization "
// "will be required");
}
}
else
{
else
{
MElement
*
t1
=
n2t
[
i1
];
MElement
*
t1
=
n2t
[
i1
];
...
@@ -1261,8 +1263,8 @@ static double printStats(GFace *gf,const char *message)
...
@@ -1261,8 +1263,8 @@ static double printStats(GFace *gf,const char *message)
Qmin
=
std
::
min
(
Q
,
Qmin
);
Qmin
=
std
::
min
(
Q
,
Qmin
);
}
}
Msg
::
Info
(
"%s: %5d quads %5d triangles %1d invalid quads %2d quads with Q < 0.1 "
Msg
::
Info
(
"%s: %5d quads %5d triangles %1d invalid quads %2d quads with Q < 0.1 "
"Avg Q = %5.3f Min Q %5.3f"
,
message
,
gf
->
quadrangles
.
size
(),
gf
->
triangles
.
size
(),
"Avg Q = %5.3f Min Q %5.3f"
,
message
,
gf
->
quadrangles
.
size
(),
nbInv
,
nbBad
,
Qav
/
gf
->
quadrangles
.
size
(),
Qmin
);
gf
->
triangles
.
size
(),
nbInv
,
nbBad
,
Qav
/
gf
->
quadrangles
.
size
(),
Qmin
);
return
Qmin
;
return
Qmin
;
}
}
...
@@ -1368,4 +1370,3 @@ void quadsToTriangles(GFace *gf, double minqual)
...
@@ -1368,4 +1370,3 @@ void quadsToTriangles(GFace *gf, double minqual)
}
}
gf
->
quadrangles
=
qds
;
gf
->
quadrangles
=
qds
;
}
}
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