doc:user:geometry:mesh:3d
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:user:geometry:mesh:3d [2013/07/12 14:58] – joris | doc:user:geometry:mesh:3d [2021/11/19 14:52] (current) – papeleux | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 3D Meshers (Volumes) ====== | ||
+ | |||
+ | ===== Transfinite Mesher ===== | ||
+ | |||
+ | Metafor possesses a simple transfinite mesher, which is able to mesh hexahedra (object with 6 sides, such as a cube). For more complex geometries, it is necessary to divide it into hexaedra or use external meshers ([[doc: | ||
+ | |||
+ | __Preliminary note:__ To mesh a '' | ||
+ | |||
+ | {{ doc: | ||
+ | |||
+ | ==== With auto-detection ==== | ||
+ | |||
+ | Auto-detection is possible if the '' | ||
+ | |||
+ | TransfiniteMesher3D(volumeset(number)).execute(type) | ||
+ | |||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | In this case, the '' | ||
+ | |||
+ | {{ doc: | ||
+ | |||
+ | which means that | ||
+ | |||
+ | skin = add(Skin(1)); | ||
+ | for i in [1, | ||
+ | | ||
+ | |||
+ | where the number used in the '' | ||
+ | |||
+ | |||
+ | ==== Without auto-detection ==== | ||
+ | |||
+ | This case is the most general, and can be applied to any '' | ||
+ | |||
+ | The mesher needs a set of 12 sets of '' | ||
+ | |||
+ | mat = ((mat11, ..., mat1nbmax), ..., (mat121, ..., mat12nbmax)) | ||
+ | TransfiniteMesher3D(volumeset(number)).execute2(mat, | ||
+ | |||
+ | where '' | ||
+ | |||
+ | These 12 tuples must be ordered as shown below: | ||
+ | |||
+ | {{ doc: | ||
+ | |||
+ | __Example: | ||
+ | |||
+ | {{ doc: | ||
+ | |||
+ | The hexahedral domain above can be meshed with the command: | ||
+ | |||
+ | TransfiniteMesher3D(volumeset(1)).execute2( ((103, | ||
+ | or | ||
+ | TransfiniteMesher3D(volumeset(1)).execute2( (5, | ||
+ | or | ||
+ | TransfiniteMesher3D(volumeset(1)).execute2( (6, | ||
+ | or | ||
+ | ... | ||
+ | |||
+ | leading to: | ||
+ | |||
+ | {{ doc: | ||
+ | |||
+ | ==== Transfinite 3D mesher with non-uniform mesh elements distribution ==== | ||
+ | |||
+ | This is done with the commands: | ||
+ | |||
+ | MesherTFI3D =TransfiniteMesher3D(volumeset(number)) | ||
+ | MesherTFI3D.setEnableDistribution() | ||
+ | MesherTFI3D.execute(type, | ||
+ | |||
+ | when one if the edges is already discretized using a mesh elements distribution. | ||
+ | |||
+ | __Note__ : By default, the parameter '' | ||
+ | |||
+ | ===== Mesher by extrusion ===== | ||
+ | |||
+ | This method can be used, but could be improved upon: density non-constant along the extrusion direction, improvement of meshing speed, giving the extruded nodes as groups (internal ones, external surface, ...). For now on, a '' | ||
+ | |||
+ | The geometry associated to the extrusion can also be created (only for a '' | ||
+ | |||
+ | === Example ==== | ||
+ | |||
+ | Extrusion of a circle pierced by a square (see '' | ||
+ | |||
+ | {{commit: | ||
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
+ | |||
+ | The definition and meshing of the circle can be seen in the the file. To extrude the result ('' | ||
+ | |||
+ | mesher = ExtrusionMesher3D(sideset(1), | ||
+ | mesher.setFillGroup(True) | ||
+ | mesher.setDirection(0.0, | ||
+ | mesher.setLength(length) | ||
+ | mesher.setNbOfLayers(nLayers, | ||
+ | mesher.setAnglefct(fctAngle) | ||
+ | mesher.setXfct(fctX) | ||
+ | mesher.setYfct(fctY) | ||
+ | mesher.execute() | ||
+ | grpNo = mesher.getLastLayer(no) | ||
+ | |||
+ | | Group 1 | all the mesh element refer to this group (the '' | ||
+ | | setFillGroup() | ||
+ | | setDirection | ||
+ | | setLength | ||
+ | |||
+ | | setNbOfLayers | ||
+ | | | dist : ratio between the length of the last and first element (default : dist = 1.0) | | ||
+ | | setAnglefct(fctAngle) | Application of a rotation of slices around extrusion vector (direction ' | ||
+ | | fctAngle | One parameter defining rotation of slices function in degrees (t) - t=[0,1] ATTENTION : fctAngle(0) = 0 | | ||
+ | | setXfct(fctX) | Application of a modification of the generatrice direction in X Direction | | ||
+ | | setYfct(fctY) | Application of a modification of the generatrice direction in Y Direction | | ||
+ | | fctX/fctY | One parameter defining modification of generatrice : fct(t) - ATTENTION t=[0, | ||
+ | | execute | ||
+ | | getLastLayer(no) | returns the group grpNo (number '' | ||
+ | |||
+ | |||
+ | :!: When meshing in 2D, the wires must be defined "area to the left" :!: | ||
+ | |||
+ | |||
+ | === Example 2 ==== | ||
+ | |||
+ | In a same way, a planar face meshed with triangles can be extruded in 3D to be meshed with prisms (see '' | ||
+ | |||
+ | {{ commit: | ||
+ | |||
+ | |||
+ | ==== Creation of the geometry ==== | ||
+ | |||
+ | |||
+ | === General case: Extrusion of a'' | ||
+ | |||
+ | After the extrusion of a '' | ||
+ | mesher.createGeometryOn(Side, | ||
+ | Geometrical objects are created and numbered starting from NoGObject. | ||
+ | |||
+ | The function '' | ||
+ | |||
+ | line = createLineAbove(pt1, | ||
+ | |||
+ | | line | '' | ||
+ | | pt1 | reference '' | ||
+ | | NumPtOnTop | number of the '' | ||
+ | |||
+ | |||
+ | === Particular case : extrusion of a Side === | ||
+ | |||
+ | To create a geometry after the extrusion of a '' | ||
+ | mesher.createGeometry(NoGObject, | ||
+ | :!: To use this function, the target to extrude must be of type '' | ||
+ | |||
+ | Geometrical objects are created and numbered starting from NoGObject. | ||
+ | |||
+ | |||
+ | === Récupération des objets géométrique === | ||
+ | |||
+ | The retrieval of the created geometrical objetcs is done with the functions: | ||
+ | |||
+ | Vol1 = mesher.getVolumeOnTop(side1) | ||
+ | side = mesher.getSideOnTop(curveOrSide) | ||
+ | curve = mesher.getCurveOnTop(pointOrCurve) | ||
+ | point = mesher.getPointOnTop(ptref) | ||
+ | |||
+ | | Vol1 | '' | ||
+ | | side | '' | ||
+ | | curve | '' | ||
+ | | point | '' | ||
+ | |||
+ | The geometry is created in the test cases '' | ||
+ | |||
+ | < | ||
+ | CAREFUL, after creating the geometry, the '' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Mesher by extrusion of revolution ===== | ||
+ | |||
+ | Axisymmetric extrusion of a meshed side. | ||
+ | The extrusion can be open ($0 < \mbox{angle} < 360^\circ$) or close ($\mbox{angle} = 360^\circ$). | ||
+ | |||
+ | To this day, no reconstruction of the extruded geometry exists. '' | ||
+ | |||
+ | mesher = RevolutionExtrusionMesher3D(gobject, | ||
+ | setAngle(angle) | ||
+ | mesher.setNbOfLayers(10) | ||
+ | mesher.execute() | ||
+ | |||
+ | | gobject | ||
+ | | group | Group father of the 3D mesh elements | ||
+ | | axe | Line which defines the revolution axis | | ||
+ | | setAngle | ||
+ | | setNbOfLayers | ||
+ | | setFillGroup | ||
+ | | execute | ||
+ | | getLastLayer | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | {{: |
doc/user/geometry/mesh/3d.txt · Last modified: 2021/11/19 14:52 by papeleux