FEM: Start examples rework (#15786)
* FEM: Delete data/examples/FemCalculixCantilever1D.FCStd * FEM: Delete data/examples/FemCalculixCantilever2D.FCStd * FEM: Delete data/examples/FemCalculixCantilever3D.FCStd * FEM: add new example combining the previous 3 * FEM: Update CMakeLists.txt * FEM: Update femmesh2mesh.py * FEM: Update test_information.md * FEM: Update test_result.py * FEM: Update MaterialEditor.py * FEM: Delete data/examples/FEMExample.FCStd * FEM: add new example without logo
This commit is contained in:
@@ -6,9 +6,7 @@ SET(Examples_Files
|
||||
PartDesignExample.FCStd
|
||||
RobotExample.FCStd
|
||||
BIMExample.FCStd
|
||||
FemCalculixCantilever1D.FCStd
|
||||
FemCalculixCantilever2D.FCStd
|
||||
FemCalculixCantilever3D.FCStd
|
||||
FEMExample.FCStd
|
||||
AssemblyExample.FCStd
|
||||
)
|
||||
|
||||
|
||||
BIN
data/examples/FEMExample.FCStd
Normal file
BIN
data/examples/FEMExample.FCStd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -42,9 +42,9 @@ import Fem
|
||||
|
||||
"""
|
||||
from os.path import join
|
||||
the_file = join(FreeCAD.getResourceDir(), "examples", "FemCalculixCantilever3D.FCStd")
|
||||
the_file = join(FreeCAD.getResourceDir(), "examples", "FEMExample.FCStd")
|
||||
fc_file = FreeCAD.openDocument(the_file)
|
||||
fem_mesh = fc_file.getObject("Box_Mesh").FemMesh # do not remove the _
|
||||
fem_mesh = fc_file.getObject("FEMMeshGmsh").FemMesh
|
||||
result = fc_file.getObject("CCX_Results")
|
||||
scale = 1 # displacement scale factor
|
||||
from femmesh import femmesh2mesh
|
||||
|
||||
@@ -59,21 +59,7 @@ class TestResult(unittest.TestCase):
|
||||
|
||||
# ********************************************************************************************
|
||||
def get_stress_values(self):
|
||||
# node 5 von calculix cantilver 3D example
|
||||
# doc = FreeCAD.open(
|
||||
# FreeCAD.ConfigGet("AppHomePath") + "data/examples/FemCalculixCantilever3D.FCStd"
|
||||
# )
|
||||
# doc.Box_Mesh.FemMesh.Nodes[5]
|
||||
# Vector (0.0, 1000.0, 0.0)
|
||||
# res = doc.CalculiX_static_results
|
||||
# stress = (
|
||||
# res.NodeStressXX[4],
|
||||
# res.NodeStressYY[4],
|
||||
# res.NodeStressZZ[4],
|
||||
# res.NodeStressXY[4],
|
||||
# res.NodeStressXZ[4],
|
||||
# res.NodeStressYZ[4]
|
||||
# )
|
||||
# stress at node 4 of CalculiX cantilever face load
|
||||
stress = (
|
||||
-4.52840e02, # Sxx
|
||||
-1.94075e02, # Syy
|
||||
@@ -196,7 +182,7 @@ class TestResult(unittest.TestCase):
|
||||
# ********************************************************************************************
|
||||
def test_disp_abs(self):
|
||||
expected_dispabs = 87.302986
|
||||
# x, y, z in node 4 of CalculiX cantilver face load
|
||||
# x, y, z at node 4 of CalculiX cantilever face load
|
||||
disp_xyz = [FreeCAD.Vector(8.12900e00, 3.38889e-02, -8.69237e01)]
|
||||
from femresult.resulttools import calculate_disp_abs as dp
|
||||
|
||||
|
||||
@@ -157,11 +157,7 @@ doc = ut.spine_thermomech()
|
||||
|
||||
```python
|
||||
app_home = FreeCAD.ConfigGet("AppHomePath")
|
||||
doc = FreeCAD.open(app_home + "data/examples/FemCalculixCantilever2D.FCStd")
|
||||
doc = FreeCAD.open(app_home + "data/examples/FemCalculixCantilever3D.FCStd")
|
||||
doc = FreeCAD.open(app_home + "data/examples/FemCalculixCantilever3D_newSolver.FCStd")
|
||||
doc = FreeCAD.open(app_home + "data/examples/Fem.FCStd")
|
||||
doc = FreeCAD.open(app_home + "data/examples/Fem2.FCStd")
|
||||
doc = FreeCAD.open(app_home + "data/examples/FEMExample.FCStd")
|
||||
```
|
||||
|
||||
### Load all documents files
|
||||
|
||||
@@ -980,7 +980,7 @@ import MaterialEditor
|
||||
MaterialEditor.openEditor()
|
||||
|
||||
doc = FreeCAD.open(
|
||||
FreeCAD.ConfigGet("AppHomePath") + "data/examples/FemCalculixCantilever3D.FCStd"
|
||||
FreeCAD.ConfigGet("AppHomePath") + "data/examples/FEMExample.FCStd"
|
||||
)
|
||||
import MaterialEditor
|
||||
MaterialEditor.openEditor("SolidMaterial", "Material")
|
||||
|
||||
Reference in New Issue
Block a user