Skip to content

Commit

Permalink
FEM: examples, add ccx cantilever with hexa20
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Mar 1, 2020
1 parent 2d6aa10 commit eeb97b3
Show file tree
Hide file tree
Showing 4 changed files with 432 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Mod/Fem/CMakeLists.txt
Expand Up @@ -53,6 +53,7 @@ SET(FemExampleMeshes_SRCS
femexamples/meshes/__init__.py
femexamples/meshes/mesh_boxanalysis_tetra10.py
femexamples/meshes/mesh_boxes_2_vertikal_tetra10.py
femexamples/meshes/mesh_canticcx_hexa20.py
femexamples/meshes/mesh_canticcx_tetra10.py
femexamples/meshes/mesh_constraint_tie_tetra10.py
femexamples/meshes/mesh_contact_box_halfcylinder_tetra10.py
Expand Down
21 changes: 21 additions & 0 deletions src/Mod/Fem/femexamples/ccx_cantilever_std.py
Expand Up @@ -30,6 +30,7 @@
canti.setup_cantileverfaceload()
canti.setup_cantilevernodeload()
canti.setup_cantileverprescribeddisplacement()
canti.setup_cantileverhexa20faceload()
"""

Expand Down Expand Up @@ -184,3 +185,23 @@ def setup_cantileverprescribeddisplacement(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


def setup_cantileverhexa20faceload(doc=None, solvertype="ccxtools"):
doc = setup_cantileverfaceload(doc, solvertype)

# load the hexa20 mesh
from .meshes.mesh_canticcx_hexa20 import create_nodes, create_elements
fem_mesh = Fem.FemMesh()
control = create_nodes(fem_mesh)
if not control:
FreeCAD.Console.PrintError("Error on creating nodes.\n")
control = create_elements(fem_mesh)
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")

# overwrite mesh with the hexa20 mesh
doc.getObject(mesh_name).FemMesh = fem_mesh

doc.recompute()
return doc
16 changes: 16 additions & 0 deletions src/Mod/Fem/femexamples/manager.py
Expand Up @@ -33,6 +33,7 @@
doc = run_ccx_cantileverfaceload()
doc = run_ccx_cantilevernodeload()
doc = run_ccx_cantileverprescribeddisplacement()
doc = setup_cantileverhexa20faceload()
doc = run_constraint_contact_shell_shell()
doc = run_constraint_contact_solid_solid()
doc = run_constraint_tie()
Expand Down Expand Up @@ -176,6 +177,21 @@ def run_ccx_cantileverprescribeddisplacement(solver=None, base_name=None):
return doc


def setup_cantileverhexa20faceload(solver=None, base_name=None):

from .ccx_cantilever_std import setup_cantileverhexa20faceload as setup
doc = setup()

if base_name is None:
base_name = "CantilverHexa20FaceLoad"
if solver is not None:
base_name += "_" + solver
run_analysis(doc, base_name)
doc.recompute()

return doc


def run_constraint_contact_shell_shell(solver=None, base_name=None):

from .constraint_contact_shell_shell import setup
Expand Down

0 comments on commit eeb97b3

Please sign in to comment.