FEM: examples, add explanation text object to all the rest examples

This commit is contained in:
Bernd Hahnebach
2021-06-17 12:42:17 +02:00
parent 3626f48699
commit bc9beffc45
25 changed files with 552 additions and 218 deletions

View File

@@ -22,16 +22,11 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.boxanalysis_frequency import setup
setup()
"""
import ObjectsFem
from . import manager
from .boxanalysis_base import setup_boxanalysisbase
from .manager import init_doc
def get_information():
@@ -46,8 +41,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.boxanalysis_frequency import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# setup box frequency, change solver attributes
doc = setup_boxanalysisbase(doc, solvertype)
analysis = doc.Analysis

View File

@@ -22,18 +22,13 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.boxanalysis_static import setup
setup()
"""
import FreeCAD
import ObjectsFem
from . import manager
from .boxanalysis_base import setup_boxanalysisbase
from .manager import init_doc
def get_information():
@@ -48,8 +43,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.boxanalysis_static import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# setup box static, add a fixed, force and a pressure constraint
doc = setup_boxanalysisbase(doc, solvertype)
geom_obj = doc.Box

View File

@@ -22,16 +22,11 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.ccx_cantilever_faceload import setup
setup()
"""
import ObjectsFem
from . import manager
from .ccx_cantilever_base import setup_cantileverbase
from .manager import init_doc
def get_information():
@@ -46,9 +41,31 @@ def get_information():
}
def setup(doc=None, solvertype="ccxtools"):
# setup CalculiX cantilever, apply 9 MN on surface of front end face
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.ccx_cantilever_faceload import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# setup CalculiX cantilever, apply 9 MN on surface of front end face
doc = setup_cantileverbase(doc, solvertype)
analysis = doc.Analysis
geom_obj = doc.Box

View File

@@ -22,19 +22,14 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.ccx_cantilever_hexa20faceload import setup
setup()
"""
import FreeCAD
import Fem
from . import manager
from .ccx_cantilever_faceload import setup as setup_with_faceload
from .manager import get_meshname
from .manager import init_doc
def get_information():
@@ -49,8 +44,31 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.ccx_cantilever_hexa20faceload import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# setup cantilever faceload and exchange the mesh
doc = setup_with_faceload(doc, solvertype)
femmesh_obj = doc.getObject(get_meshname())

View File

@@ -22,16 +22,11 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.ccx_cantilever_nodeload import setup
setup()
"""
import ObjectsFem
from . import manager
from .ccx_cantilever_base import setup_cantileverbase
from .manager import init_doc
def get_information():
@@ -46,9 +41,31 @@ def get_information():
}
def setup(doc=None, solvertype="ccxtools"):
# setup CalculiX cantilever, apply 9 MN on the 4 nodes of the front end face
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.ccx_cantilever_nodeload import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# setup CalculiX cantilever, apply 9 MN on the 4 nodes of the front end face
doc = setup_cantileverbase(doc, solvertype)
analysis = doc.Analysis
geom_obj = doc.Box

View File

@@ -22,16 +22,11 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.ccx_cantilever_prescribeddisplacement import setup
setup()
"""
import ObjectsFem
from . import manager
from .ccx_cantilever_base import setup_cantileverbase
from .manager import init_doc
def get_information():
@@ -46,15 +41,37 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.ccx_cantilever_prescribeddisplacement import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# setup CalculiX cantilever
# apply a prescribed displacement of 250 mm in -z on the front end face
if solvertype == "z88":
# constraint displacement is not supported for Z88
# pass a not valid solver name for z88, thus no solver is created
solvertype = "z88_not_valid"
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# setup CalculiX cantilever
# apply a prescribed displacement of 250 mm in -z on the front end face
doc = setup_cantileverbase(doc, solvertype)
analysis = doc.Analysis
geom_obj = doc.Box

View File

