Skip to content

Commit

Permalink
FEM: examples, copy code to run to module top
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jan 30, 2020
1 parent b0902db commit 84aa3bb
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 89 deletions.
21 changes: 11 additions & 10 deletions src/Mod/Fem/femexamples/boxanalysis.py
Expand Up @@ -22,6 +22,17 @@
# ***************************************************************************


# to run the example use:
"""
from femexamples import boxanalysis as box
box.setup_base()
box.setup_static()
box.setup_frequency()
"""


import FreeCAD
import ObjectsFem
import Fem
Expand Down Expand Up @@ -167,13 +178,3 @@ def setup_frequency(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


"""
from femexamples import boxanalysis as box
box.setup_base()
box.setup_static()
box.setup_frequency()
"""
23 changes: 12 additions & 11 deletions src/Mod/Fem/femexamples/ccx_cantilever_std.py
Expand Up @@ -22,6 +22,18 @@
# ***************************************************************************


# to run the example use:
"""
from femexamples import ccx_cantilever_std as canti
canti.setup_cantileverbase()
canti.setup_cantileverfaceload()
canti.setup_cantilevernodeload()
canti.setup_cantileverprescribeddisplacement()
"""


import FreeCAD
import ObjectsFem
import Fem
Expand Down Expand Up @@ -172,14 +184,3 @@ def setup_cantileverprescribeddisplacement(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


"""
from femexamples import ccx_cantilever_std as canti
canti.setup_cantileverbase()
canti.setup_cantileverfaceload()
canti.setup_cantilevernodeload()
canti.setup_cantileverprescribeddisplacement()
"""
14 changes: 7 additions & 7 deletions src/Mod/Fem/femexamples/contact_shell_shell.py
Expand Up @@ -25,6 +25,13 @@
# contact example shell to shell elements
# https://forum.freecadweb.org/viewtopic.php?f=18&t=42228
# based on https://forum.freecadweb.org/viewtopic.php?f=18&t=42228#p359488
# to run the example use:
"""
from femexamples.contact_shell_shell import setup
setup()
"""


import FreeCAD
import ObjectsFem
Expand Down Expand Up @@ -185,10 +192,3 @@ def setup(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


"""
from femexamples.contact_shell_shell import setup
setup()
"""
52 changes: 26 additions & 26 deletions src/Mod/Fem/femexamples/manager.py
Expand Up @@ -22,6 +22,32 @@
# ***************************************************************************


# to run the examples copy the code:
"""
from femexamples.manager import *
run_all()
from femexamples.manager import *
doc = run_boxanalysisstatic()
doc = run_boxanalysisfrequency()
doc = run_ccx_cantileverfaceload()
doc = run_ccx_cantilevernodeload()
doc = run_ccx_cantileverprescribeddisplacement()
doc = run_contact_shell_shell()
doc = run_material_nl_platewithhole()
doc = run_material_multiple_twoboxes()
doc = run_rcwall2d()
doc = run_thermomech_flow1d()
doc = run_thermomech_spine()
doc = run_ccx_cantilevernodeload("calculix")
doc = run_ccx_cantilevernodeload("ccxtools")
doc = run_ccx_cantilevernodeload("z88")
"""


import FreeCAD


Expand Down Expand Up @@ -249,29 +275,3 @@ def run_all():
run_rcwall2d()
run_thermomech_flow1d()
run_thermomech_spine()


"""
from femexamples.manager import *
run_all()
from femexamples.manager import *
doc = run_boxanalysisstatic()
doc = run_boxanalysisfrequency()
doc = run_ccx_cantileverfaceload()
doc = run_ccx_cantilevernodeload()
doc = run_ccx_cantileverprescribeddisplacement()
doc = run_contact_shell_shell()
doc = run_material_nl_platewithhole()
doc = run_material_multiple_twoboxes()
doc = run_rcwall2d()
doc = run_thermomech_flow1d()
doc = run_thermomech_spine()
doc = run_ccx_cantilevernodeload("calculix")
doc = run_ccx_cantilevernodeload("ccxtools")
doc = run_ccx_cantilevernodeload("z88")
"""
15 changes: 8 additions & 7 deletions src/Mod/Fem/femexamples/material_multiple_twoboxes.py
Expand Up @@ -22,6 +22,14 @@
# ***************************************************************************


# to run the example use:
"""
from femexamples.material_multiple_twoboxes import setup
setup()
"""


import FreeCAD
import ObjectsFem
import Fem
Expand Down Expand Up @@ -154,10 +162,3 @@ def setup(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


"""
from femexamples.material_multiple_twoboxes import setup
setup()
"""
15 changes: 8 additions & 7 deletions src/Mod/Fem/femexamples/material_nl_platewithhole.py
Expand Up @@ -22,6 +22,14 @@
# ***************************************************************************


# to run the example use:
"""
from femexamples.material_nl_platewithhole import setup
setup()
"""


import FreeCAD
import ObjectsFem
import Fem
Expand Down Expand Up @@ -154,10 +162,3 @@ def setup(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


"""
from femexamples.material_nl_platewithhole import setup
setup()
"""
15 changes: 8 additions & 7 deletions src/Mod/Fem/femexamples/rc_wall_2d.py
Expand Up @@ -22,6 +22,14 @@
# ***************************************************************************


# to run the example use:
"""
from femexamples.rc_wall_2d import setup
setup()
"""


import FreeCAD
import ObjectsFem
import Fem
Expand Down Expand Up @@ -156,10 +164,3 @@ def setup(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


"""
from femexamples.rc_wall_2d import setup
setup()
"""
15 changes: 8 additions & 7 deletions src/Mod/Fem/femexamples/thermomech_flow1d.py
Expand Up @@ -22,6 +22,14 @@
# ***************************************************************************


# to run the example use:
"""
from femexamples.thermomech_flow1d import setup
setup()
"""


import FreeCAD
import ObjectsFem
import Fem
Expand Down Expand Up @@ -247,10 +255,3 @@ def setup(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


"""
from femexamples.thermomech_flow1d import setup
setup()
"""
15 changes: 8 additions & 7 deletions src/Mod/Fem/femexamples/thermomech_spine.py
Expand Up @@ -22,6 +22,14 @@
# ***************************************************************************


# to run the example use:
"""
from femexamples.thermomech_spine import setup
setup()
"""


import FreeCAD
import ObjectsFem
import Fem
Expand Down Expand Up @@ -140,10 +148,3 @@ def setup(doc=None, solvertype="ccxtools"):

doc.recompute()
return doc


"""
from femexamples.thermomech_spine import setup
setup()
"""

0 comments on commit 84aa3bb

Please sign in to comment.