FEM: examples, move some method in separate module

This commit is contained in:
Bernd Hahnebach
2021-06-16 13:50:44 +02:00
parent 68f1b49637
commit 7a9a282431
30 changed files with 114 additions and 230 deletions

View File

@@ -34,13 +34,8 @@ import FreeCAD
import Fem
import ObjectsFem
mesh_name = "Mesh" # needs to be Mesh to work with unit tests
def init_doc(doc=None):
if doc is None:
doc = FreeCAD.newDocument()
return doc
from .manager import get_meshname
from .manager import init_doc
def get_information():
@@ -94,7 +89,7 @@ def setup_base(doc=None, solvertype="ccxtools"):
control = create_elements(fem_mesh)
if not control:
FreeCAD.Console.PrintError("Error on creating elements.\n")
femmesh_obj = analysis.addObject(ObjectsFem.makeMeshGmsh(doc, mesh_name))[0]
femmesh_obj = analysis.addObject(ObjectsFem.makeMeshGmsh(doc, get_meshname()))[0]
femmesh_obj.FemMesh = fem_mesh
femmesh_obj.Part = geom_obj
femmesh_obj.SecondOrderLinear = False