@@ -22,17 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.constraint_contact_shell_shell import setup
setup()
"""
# 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
import FreeCAD
import Part
@@ -41,6 +30,7 @@ from BOPTools import SplitFeatures
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -57,12 +47,33 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.constraint_contact_shell_shell import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=42228
based on https://forum.freecadweb.org/viewtopic.php?f=18&t=42228#p359488
contact example shell to shell elements
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
# TODO: turn circle of upper tube to have the line on the other side
# make a boolean fragment of them to be sure there is a mesh point on remesh

View File

@@ -22,16 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.constraint_contact_solid_solid import setup
setup()
"""
# constraint contact for solid to solid mesh
# https://forum.freecadweb.org/viewtopic.php?f=18&t=20276
import FreeCAD
from FreeCAD import Rotation
from FreeCAD import Vector
@@ -41,6 +31,7 @@ import Part
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -57,12 +48,31 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.constraint_contact_solid_solid import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=20276
constraint contact for solid to solid mesh
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
# bottom box
bottom_box_obj = doc.addObject("Part::Box", "BottomBox")

View File

@@ -22,16 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.constraint_section_print import setup
setup()
"""
# constraint section print with volume elements
# https://forum.freecadweb.org/viewtopic.php?t=43044
import math
import FreeCAD
@@ -47,6 +37,7 @@ from CompoundTools.CompoundFilter import makeCompoundFilter
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -63,12 +54,32 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.constraint_section_print import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?t=43044
constraint section print with volume elements
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
# the part sketch
arc_sketch = doc.addObject("Sketcher::SketchObject", "Arc_Sketch")

View File

@@ -21,23 +21,12 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.constraint_selfweight_cantilever import setup
setup()
"""
# cantilever under self weight made from steel grad 235
# l = 32 m, yields just from self weight, means max sigma around 235 n/mm2
# max deformation = 576.8 mm
# https://forum.freecadweb.org/viewtopic.php?f=18&t=48513
import FreeCAD
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -54,12 +43,34 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.constraint_selfweight_cantilever import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=48513
cantilever under self weight made from steel grad 235
l = 32 m, yields just from self weight, means max sigma around 235 n/mm2
max deformation = 576.8 mm
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
geom_obj = doc.addObject("Part::Box", "Box")
geom_obj.Height = geom_obj.Width = 1000

View File

@@ -22,15 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.constraint_transform_beam_hinged import setup
setup()
"""
# Constraint transform on a beam
# https://forum.freecadweb.org/viewtopic.php?f=18&t=20238#p157643
import FreeCAD
from FreeCAD import Rotation
from FreeCAD import Vector
@@ -40,6 +31,7 @@ from CompoundTools import CompoundFilter
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -56,12 +48,32 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.constraint_transform_beam_hinged import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=20238#p157643
Constraint transform on a beam
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
# name is important because the other method in this module use obj name
cube = doc.addObject("Part::Box", "Cube")

View File

@@ -21,20 +21,12 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.elmer_nonguitutorial01_eigenvalue_of_elastic_beam import setup
setup()
"""
# https://forum.freecadweb.org/viewtopic.php?t=56590
import FreeCAD
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -51,12 +43,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.elmer_nonguitutorial01_eigenvalue_of_elastic_beam import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?t=56590
"""
def setup(doc=None, solvertype="elmer"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
geom_obj = doc.addObject("Part::Box", "Box")
geom_obj.Length = 1000

View File

@@ -22,15 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.equation_electrostatics_capacitance_two_balls import setup
setup()
"""
# Electrostatics equation in FreeCAD FEM-Elmer
# https://forum.freecadweb.org/viewtopic.php?f=18&t=41488&start=90#p412047
import FreeCAD
from FreeCAD import Rotation
from FreeCAD import Vector
@@ -38,6 +29,7 @@ from FreeCAD import Vector
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -54,12 +46,32 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.equation_electrostatics_capacitance_two_balls import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=41488&start=90#p412047
Electrostatics equation in FreeCAD FEM-Elmer
"""
def setup(doc=None, solvertype="elmer"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
small_sphere1 = doc.addObject("Part::Sphere", "Small_Sphere1")
small_sphere1.Placement = FreeCAD.Placement(Vector(-1000, 0, 0), Rotation(Vector(0, 0, 1), 0))

View File

@@ -22,15 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.equation_electrostatics_electricforce_elmer_nongui6 import setup
setup()
"""
# Electrostatics equation in FreeCAD FEM-Elmer
# https://forum.freecadweb.org/viewtopic.php?f=18&t=41488&start=40#p373292
import FreeCAD
from FreeCAD import Rotation
from FreeCAD import Vector
@@ -42,6 +33,7 @@ import Sketcher
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -58,12 +50,32 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.equation_electrostatics_electricforce_elmer_nongui6 import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=41488&start=40#p373292
Electrostatics equation in FreeCAD FEM-Elmer
"""
def setup(doc=None, solvertype="elmer"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
# name is important because the other method in this module use obj name
geom_obj = doc.addObject("PartDesign::Body", "Body")

View File

@@ -21,20 +21,12 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.frequency_beamsimple import setup
setup()
"""
# simple frequency analysis
# https://forum.freecadweb.org/viewtopic.php?f=18&t=58959#p506565
import FreeCAD
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -51,12 +43,32 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.frequency_beamsimple import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=58959#p506565
simple frequency analysis
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
geom_obj = doc.addObject("Part::Box", "Box")
geom_obj.Length = 3000

