doc:user:geometry:mesh:3d
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
doc:user:geometry:mesh:3d [2013/07/12 15:42] – external edit 127.0.0.1 | doc:user:geometry:mesh:3d [2020/07/06 15:54] – [Mesher by extrusion] papeleux | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== 3D Meshers (Volumes) |
- | ===== Mailleur transfini | + | ===== 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: | ||
- | Metafor possède en interne un mailleur simple transfini qui permet de mailler des objets à topologie hexaédrique (6 faces tel un cube). Pour des géométries plus complexes, il est nécessaire de découper manuellement la structure en domaines hexaédriques ou de se tourner vers des mailleurs externes plus élaborés ([[doc: | + | __Preliminary note:__ To mesh a '' |
- | + | ||
- | __Remarque préliminaire:__ Pour mailler un '' | + | |
{{ doc: | {{ doc: | ||
- | ==== Avec autodétection | + | ==== With auto-detection |
- | L' | + | Auto-detection is possible |
TransfiniteMesher3D(volumeset(number)).execute(type) | TransfiniteMesher3D(volumeset(number)).execute(type) | ||
- | | '' | + | | '' |
- | | '' | + | | '' |
- | Dans ce cas, la '' | + | In this case, the '' |
{{ doc: | {{ doc: | ||
- | c' | + | which means that |
skin = add(Skin(1)); | skin = add(Skin(1)); | ||
Line 30: | Line 29: | ||
| | ||
- | où les numéros du '' | + | where the number used in the '' |
- | ==== Sans autodétection | + | ==== Without auto-detection |
- | Le cas sans autodétection est le cas général. Il peut être appliqué à n' | + | This case is the most general, and can be applied to any '' |
- | Pour fonctionner, | + | The mesher needs a set of 12 sets of '' |
mat = ((mat11, ..., mat1nbmax), ..., (mat121, ..., mat12nbmax)) | mat = ((mat11, ..., mat1nbmax), ..., (mat121, ..., mat12nbmax)) | ||
TransfiniteMesher3D(volumeset(number)).execute2(mat, | TransfiniteMesher3D(volumeset(number)).execute2(mat, | ||
- | | '' | + | where '' |
- | | '' | + | |
- | Les numéros des '' | + | These 12 tuples must be ordered as shown below: |
{{ doc: | {{ doc: | ||
- | __Exemple:__ | + | __Example:__ |
{{ doc: | {{ doc: | ||
- | Le domaine hexaédrique ci-dessus peut se mailler indifféremment par: | + | The hexahedral domain above can be meshed with the command: |
TransfiniteMesher3D(volumeset(1)).execute2( ((103, | TransfiniteMesher3D(volumeset(1)).execute2( ((103, | ||
- | ou | + | or |
TransfiniteMesher3D(volumeset(1)).execute2( (5, | TransfiniteMesher3D(volumeset(1)).execute2( (5, | ||
- | ou | + | or |
TransfiniteMesher3D(volumeset(1)).execute2( (6, | TransfiniteMesher3D(volumeset(1)).execute2( (6, | ||
- | ou | + | or |
... | ... | ||
- | pour donner | + | leading to: |
{{ doc: | {{ doc: | ||
- | ==== Maillage transfini | + | ==== Transfinite |
- | Il suffit de procéder de la manière suivante pour mailler un '' | + | This is done with the commands: |
MesherTFI3D =TransfiniteMesher3D(volumeset(number)) | MesherTFI3D =TransfiniteMesher3D(volumeset(number)) | ||
Line 75: | Line 73: | ||
MesherTFI3D.execute(type, | MesherTFI3D.execute(type, | ||
- | lorsqu' | + | when one if the edges is already discretized using a mesh elements |
- | __Remarque__ | + | __Note__ |
- | ===== Mailleur par extrusion ===== | + | ===== 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 '' | ||
- | Cette méthode est utilisable mais pourrait être améliorée: | + | The geometry associated to the extrusion |
- | On peut aussi créer la géométrie suite à l' | + | |
- | === Exemple | + | === Example |
- | Il s'agit de l'extrusion d'un cercle troué par un carré (voir '' | + | Extrusion of a circle pierced by a square (see '' |
- | {{ commit: | + | {{commit: |
+ | {{: | ||
+ | {{: | ||
+ | {{: | ||
- | Je vous épargne la création et le maillage du cercle. Pour extruder le résultat | + | The definition and meshing of the circle can be seen in the the file. To extrude the result |
mesher = ExtrusionMesher3D(sideset(1), | mesher = ExtrusionMesher3D(sideset(1), | ||
mesher.setFillGroup(True) | mesher.setFillGroup(True) | ||
mesher.setDirection(0.0, | mesher.setDirection(0.0, | ||
- | mesher.setLength(8) | + | mesher.setLength(length) |
- | mesher.setNbOfLayers(10) | + | mesher.setNbOfLayers(nLayers, dist = 1.0) |
+ | mesher.setAnglefct(fctAngle) | ||
+ | mesher.setXfct(fctX) | ||
+ | mesher.setYfct(fctY) | ||
mesher.execute() | mesher.execute() | ||
grpNo = mesher.getLastLayer(no) | grpNo = mesher.getLastLayer(no) | ||
- | | Group 1 | toutes les mailles y font référence | + | | Group 1 | all the mesh element refer to this group (the '' |
- | | setFillGroup() | + | | setFillGroup() |
- | | setDirection | + | | setDirection |
- | | setLength | + | | setLength |
- | | setNbOfLayers | + | |
- | | execute | + | |
- | | getLastLayer(no) | renvoie le Groupe grpNo (numéro '' | + | |
+ | | 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 '' | ||
- | :!: En maillant en deux dimensions, bien définir les contours "aire à gauche" | ||
+ | :!: When meshing in 2D, the wires must be defined "area to the left" :!: | ||
- | === Exemple 2 ==== | ||
- | De la même manière, une face plane maillée en triangles | + | === Example 2 ==== |
+ | |||
+ | In a same way, a planar | ||
{{ commit: | {{ commit: | ||
- | ==== Création de la géométrie | + | ==== Creation of the geometry |
- | === Cas général: Extrusion | + | === General case: Extrusion |
- | Après l'extrusion | + | After the extrusion |
mesher.createGeometryOn(Side, | mesher.createGeometryOn(Side, | ||
- | Les objets géométriques créés sont numérotés à partir de NoGObject. | + | Geometrical objects are created and numbered starting from NoGObject. |
+ | |||
+ | The function '' | ||
- | Une fonction permet de créer uniquement une '' | ||
line = createLineAbove(pt1, | line = createLineAbove(pt1, | ||
- | | line | '' | + | | line | '' |
- | | pt1 | '' | + | | pt1 | reference |
- | | NumPtOnTop | numéro du '' | + | | NumPtOnTop | number of the '' |
- | === Cas particulier: extrusion | + | === Particular case : extrusion |
- | + | To create a geometry after the extrusion | |
- | Pour créer la géométrie après l'extrusion | + | |
mesher.createGeometry(NoGObject, | mesher.createGeometry(NoGObject, | ||
- | :!: Pour utiliser cette fonction il faut que la cible à extruder soit de type '' | + | :!: To use this function, the target to extrude must be of type '' |
- | Les objets géométriques créés sont numérotés à partir de NoGObject. | + | Geometrical objects are created and numbered starting from NoGObject. |
=== Récupération des objets géométrique === | === Récupération des objets géométrique === | ||
- | + | The retrieval of the created geometrical objetcs is done with the functions: | |
- | La récupération des objets géométrique créés se fait avec les fonctions: | + | |
Vol1 = mesher.getVolumeOnTop(side1) | Vol1 = mesher.getVolumeOnTop(side1) | ||
Line 157: | Line 167: | ||
point = mesher.getPointOnTop(ptref) | point = mesher.getPointOnTop(ptref) | ||
- | | Vol1 | '' | + | | Vol1 | '' |
- | | side | '' | + | | side | '' |
- | | curve | '' | + | | curve | '' |
- | | point | '' | + | | point | '' |
- | La géométrie est crée dans le cas test '' | + | The geometry is created in the test cases '' |
- | <note important> | + | < |
- | ATTENTION, après la création de la géométrie, il faut ajouter le '' | + | CAREFUL, after creating the geometry, the '' |
</ | </ | ||
+ | ===== Mesher by extrusion of revolution ===== | ||
- | ===== Mailleur par extrusion | + | Axisymmetric |
+ | The extrusion can be open ($0 < \mbox{angle} < 360^\circ$) or close ($\mbox{angle} | ||
- | Extrusion axisymétrique d'une face maillée. | + | To this day, no reconstruction |
- | L' | + | |
- | A ce jour, il n'y a pas de reconstruction | + | |
mesher = RevolutionExtrusionMesher3D(gobject, | mesher = RevolutionExtrusionMesher3D(gobject, | ||
Line 182: | Line 191: | ||
mesher.execute() | mesher.execute() | ||
- | | gobject | + | | gobject |
- | | group | Group father | + | | group | Group father |
- | | axe | Ligne géométrique définissant l'axe de révolution | + | | axe | Line which defines the revolution axis | |
- | | setLength | + | | setLength |
- | | setNbOfLayers | + | | setNbOfLayers |
- | | execute | + | | execute |
- | ==== Exemple | + | ==== Example |
{{: | {{: |
doc/user/geometry/mesh/3d.txt · Last modified: 2021/11/19 14:52 by papeleux