FEM: examples manager, delete depreciated code
This commit is contained in:
@@ -21,44 +21,20 @@
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# to run the examples copy the code:
|
||||
# run examples
|
||||
"""
|
||||
# all examples
|
||||
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_ccx_cantilever_hexa20faceload()
|
||||
doc = run_constraint_contact_shell_shell()
|
||||
doc = run_constraint_contact_solid_solid()
|
||||
doc = run_constraint_tie()
|
||||
doc = run_material_nl_platewithhole()
|
||||
doc = run_material_multiple_twoboxes()
|
||||
doc = run_rcwall2d()
|
||||
doc = run_thermomech_bimetall()
|
||||
doc = run_thermomech_flow1d()
|
||||
doc = run_thermomech_spine()
|
||||
|
||||
doc = run_ccx_cantilevernodeload("calculix")
|
||||
doc = run_ccx_cantilevernodeload("ccxtools")
|
||||
doc = run_ccx_cantilevernodeload("z88")
|
||||
|
||||
"""
|
||||
|
||||
# use of generic method to run the examples
|
||||
# the string is the example module name
|
||||
"""
|
||||
# one special exmaple
|
||||
from femexamples.manager import run_example as run
|
||||
|
||||
doc = run("boxanalysis_static")
|
||||
doc = run("boxanalysis_frequency")
|
||||
|
||||
...
|
||||
|
||||
"""
|
||||
|
||||
import FreeCAD
|
||||
@@ -126,244 +102,21 @@ def run_example(example, solver=None, base_name=None):
|
||||
return doc
|
||||
|
||||
|
||||
def run_boxanalysisstatic(solver=None, base_name=None):
|
||||
|
||||
from .boxanalysis_static import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Box_Static_Analysis"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_boxanalysisfrequency(solver=None, base_name=None):
|
||||
|
||||
from .boxanalysis_frequency import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Box_Frequency_Analysis"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_ccx_cantileverfaceload(solver=None, base_name=None):
|
||||
|
||||
from .ccx_cantilever_faceload import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "CantilverFaceLoad"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_ccx_cantilevernodeload(solver=None, base_name=None):
|
||||
|
||||
from .ccx_cantilever_nodeload import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "CantileverNodeLoad"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_ccx_cantileverprescribeddisplacement(solver=None, base_name=None):
|
||||
|
||||
from .ccx_cantilever_prescribeddisplacement import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "CantileverPrescribedDisplacement"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_ccx_cantilever_hexa20faceload(solver=None, base_name=None):
|
||||
|
||||
from .ccx_cantilever_hexa20faceload import 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
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Constraint_Contact_Shell_Shell"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_constraint_contact_solid_solid(solver=None, base_name=None):
|
||||
|
||||
from .constraint_contact_solid_solid import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Constraint_Contact_Solid_Solid"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_constraint_tie(solver=None, base_name=None):
|
||||
|
||||
from .constraint_tie import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Constraint_Tie"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_material_multiple_twoboxes(solver=None, base_name=None):
|
||||
|
||||
from .material_multiple_twoboxes import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Multimaterial_Two-Boxes"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_material_nl_platewithhole(solver=None, base_name=None):
|
||||
|
||||
from .material_nl_platewithhole import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Nonlinear_material_plate_with_hole"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_rcwall2d(solver=None, base_name=None):
|
||||
|
||||
from .rc_wall_2d import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "RC_FIB_Wall_2D"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_thermomech_bimetall(solver=None, base_name=None):
|
||||
|
||||
from .thermomech_bimetall import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Thermomech_Bimetall"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_thermomech_flow1d(solver=None, base_name=None):
|
||||
|
||||
from .thermomech_flow1d import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Thermomech_Spine"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_thermomech_spine(solver=None, base_name=None):
|
||||
|
||||
from .thermomech_spine import setup
|
||||
doc = setup()
|
||||
|
||||
if base_name is None:
|
||||
base_name = "Thermomech_Spine"
|
||||
if solver is not None:
|
||||
base_name += "_" + solver
|
||||
run_analysis(doc, base_name)
|
||||
doc.recompute()
|
||||
|
||||
return doc
|
||||
|
||||
|
||||
def run_all():
|
||||
run_boxanalysisstatic()
|
||||
run_boxanalysisfrequency()
|
||||
run_ccx_cantileverfaceload()
|
||||
run_ccx_cantilevernodeload()
|
||||
run_ccx_cantileverprescribeddisplacement()
|
||||
run_ccx_cantilever_hexa20faceload()
|
||||
run_constraint_contact_shell_shell()
|
||||
run_constraint_contact_solid_solid()
|
||||
run_constraint_tie()
|
||||
run_material_nl_platewithhole()
|
||||
run_material_multiple_twoboxes()
|
||||
run_rcwall2d()
|
||||
run_thermomech_bimetall()
|
||||
run_thermomech_flow1d()
|
||||
run_thermomech_spine()
|
||||
run_example("boxanalysis_static")
|
||||
run_example("boxanalysis_frequency")
|
||||
run_example("ccx_cantilever_faceload")
|
||||
run_example("ccx_cantilever_nodeload")
|
||||
run_example("ccx_cantilever_prescribeddisplacement")
|
||||
run_example("ccx_cantilever_hexa20faceload")
|
||||
run_example("constraint_contact_shell_shell")
|
||||
run_example("constraint_contact_solid_solid")
|
||||
run_example("constraint_tie")
|
||||
run_example("material_multiple_twoboxes")
|
||||
run_example("material_nl_platewithhole")
|
||||
run_example("rc_wall_2d")
|
||||
run_example("thermomech_bimetall")
|
||||
run_example("thermomech_flow1d")
|
||||
run_example("thermomech_spine")
|
||||
run_example("boxanalysis_frequency")
|
||||
run_example("boxanalysis_frequency")
|
||||
|
||||
Reference in New Issue
Block a user