doc:user:geometry:mesh:2d
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:user:geometry:mesh:2d [2013/07/12 14:33] – joris | doc:user:geometry:mesh:2d [2021/12/17 14:02] (current) – boman | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== 2D Meshers (Surfaces) ====== | ||
| + | Metafor has a few integrated meshers, quite simple but usually capable of meshing parts that are not too complicated. However, 2D meshers require that the '' | ||
| + | |||
| + | {{ doc: | ||
| + | |||
| + | ===== Transfinite mesher ===== | ||
| + | |||
| + | ==== With auto-detection ==== | ||
| + | |||
| + | The auto-detection is working if the '' | ||
| + | |||
| + | TransfiniteMesher2D(sideset(number)).execute(type, | ||
| + | |||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | {{ doc: | ||
| + | |||
| + | In the example above, the auto-detection is doable. | ||
| + | |||
| + | A similar function for higher degrees is: | ||
| + | |||
| + | HighDegreeTransfiniteMesher2D(sideset(number), | ||
| + | |||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | For 9-nodes mesh elements, the central node is linked to the '' | ||
| + | For 16-nodes mesh elements, central nodes are linked to the '' | ||
| + | |||
| + | ==== Without auto-detection ==== | ||
| + | |||
| + | mat = ((mat11, mat12, ..., mat1nbmax), | ||
| + | | ||
| + | | ||
| + | | ||
| + | TransfiniteMesher2D(sideset(number)).execute2(mat, | ||
| + | |||
| + | where '' | ||
| + | |||
| + | __Example: | ||
| + | |||
| + | {{ doc: | ||
| + | |||
| + | This face can be meshed by the command: | ||
| + | |||
| + | | ||
| + | |||
| + | The order of the lines does not matter in 2D (in opposition to the [[doc: | ||
| + | |||
| + | | ||
| + | |||
| + | |||
| + | ==== Transfinite mesher on a side ==== | ||
| + | |||
| + | |||
| + | The mesh can be projected on the surface '' | ||
| + | |||
| + | | ||
| + | |||
| + | ==== 2D transfinite mesher with a non-uniform mesh elements distribution ==== | ||
| + | |||
| + | This is done with the commands: | ||
| + | |||
| + | MesherTFI2D =TransfiniteMesher2D(sideset(number)) | ||
| + | MesherTFI2D.setEnableDistribution() | ||
| + | MesherTFI2D.execute(type, | ||
| + | |||
| + | when one if the edges is already discretized using a mesh elements distribution. | ||
| + | |||
| + | Note : By default, the parameter of the function '' | ||
| + | |||
| + | ===== Frontal mesher ===== | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Use ==== | ||
| + | |||
| + | Triangles (frontal): | ||
| + | |||
| + | sidset(no).frontalTriangle(d) | ||
| + | |||
| + | Quadrangles (offset + frontal): | ||
| + | |||
| + | sidset(no).frontalQuad(d) | ||
| + | |||
| + | where '' | ||
| + | |||
| + | ===== Gen4 mesher ===== | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | This quadrangular mesher is based on [[http:// | ||
| + | |||
| + | <note important> | ||
| + | ==== Possibilities ==== | ||
| + | |||
| + | Gen4 can be used to mesh: | ||
| + | |||
| + | * any planar face (convex or not, with or without holes) | ||
| + | * including density (linear interpolation between two values specified on the vertices of the face). | ||
| + | * including the " | ||
| + | * with integrated smoothing | ||
| + | * with topological correction | ||
| + | |||
| + | ==== Use ==== | ||
| + | |||
| + | These lines are used to mesh the face #1 of the domain, whose vertices (points #1, #2, #3 and #4) densities are 0.1, 0.1, 0.2 and 0.05. | ||
| + | |||
| + | from toolbox.meshers import Gen4Mesher | ||
| + | defaultDensity = 0.1 | ||
| + | mesher = Gen4Mesher(sideset(1), | ||
| + | mesher.setPointD(3, | ||
| + | mesher.setPointD(4, | ||
| + | mesher.execute() | ||
| + | |||
| + | A default density, used unless explicitly stated differently, | ||
| + | |||
| + | __CAREFUL__ : The face #1 must be defined in the XY plane. | ||
| + | |||
| + | {{ doc: | ||
| + | |||
| + | ===== Triangular mesher ===== | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | Create triangles on a planar face, as a function of | ||
| + | |||
| + | * the maximal area of the triangle | ||
| + | * the maximal angle of the triangle | ||
| + | |||
| + | ==== Use ==== | ||
| + | |||
| + | See, for example, the case '' | ||
| + | |||
| + | < | ||
| + | from toolbox.meshers import TriangleMesher | ||
| + | mesher = TriangleMesher(sideset(1), | ||
| + | # | ||
| + | mesher.setMaxArea(0.05) | ||
| + | mesher.execute() | ||
| + | </ | ||
| + | |||
| + | {{ doc: | ||
