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
Analyze
Contributor 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
gmsh
gmsh
Commits
c269e7f6
Commit
c269e7f6
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
a4233644
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tutorial/t12.geo
+48
-39
48 additions, 39 deletions
tutorial/t12.geo
tutorial/t13.geo
+43
-5
43 additions, 5 deletions
tutorial/t13.geo
tutorial/t13_data.msh
+0
-0
0 additions, 0 deletions
tutorial/t13_data.msh
with
91 additions
and
44 deletions
tutorial/t12.geo
+
48
−
39
View file @
c269e7f6
...
...
@@ -2,56 +2,65 @@
*
* Gmsh tutorial 12
*
*
Re
meshing
STL
with compounds
*
Cross-patch
meshing with compounds
*
*********************************************************************/
// Compound geometrical entities can be defined to compute a new
// parametrization of groups of elementary geometrical entities. This
// parametrization can then be used for remeshing the compound as if
// it were a CAD entity.
// it were a
single
CAD entity.
// Merge the original mesh, that we would like to remesh. This mesh
// was reclassified ("colored") from an initial STL triangulation
// using the "Reclassify 2D" tool in Gmsh, so that we can preserve
// sharp geometrical features.
Merge
"t12_data.msh"
;
lc
=
0.2
;
Point
(
1
)
=
{
0
,
0
,
0
,
lc
};
Point
(
2
)
=
{
1
,
0
,
0
,
lc
};
Point
(
3
)
=
{
1
,
1
,
0.5
,
lc
};
Point
(
4
)
=
{
0
,
1
,
0.4
,
lc
};
Point
(
5
)
=
{
0.3
,
0.2
,
0
,
lc
};
Point
(
6
)
=
{
0
,
0.01
,
0.01
,
lc
};
Point
(
7
)
=
{
0
,
0.02
,
0.02
,
lc
};
Point
(
8
)
=
{
1
,
0.05
,
0.02
,
lc
};
Point
(
9
)
=
{
1
,
0.32
,
0.02
,
lc
};
Line
(
1
)
=
{
1
,
2
};
Line
(
2
)
=
{
2
,
8
};
Line
(
3
)
=
{
8
,
9
};
Line
(
4
)
=
{
9
,
3
};
Line
(
5
)
=
{
3
,
4
};
Line
(
6
)
=
{
4
,
7
};
Line
(
7
)
=
{
7
,
6
};
Line
(
8
)
=
{
6
,
1
};
Spline
(
9
)
=
{
7
,
5
,
9
};
Line
(
10
)
=
{
6
,
8
};
Line
Loop
(
11
)
=
{
5
,
6
,
9
,
4
};
Ruled
Surface
(
12
)
=
{
11
};
Line
Loop
(
13
)
=
{
9
,
-
3
,
-
10
,
-
7
};
Ruled
Surface
(
14
)
=
{
13
};
Line
Loop
(
15
)
=
{
10
,
-
2
,
-
1
,
-
8
};
Ruled
Surface
(
16
)
=
{
15
};
// Since the original mesh is a bit coarse, we refine it once
RefineMesh
;
// Treat lines 2, 3 and 4 as a single line
Compound
Line
(
100
)
=
{
2
,
3
,
4
};
// Idem with lines 6, 7 and 8
Compound
Line
(
101
)
=
{
6
,
7
,
8
};
// Create the topology of the discrete model
CreateTopology
;
// We can now define a compound line (resp. surface) for each discrete
// line (resp. surface) in the model
ll
[]
=
Line
"*"
;
For
j
In
{
0
:
#
ll
[]
-
1
}
Compound
Line
(
newl
)
=
ll
[
j
];
EndFor
ss
[]
=
Surface
"*"
;
s
=
news
;
For
i
In
{
0
:
#
ss
[]
-
1
}
Compound
Surface
(
s
+
i
)
=
ss
[
i
];
EndFor
Surface
Loop
(
1
)
=
{
s
:
s
+
#
ss
[]
-
1
};
Volume
(
1
)
=
{
1
};
Physical
Surface
(
1
)
=
{
s
:
s
+
#
ss
[]
-
1
};
Physical
Volume
(
1
)
=
1
;
// Apply a funny mesh size field, just because we can :-)
Field
[
1
]
=
MathEval
;
Field
[
1
].
F
=
"2*Sin((x+y)/5) + 3.3"
;
Background
Field
=
1
;
Mesh
.
RemeshAlgorithm
=
1
;
// (0) no split (1) automatic (2) automatic only with metis
Mesh
.
RemeshParametrization
=
1
;
// (0) harmonic (1) conformal
// Treat surfaces 12, 14 and 16 as a single surface
Compound
Surface
(
200
)
=
{
12
,
14
,
16
};
// More details about the reparametrization technique can be found in
// the following papers:
//
// * J.-F. Remacle, C. Geuzaine, G. Compère and E. Marchandise,
// "High-Quality Surface Remeshing Using Harmonic Maps",
// International Journal for Numerical Methods in Engineering,
// 83 (4), pp. 403-425, 2010.
//
//
// * E. Marchandise, G. Compère, M. Willemet, G. Bricteux, C. Geuzaine
// and J-F Remacle, "Quality meshing based on STL triangulations for
// biomedical simulations", International Journal for Numerical
// Methods in Biomedical Engineering", 26 (7), pp. 876-889, 2010.
//
// * E. Marchandise, C. Carton de Wiart, W. G. Vos, C. Geuzaine and
// J.-F. Remacle, "High Quality Surface Remeshing Using Harmonic
// Maps. Part II: Surfaces with High Genus and of Large Aspect
// Ratio", International Journal for Numerical Methods in
// Engineering, 86 (11), pp. 1303-1321, 2011.
This diff is collapsed.
Click to expand it.
tutorial/t13.geo
+
43
−
5
View file @
c269e7f6
...
...
@@ -2,12 +2,50 @@
*
* Gmsh tutorial 13
*
*
Cross-patch
meshing with compounds
*
Re
meshing
STL
with compounds
*
*********************************************************************/
// Compound geometrical entities can be defined to compute a new
// parametrization of groups of elementary geometrical entities. This
// parametrization can then be used for remeshing the compound as if
// it were a CAD entity.
// Since compound geometrical compute a new parametrization, one can
// also use them to remesh STL files, even if there's only a single
// elementary per compound.
// Let's merge the mesh that we would like to remesh. This mesh was
// reclassified ("colored") from an initial STL triangulation using
// the "Reclassify 2D" tool in Gmsh, so that we could split it along
// sharp geometrical features.
Merge
"t13_data.msh"
;
// Since the original mesh is a bit coarse, we refine it once
RefineMesh
;
// Create the topology of the discrete model
CreateTopology
;
// We can now define a compound line (resp. surface) for each discrete
// line (resp. surface) in the model
ll
[]
=
Line
"*"
;
For
j
In
{
0
:
#
ll
[]
-
1
}
Compound
Line
(
newl
)
=
ll
[
j
];
EndFor
ss
[]
=
Surface
"*"
;
s
=
news
;
For
i
In
{
0
:
#
ss
[]
-
1
}
Compound
Surface
(
s
+
i
)
=
ss
[
i
];
EndFor
// And we can create the volume based on the new compound entities
Surface
Loop
(
1
)
=
{
s
:
s
+
#
ss
[]
-
1
};
Volume
(
1
)
=
{
1
};
Physical
Surface
(
1
)
=
{
s
:
s
+
#
ss
[]
-
1
};
Physical
Volume
(
1
)
=
1
;
// Apply a funny mesh size field, just because we can :-)
Field
[
1
]
=
MathEval
;
Field
[
1
].
F
=
"2*Sin((x+y)/5) + 3.3"
;
Background
Field
=
1
;
Mesh
.
RemeshAlgorithm
=
1
;
// (0) no split (1) automatic (2) automatic only with metis
Mesh
.
RemeshParametrization
=
1
;
// (0) harmonic (1) conformal
This diff is collapsed.
Click to expand it.
tutorial/t1
2
_data.msh
→
tutorial/t1
3
_data.msh
+
0
−
0
View file @
c269e7f6
File moved
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