diff --git a/src/Mod/Fem/femexamples/boxanalysis.py b/src/Mod/Fem/femexamples/boxanalysis.py index e5092c76dd..8b15705c0b 100644 --- a/src/Mod/Fem/femexamples/boxanalysis.py +++ b/src/Mod/Fem/femexamples/boxanalysis.py @@ -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 @@ -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() - -""" diff --git a/src/Mod/Fem/femexamples/ccx_cantilever_std.py b/src/Mod/Fem/femexamples/ccx_cantilever_std.py index ef46e173d1..e39f5dcca1 100644 --- a/src/Mod/Fem/femexamples/ccx_cantilever_std.py +++ b/src/Mod/Fem/femexamples/ccx_cantilever_std.py @@ -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 @@ -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() - -""" diff --git a/src/Mod/Fem/femexamples/contact_shell_shell.py b/src/Mod/Fem/femexamples/contact_shell_shell.py index c8439f1756..7586ce5616 100644 --- a/src/Mod/Fem/femexamples/contact_shell_shell.py +++ b/src/Mod/Fem/femexamples/contact_shell_shell.py @@ -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 @@ -185,10 +192,3 @@ def setup(doc=None, solvertype="ccxtools"): doc.recompute() return doc - - -""" -from femexamples.contact_shell_shell import setup -setup() - -""" diff --git a/src/Mod/Fem/femexamples/manager.py b/src/Mod/Fem/femexamples/manager.py index ee965a5d69..ca82e79e13 100644 --- a/src/Mod/Fem/femexamples/manager.py +++ b/src/Mod/Fem/femexamples/manager.py @@ -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 @@ -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") - - -""" diff --git a/src/Mod/Fem/femexamples/material_multiple_twoboxes.py b/src/Mod/Fem/femexamples/material_multiple_twoboxes.py index 391a3e306a..983630859f 100644 --- a/src/Mod/Fem/femexamples/material_multiple_twoboxes.py +++ b/src/Mod/Fem/femexamples/material_multiple_twoboxes.py @@ -22,6 +22,14 @@ # *************************************************************************** +# to run the example use: +""" +from femexamples.material_multiple_twoboxes import setup +setup() + +""" + + import FreeCAD import ObjectsFem import Fem @@ -154,10 +162,3 @@ def setup(doc=None, solvertype="ccxtools"): doc.recompute() return doc - - -""" -from femexamples.material_multiple_twoboxes import setup -setup() - -""" diff --git a/src/Mod/Fem/femexamples/material_nl_platewithhole.py b/src/Mod/Fem/femexamples/material_nl_platewithhole.py index 43d900949e..ceac0bc5f8 100644 --- a/src/Mod/Fem/femexamples/material_nl_platewithhole.py +++ b/src/Mod/Fem/femexamples/material_nl_platewithhole.py @@ -22,6 +22,14 @@ # *************************************************************************** +# to run the example use: +""" +from femexamples.material_nl_platewithhole import setup +setup() + +""" + + import FreeCAD import ObjectsFem import Fem @@ -154,10 +162,3 @@ def setup(doc=None, solvertype="ccxtools"): doc.recompute() return doc - - -""" -from femexamples.material_nl_platewithhole import setup -setup() - -""" diff --git a/src/Mod/Fem/femexamples/rc_wall_2d.py b/src/Mod/Fem/femexamples/rc_wall_2d.py index 5b62b7b3c0..58586a84ca 100644 --- a/src/Mod/Fem/femexamples/rc_wall_2d.py +++ b/src/Mod/Fem/femexamples/rc_wall_2d.py @@ -22,6 +22,14 @@ # *************************************************************************** +# to run the example use: +""" +from femexamples.rc_wall_2d import setup +setup() + +""" + + import FreeCAD import ObjectsFem import Fem @@ -156,10 +164,3 @@ def setup(doc=None, solvertype="ccxtools"): doc.recompute() return doc - - -""" -from femexamples.rc_wall_2d import setup -setup() - -""" diff --git a/src/Mod/Fem/femexamples/thermomech_flow1d.py b/src/Mod/Fem/femexamples/thermomech_flow1d.py index ef13229ea0..6eb7ab37a6 100644 --- a/src/Mod/Fem/femexamples/thermomech_flow1d.py +++ b/src/Mod/Fem/femexamples/thermomech_flow1d.py @@ -22,6 +22,14 @@ # *************************************************************************** +# to run the example use: +""" +from femexamples.thermomech_flow1d import setup +setup() + +""" + + import FreeCAD import ObjectsFem import Fem @@ -247,10 +255,3 @@ def setup(doc=None, solvertype="ccxtools"): doc.recompute() return doc - - -""" -from femexamples.thermomech_flow1d import setup -setup() - -""" diff --git a/src/Mod/Fem/femexamples/thermomech_spine.py b/src/Mod/Fem/femexamples/thermomech_spine.py index 25adea8e70..6e346da33c 100644 --- a/src/Mod/Fem/femexamples/thermomech_spine.py +++ b/src/Mod/Fem/femexamples/thermomech_spine.py @@ -22,6 +22,14 @@ # *************************************************************************** +# to run the example use: +""" +from femexamples.thermomech_spine import setup +setup() + +""" + + import FreeCAD import ObjectsFem import Fem @@ -140,10 +148,3 @@ def setup(doc=None, solvertype="ccxtools"): doc.recompute() return doc - - -""" -from femexamples.thermomech_spine import setup -setup() - -"""