Skip to content

Commit

Permalink
FEM: examples, use gmsh mesh object instead off pure mesh object
Browse files Browse the repository at this point in the history
  • Loading branch information
Sudhanshu-Dubey14 authored and berndhahnebach committed Jun 23, 2020
1 parent cfec12e commit c22fa6e
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/boxanalysis_static.py
Expand Up @@ -82,8 +82,10 @@ def setup_base(doc=None, solvertype="ccxtools"):
control = create_elements(fem_mesh)
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(doc.addObject("Fem::FemMeshObject", mesh_name))[0]
femmesh_obj = analysis.addObject(ObjectsFem.makeMeshGmsh(doc, mesh_name))[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
Expand Down
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/ccx_cantilever_faceload.py
Expand Up @@ -113,9 +113,11 @@ def setup_cantileverbase(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
Expand Down
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/constraint_contact_shell_shell.py
Expand Up @@ -190,9 +190,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/constraint_contact_solid_solid.py
Expand Up @@ -176,9 +176,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/constraint_tie.py
Expand Up @@ -150,9 +150,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/material_multiple_twoboxes.py
Expand Up @@ -151,9 +151,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/material_nl_platewithhole.py
Expand Up @@ -152,9 +152,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/rc_wall_2d.py
Expand Up @@ -159,9 +159,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/thermomech_bimetall.py
Expand Up @@ -183,9 +183,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/thermomech_flow1d.py
Expand Up @@ -253,9 +253,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc
4 changes: 3 additions & 1 deletion src/Mod/Fem/femexamples/thermomech_spine.py
Expand Up @@ -140,9 +140,11 @@ def setup(doc=None, solvertype="ccxtools"):
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(
doc.addObject("Fem::FemMeshObject", mesh_name)
ObjectsFem.makeMeshGmsh(doc, mesh_name)
)[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False

doc.recompute()
return doc

0 comments on commit c22fa6e

Please sign in to comment.