FEM FemMesh2Mesh/it: Difference between revisions

From FreeCAD Documentation
No edit summary
(Created page with "== Descrizione == Questo strumento converte in mesh le superfici degli elementi 3D di una mesh FEM selezionata. Sceglie le facce dell'elemento mesh FEM che sono uniche (non co...")
Line 2: Line 2:
{{GuiCommand/it|Name=FEM FemMesh2Mesh|Name/it=Mesh FEM in mesh|MenuLocation=FEM → Utilità → Converti mesh FEM in mesh||Workbenches=[[FEM Module/it|FEM]]|Shortcut=|SeeAlso=[[FEM_tutorial/it|Tutorial di FEM]]}}
{{GuiCommand/it|Name=FEM FemMesh2Mesh|Name/it=Mesh FEM in mesh|MenuLocation=FEM → Utilità → Converti mesh FEM in mesh||Workbenches=[[FEM Module/it|FEM]]|Shortcut=|SeeAlso=[[FEM_tutorial/it|Tutorial di FEM]]}}


== Description ==
== Descrizione ==
Questo strumento converte in mesh le superfici degli elementi 3D di una mesh FEM selezionata. Sceglie le facce dell'elemento mesh FEM che sono uniche (non condivise da due elementi) e le usa per creare le facce di una mesh. Facoltativamente consente di creare una mesh deformata dall'azione delle forze definite. Ciò avviene aggiungendo lo spostamento dei risultati FEM ai nodi della maglia.
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.


Two dimensional elements from the FEM mesh are not taken into account. If you need to convert them, you can use a python script below.
Two dimensional elements from the FEM mesh are not taken into account. If you need to convert them, you can use a python script below.

Revision as of 20:20, 6 June 2017

Mesh FEM in mesh

Posizione nel menu
FEM → Utilità → Converti mesh FEM in mesh
Ambiente
FEM
Avvio veloce
Nessuno
Introdotto nella versione
-
Vedere anche
Tutorial di FEM

Descrizione

Questo strumento converte in mesh le superfici degli elementi 3D di una mesh FEM selezionata. Sceglie le facce dell'elemento mesh FEM che sono uniche (non condivise da due elementi) e le usa per creare le facce di una mesh. Facoltativamente consente di creare una mesh deformata dall'azione delle forze definite. Ciò avviene aggiungendo lo spostamento dei risultati FEM ai nodi della maglia.

Two dimensional elements from the FEM mesh are not taken into account. If you need to convert them, you can use a python script below.

How to use

  1. Select a FEM mesh object (optionally select additionally the FEM results)
  2. Press the FEM mesh to mesh button

Scripting

Example:

  • Load FreeCAD's 3D FEM example from the Start Workbench and run the following code
femmesh = App.ActiveDocument.getObject("Box_Mesh").FemMesh
result = App.ActiveDocument.getObject("CalculiX_static_results")
import FemMesh2Mesh
out_mesh = FemMesh2Mesh.femmesh_2_mesh(femmesh, result)
import Mesh
Mesh.show(Mesh.Mesh(out_mesh))

Converting 2D elements

Select a mesh and run the following python script

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)