FEM Maillage FEM à maillage

From FreeCAD Documentation
Revision as of 09:17, 4 March 2018 by Renatorivo (talk | contribs) (Replaced content with "== Description ==")

FEM FemMesh2Mesh

Emplacement du menu
Mesh → FEM mesh to mesh
Ateliers
FEM
Raccourci par défaut
Aucun
Introduit dans la version
-
Voir aussi
FEM tutorial

Description

This tool converts surfaces of 3D elements of a selected FEM mesh to mesh. Internally it picks FEM mesh element faces which are unique (not shared by two elements) and uses them to create faces of a mesh. Optionally it allows to create a deformed mesh caused by the action of the defined forces. This is done by adding the displacement of the FEM results to the mesh nodes.

Les éléments bidimensionnels du maillage FEM ne sont pas pris en compte. Si vous devez les convertir, vous pouvez utiliser le script python ci-dessous.

Utilisation

  1. Sélectionnez un objet FEM maille (Optionnellement sélectionnez un résultat FEM ajouté)
  2. Pressez le bouton FEM mesh to mesh
  1. Select a FEM mesh object (optionally select additionally the FEM results)
  2. Press the FEM mesh to mesh button

Scrip

Exemple:

  • Téléchargez l'exemple pour Windows "C:\Program Files\FreeCAD 0.16\Mod\Fem\test_files\ccx" et lancez le code suivant
femmesh_obj = App.ActiveDocument.getObject("Result_mesh").FemMesh
result = App.ActiveDocument.getObject("CalculiX_static_results")
import femmesh.femmesh2mesh
out_mesh = femmesh.femmesh2mesh.femmesh_2_mesh(femmesh_obj, result)
import Mesh
Mesh.show(Mesh.Mesh(out_mesh))

Convertir 2D éléments

Sélectionnez une maille et lancez le code suivant dans la fenêtre Python de FreeCAD

import Mesh

def extend_by_triangle(i, j, k):
    triangle = [input_mesh.getNodeById(element_nodes[i]),
                input_mesh.getNodeById(element_nodes[j]),
                input_mesh.getNodeById(element_nodes[k])]
    return output_mesh.extend(triangle) 

selection = FreeCADGui.Selection.getSelection()
input_mesh = App.ActiveDocument.getObject(selection[0].Name).FemMesh
output_mesh = []
for element in input_mesh.Faces:
    element_nodes = input_mesh.getElementNodes(element)
    if len(element_nodes) in [3, 6]:  # tria3 or tria6 (ignoring mid-nodes)
        extend_by_triangle(0, 1, 2)
    elif len(element_nodes) in [4, 8]:  # quad4 or quad8 (ignoring mid-nodes)
        extend_by_triangle(0, 1, 2)
        extend_by_triangle(2, 3, 0)

obj = Mesh.Mesh(output_mesh)
Mesh.show(obj)