View File

@@ -22,13 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.material_multiple_bendingbeam_fiveboxes import setup
setup()
"""
import FreeCAD
import BOPTools.SplitFeatures
@@ -36,6 +29,7 @@ import BOPTools.SplitFeatures
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -52,12 +46,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.material_multiple_bendingbeam_fiveboxes import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
# name is important because the other method in this module use obj name
box_obj1 = doc.addObject('Part::Box', 'Box1')

View File

@@ -22,18 +22,12 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.material_multiple_bendingbeam_fivefaces import setup
setup()
"""
import FreeCAD
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -50,12 +44,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.material_multiple_bendingbeam_fivefaces import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
# name is important because the other method in this module use obj name
# parts

View File

@@ -22,13 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.material_multiple_tensionrod_twoboxes import setup
setup()
"""
import FreeCAD
from BOPTools import SplitFeatures
@@ -37,6 +30,7 @@ from CompoundTools import CompoundFilter
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -53,12 +47,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.material_multiple_tensionrod_twoboxes import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
# two boxes
boxlow = doc.addObject("Part::Box", "BoxLower")

View File

@@ -28,21 +28,6 @@ from femexamples.material_nl_platewithhole import setup
setup()
"""
# Nonlinear material example, plate with hole.
# https://forum.freecadweb.org/viewtopic.php?f=24&t=31997&start=30
# https://forum.freecadweb.org/viewtopic.php?t=33974&start=90
# https://forum.freecadweb.org/viewtopic.php?t=35893
# https://forum.freecadweb.org/viewtopic.php?t=23101
# plate: 400x200x10 mm
# hole: diameter 100 mm (half cross section)
# load: 130 MPa tension
# linear material: Steel, E = 210000 MPa, my = 0.3
# nonlinear material: '240.0, 0.0' to '270.0, 0.025'
# TODO nonlinear material: give more information, use values from harry
# TODO compare results with example from HarryvL
import FreeCAD
from FreeCAD import Vector as vec
@@ -53,6 +38,7 @@ from Part import makeLine as ln
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -69,12 +55,43 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.material_nl_platewithhole import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=24&t=31997&start=30
https://forum.freecadweb.org/viewtopic.php?t=33974&start=90
https://forum.freecadweb.org/viewtopic.php?t=35893
https://forum.freecadweb.org/viewtopic.php?t=23101
Nonlinear material example, plate with hole.
plate: 400x200x10 mm
hole: diameter 100 mm (half cross section)
load: 130 MPa tension
linear material: Steel, E = 210000 MPa, my = 0.3
nonlinear material: '240.0, 0.0' to '270.0, 0.025'
TODO nonlinear material: give more information, use values from harry
TODO compare results with example from HarryvL
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
v1 = vec(-200, -100, 0)
v2 = vec(200, -100, 0)

