Skip to content
Snippets Groups Projects
Commit a1c0a020 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

new reparam stragety

parent f7560d22
No related branches found
No related tags found
No related merge requests found
......@@ -27,32 +27,15 @@ Line Loop(11) = {5, 6, 9, 4}; Surface(12) = {11};
Line Loop(13) = {9, -3, -10, -7}; Surface(14) = {13};
Line Loop(15) = {10, -2, -1, -8}; Surface(16) = {15};
// FIXME - the global "meshDiscrete" option will be replaced by meshing
// constraints
General.MeshDiscrete = 1;
// Treat lines 2, 3 and 4 as a single line
Compound Line(100) = {2, 3, 4};
Compound Line{2, 3, 4};
// Idem with lines 6, 7 and 8
Compound Line(101) = {6, 7, 8};
Compound Line{6, 7, 8};
// Treat surfaces 12, 14 and 16 as a single surface
Compound Surface(200) = {12, 14, 16};
// Add option to toggle visibility of sub-entities
DefineConstant[ hide = {Geometry.HideCompounds, Choices{0,1},
Name "Hide compound sub-entities", GmshOption "Geometry.HideCompounds",
AutoCheck 0} ];
// 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.
Compound Surface{12, 14, 16};
......@@ -10,54 +10,36 @@
// them to remesh STL files, even if in this case there's usually only a single
// elementary geometrical entity per compound.
// FIXME - the global "meshDiscrete" option will be replaced by meshing
// constraints "Compound Surface{...};"
General.MeshDiscrete = 1;
// 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
// FIXME: this is currently not used
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};
Surface Loop(1) = {ss[]};
Volume(1) = {1};
Physical Surface(1) = {s : s + #ss[]-1};
Physical Volume(1) = 1;
Physical Line(1) = {26 ... 37};
// element size imposed by a size field
Field[1] = MathEval;
Field[1].F = "2.0";
Background Field = 1;
DefineConstant[
funny = {0, Choices{0,1},
Name "Parameters/Apply funny mesh size field?"},
hide = {Geometry.HideCompounds, Choices{0,1},
AutoCheck 0, GmshOption "Geometry.HideCompounds",
Name "Parameters/Hide compound sub-entities"}
funny = {1, Choices{0,1},
Name "Parameters/Apply funny mesh size field?"}
];
If(funny)
Field[1].F = "2*Sin((x+y)/5) + 3";
EndIf
Mesh.RemeshAlgorithm = 1; // automatic
Mesh.RemeshParametrization = 7; // conformal finite element
Mesh.Algorithm = 6; // Frontal
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment