Skip to content

Commit

Permalink
FEM: mechanical result object, move make def into make objects FEM mo…
Browse files Browse the repository at this point in the history
…dule
  • Loading branch information
berndhahnebach authored and wwmayer committed Feb 21, 2017
1 parent b03b080 commit feae651
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 51 deletions.
1 change: 0 additions & 1 deletion src/Mod/Fem/App/CMakeLists.txt
Expand Up @@ -126,7 +126,6 @@ SET(FemScripts_SRCS
FemInputWriterCcx.py
FemInputWriterZ88.py
FemMaterialMechanicalNonlinear.py
FemMechanicalResult.py
FemMesh2Mesh.py
FemMeshGmsh.py
FemMeshGroup.py
Expand Down
1 change: 0 additions & 1 deletion src/Mod/Fem/CMakeLists.txt
Expand Up @@ -37,7 +37,6 @@ INSTALL(
_CommandRunSolver.py
_CommandControlSolver.py

FemMechanicalResult.py
_FemMechanicalResult.py
_ViewProviderFemMechanicalResult.py
_CommandShowResult.py
Expand Down
43 changes: 0 additions & 43 deletions src/Mod/Fem/FemMechanicalResult.py

This file was deleted.

12 changes: 12 additions & 0 deletions src/Mod/Fem/ObjectsFem.py
Expand Up @@ -95,6 +95,18 @@ def makeShellThickness(thickness=20.0, name="ShellThickness"):
return obj


########## results ##########
def makeMechanicalResult(name="MechanicalResult"):
'''makeMechanicalResult(name): creates an mechanical object result to hold FEM results'''
obj = FreeCAD.ActiveDocument.addObject('Fem::FemResultObjectPython', name)
import _FemMechanicalResult
_FemMechanicalResult._FemMechanicalResult(obj)
if FreeCAD.GuiUp:
from _ViewProviderFemMechanicalResult import _ViewProviderFemMechanicalResult
_ViewProviderFemMechanicalResult(obj.ViewObject)
return obj


########## constraints ##########
def makeConstraintBearing(name):
'''makeConstraintBearing(name): makes a Fem ConstraintBearing object'''
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/importCcxFrdResults.py
Expand Up @@ -108,8 +108,8 @@ def importFrd(filename, analysis=None, result_name_prefix=None):
results_name = result_name_prefix + 'time_' + str(step_time) + '_results'
else:
results_name = result_name_prefix + 'results'
import FemMechanicalResult
results = FemMechanicalResult.makeFemMechanicalResult(results_name)
import ObjectsFem
results = ObjectsFem.makeMechanicalResult(results_name)
for m in analysis_object.Member:
if m.isDerivedFrom("Fem::FemMeshObject"):
results.Mesh = m
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/importVTKResults.py
Expand Up @@ -86,8 +86,8 @@ def importVTK(filename, analysis=None, result_name_prefix=None):

# if properties can be added in FemVTKTools importCfdResult(), this file can be used for CFD workbench
results_name = result_name_prefix + 'results'
from FemMechanicalResult import makeFemMechanicalResult
result_obj = makeFemMechanicalResult(results_name)
import ObjectsFem
result_obj = ObjectsFem.makeMechanicalResult(results_name)
# result_obj = FreeCAD.ActiveDocument.addObject('Fem::FemResultObject', results_name)
Fem.readResult(filename, result_obj.Name) # readResult always creates a new femmesh named ResultMesh

Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/importZ88O2Results.py
Expand Up @@ -79,8 +79,8 @@ def import_z88_disp(filename, analysis=None, result_name_prefix=None):

for result_set in m['Results']:
results_name = result_name_prefix + 'results'
import FemMechanicalResult
results = FemMechanicalResult.makeFemMechanicalResult(results_name)
import ObjectsFem
results = ObjectsFem.makeMechanicalResult(results_name)
#results = FreeCAD.ActiveDocument.addObject('Fem::FemResultObject', results_name)
for m in analysis_object.Member:
if m.isDerivedFrom("Fem::FemMeshObject"):
Expand Down

0 comments on commit feae651

Please sign in to comment.