t13.geo 926 Bytes
Newer Older
Christophe Geuzaine's avatar
Christophe Geuzaine committed
1 2 3 4
/*********************************************************************
 *
 *  Gmsh tutorial 13
 *
5
 *  Remeshing without an underlying CAD model
Christophe Geuzaine's avatar
Christophe Geuzaine committed
6 7 8
 *
 *********************************************************************/

9
// Let's merge a mesh that we would like to remesh. This mesh was reclassified
Christophe Geuzaine's avatar
Christophe Geuzaine committed
10 11
// ("colored") from an initial STL triangulation using the "Reclassify 2D" tool
// in Gmsh, so that we could split it along sharp geometrical features.
12
Merge "t13_data.msh";
Christophe Geuzaine's avatar
Christophe Geuzaine committed
13

14 15 16 17 18
// Create a geometry for all the curves and surfaces in the mesh, by computing a
// parametrization for each entity
CreateGeometry;

// Create a volume as usual
Christophe Geuzaine's avatar
Christophe Geuzaine committed
19
Surface Loop(1) = Surface{:};
Christophe Geuzaine's avatar
Christophe Geuzaine committed
20
Volume(1) = {1};
Christophe Geuzaine's avatar
Christophe Geuzaine committed
21 22 23

// element size imposed by a size field
Field[1] = MathEval;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
24
Field[1].F = "4";
Christophe Geuzaine's avatar
Christophe Geuzaine committed
25 26
Background Field = 1;

27
funny = DefineNumber[0, Choices{0,1}, Name "Parameters/Apply funny mesh size field?" ];
Christophe Geuzaine's avatar
Christophe Geuzaine committed
28 29 30
If(funny)
  Field[1].F = "2*Sin((x+y)/5) + 3";
EndIf