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
6325ca66
Commit
6325ca66
authored
14 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
recombine & blossom without parametrization
parent
e8ee0c3e
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Mesh/Generator.cpp
+16
-0
16 additions, 0 deletions
Mesh/Generator.cpp
Mesh/Generator.h
+1
-0
1 addition, 0 deletions
Mesh/Generator.h
Mesh/meshGFaceOptimize.cpp
+43
-33
43 additions, 33 deletions
Mesh/meshGFaceOptimize.cpp
with
60 additions
and
33 deletions
Mesh/Generator.cpp
+
16
−
0
View file @
6325ca66
...
...
@@ -567,6 +567,22 @@ void AdaptMesh(GModel *m)
Msg
::
StatusBar
(
2
,
true
,
"Done adaptating 3D mesh (%g s)"
,
t2
-
t1
);
}
void
RecombineMesh
(
GModel
*
m
)
{
Msg
::
StatusBar
(
2
,
true
,
"Recombining 2D mesh..."
);
double
t1
=
Cpu
();
for
(
GModel
::
fiter
it
=
m
->
firstFace
();
it
!=
m
->
lastFace
();
++
it
){
GFace
*
gf
=
*
it
;
recombineIntoQuads
(
gf
);
}
CTX
::
instance
()
->
mesh
.
changed
=
ENT_ALL
;
double
t2
=
Cpu
();
Msg
::
StatusBar
(
2
,
true
,
"Done recombining 2D mesh (%g s)"
,
t2
-
t1
);
}
void
GenerateMesh
(
GModel
*
m
,
int
ask
)
{
if
(
CTX
::
instance
()
->
lock
)
{
...
...
This diff is collapsed.
Click to expand it.
Mesh/Generator.h
+
1
−
0
View file @
6325ca66
...
...
@@ -15,5 +15,6 @@ void OptimizeMesh(GModel *m);
void
OptimizeMeshNetgen
(
GModel
*
m
);
void
RefineMesh
(
GModel
*
m
,
bool
linear
,
bool
splitIntoQuads
=
false
,
bool
splitIntoHexas
=
false
);
void
RecombineMesh
(
GModel
*
m
);
#endif
This diff is collapsed.
Click to expand it.
Mesh/meshGFaceOptimize.cpp
+
43
−
33
View file @
6325ca66
...
...
@@ -1842,20 +1842,28 @@ void recombineIntoQuads(GFace *gf,
bool
topologicalOpti
,
bool
nodeRepositioning
)
{
double
t1
=
Cpu
();
bool
haveParam
=
true
;
if
(
gf
->
geomType
()
==
GEntity
::
DiscreteSurface
&&
!
gf
->
getCompound
())
haveParam
=
false
;
gf
->
model
()
->
writeMSH
(
"before.msh"
);
if
(
topologicalOpti
)
removeFourTrianglesNodes
(
gf
,
false
);
if
(
haveParam
&&
topologicalOpti
)
removeFourTrianglesNodes
(
gf
,
false
);
int
success
=
_recombineIntoQuads
(
gf
,
0
);
// gf->addLayersOfQuads(1, 0);
gf
->
model
()
->
writeMSH
(
"raw.msh"
);
if
(
nodeRepositioning
)
if
(
haveParam
&&
nodeRepositioning
)
laplaceSmoothing
(
gf
,
CTX
::
instance
()
->
mesh
.
nbSmoothing
);
// blossom-quad algo
if
(
success
&&
CTX
::
instance
()
->
mesh
.
algoRecombine
==
1
){
if
(
topologicalOpti
){
if
(
haveParam
){
gf
->
model
()
->
writeMSH
(
"smoothed.msh"
);
int
COUNT
=
0
;
char
NAME
[
256
];
...
...
@@ -1869,9 +1877,10 @@ void recombineIntoQuads(GFace *gf,
if
(
z
){
sprintf
(
NAME
,
"iter%dS.msh"
,
COUNT
++
);
gf
->
model
()
->
writeMSH
(
NAME
);
}
if
(
!
(
x
+
y
+
z
))
break
;
}
}
edgeSwapQuadsForBetterQuality
(
gf
);
//if(z){ sprintf(NAME,"iter%dS.msh",COUNT++); gf->model()->writeMSH(NAME); }
laplaceSmoothing
(
gf
,
CTX
::
instance
()
->
mesh
.
nbSmoothing
);
if
(
haveParam
)
laplaceSmoothing
(
gf
,
CTX
::
instance
()
->
mesh
.
nbSmoothing
);
}
double
t2
=
Cpu
();
Msg
::
Info
(
"Blossom recombination algorithm completed (%g s)"
,
t2
-
t1
);
...
...
@@ -1880,19 +1889,19 @@ void recombineIntoQuads(GFace *gf,
// simple recombination algo
_recombineIntoQuads
(
gf
,
0
);
laplaceSmoothing
(
gf
,
CTX
::
instance
()
->
mesh
.
nbSmoothing
);
if
(
haveParam
)
laplaceSmoothing
(
gf
,
CTX
::
instance
()
->
mesh
.
nbSmoothing
);
_recombineIntoQuads
(
gf
,
0
);
laplaceSmoothing
(
gf
,
CTX
::
instance
()
->
mesh
.
nbSmoothing
);
if
(
haveParam
)
laplaceSmoothing
(
gf
,
CTX
::
instance
()
->
mesh
.
nbSmoothing
);
// gf->model()->writeMSH("after.msh");
double
t2
=
Cpu
();
Msg
::
Info
(
"Simple recombination algorithm completed (%g s)"
,
t2
-
t1
);
}
// give it a try : add one quad layer on the
void
addOneLayerOnContour
(
GFace
*
gf
,
GVertex
*
gv
){
void
addOneLayerOnContour
(
GFace
*
gf
,
GVertex
*
gv
)
{
/*
, int nbLayers, double hplus, double factor){
// for each vertex
...
...
@@ -1985,7 +1994,8 @@ void addOneLayerOnContour(GFace *gf, GVertex *gv){
*/
}
void
quadsToTriangles
(
GFace
*
gf
,
double
minqual
=
-
10000.
){
void
quadsToTriangles
(
GFace
*
gf
,
double
minqual
=
-
10000.
)
{
std
::
vector
<
MQuadrangle
*>
qds
;
for
(
int
i
=
0
;
i
<
gf
->
quadrangles
.
size
();
i
++
){
MQuadrangle
*
q
=
gf
->
quadrangles
[
i
];
...
...
@@ -2023,8 +2033,8 @@ void quadsToTriangles(GFace *gf, double minqual = -10000.){
gf
->
quadrangles
=
qds
;
}
void
recombineIntoQuadsIterative
(
GFace
*
gf
)
{
void
recombineIntoQuadsIterative
(
GFace
*
gf
)
{
recombineIntoQuads
(
gf
);
quadsToTriangles
(
gf
,
0.03
);
return
;
...
...
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