View File

@@ -22,16 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.rc_wall_2d import setup
setup()
"""
# example from Harry's epic topic: Concrete branch ready for testing
# https://forum.freecadweb.org/viewtopic.php?f=18&t=33106&start=80#p296469
import FreeCAD
from FreeCAD import Vector as vec
@@ -41,6 +31,7 @@ from Part import makeLine as ln
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -57,12 +48,32 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.rc_wall_2d import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=33106&start=80#p296469
example from Harry's epic topic: Concrete branch ready for testing
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
v1 = vec(0, -2000, 0)
v2 = vec(500, -2000, 0)

View File

@@ -22,13 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.square_pipe_end_twisted_edgeforces import setup
setup()
"""
import FreeCAD
from FreeCAD import Vector
@@ -37,6 +30,7 @@ import Part
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -53,12 +47,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.square_pipe_end_twisted_edgeforces import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
# name is important because the other method in this module use obj name
l1 = Part.makeLine((-142.5, -142.5, 0), (142.5, -142.5, 0))

View File

@@ -22,13 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.square_pipe_end_twisted_nodeforces import setup
setup()
"""
import FreeCAD
from FreeCAD import Vector
@@ -37,6 +30,7 @@ import Part
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -53,12 +47,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.square_pipe_end_twisted_nodeforces import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
# name is important because the other method in this module use obj name
l1 = Part.makeLine((-142.5, -142.5, 0), (142.5, -142.5, 0))

View File

@@ -28,11 +28,6 @@ setup()
"""
# thermomechanical bimetall
# https://forum.freecadweb.org/viewtopic.php?f=18&t=43040&start=10#p366664
# analytical solution 7.05 mm deflection in the invar material direction
# see post in the forum link
# this file has 7.15 mm max deflection
import FreeCAD
from FreeCAD import Rotation
@@ -43,6 +38,7 @@ from BOPTools import SplitFeatures
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -59,12 +55,36 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.thermomech_bimetall import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=43040&start=10#p366664
thermomechanical bimetall
analytical solution 7.05 mm deflection in the invar material direction
see post in the forum link
this file has 7.15 mm max deflection
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
# bottom box
bottom_box_obj = doc.addObject("Part::Box", "BottomBox")

View File

@@ -22,16 +22,6 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.thermomech_flow1d import setup
setup()
"""
# topic about the 1D flow analysis
# https://forum.freecadweb.org/viewtopic.php?f=18&t=20076
import FreeCAD
from FreeCAD import Vector as vec
@@ -40,6 +30,7 @@ from Draft import makeWire
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -56,12 +47,31 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.thermomech_flow1d import setup
setup()
See forum topic post:
https://forum.freecadweb.org/viewtopic.php?f=18&t=20076
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric objects
p1 = vec(0, 0, 50)
p2 = vec(0, 0, -50)

View File

@@ -22,18 +22,12 @@
# * *
# ***************************************************************************
# to run the example use:
"""
from femexamples.thermomech_spine import setup
setup()
"""
import FreeCAD
import Fem
import ObjectsFem
from . import manager
from .manager import get_meshname
from .manager import init_doc
@@ -50,12 +44,30 @@ def get_information():
}
def get_explanation(header=""):
return header + """
To run the example from Python console use:
from femexamples.thermomech_spine import setup
setup()
See forum topic post:
...
"""
def setup(doc=None, solvertype="ccxtools"):
# init FreeCAD document
if doc is None:
doc = init_doc()
# explanation object
# just keep the following line and change text string in get_explanation method
manager.add_explanation_obj(doc, get_explanation(manager.get_header(get_information())))
# geometric object
geom_obj = doc.addObject("Part::Box", "Box")
geom_obj.Height = 25.4