Skip to content

Commit

Permalink
FEM: analysis object, move make def into make objects FEM module
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach authored and wwmayer committed Feb 21, 2017
1 parent b7c1bb0 commit c63f1e7
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 51 deletions.
1 change: 0 additions & 1 deletion src/Mod/Fem/App/CMakeLists.txt
Expand Up @@ -120,7 +120,6 @@ SET(FemScripts_SRCS
importZ88O2Results.py
Init.py
InitGui.py
FemAnalysis.py
FemBeamSection.py
FemCommands.py
FemConstraintSelfWeight.py
Expand Down
1 change: 0 additions & 1 deletion src/Mod/Fem/CMakeLists.txt
Expand Up @@ -44,7 +44,6 @@ INSTALL(
_TaskPanelShowResult.py
TaskPanelShowResult.ui

FemAnalysis.py
_CommandAnalysis.py

FemMeshGmsh.py
Expand Down
38 changes: 0 additions & 38 deletions src/Mod/Fem/FemAnalysis.py

This file was deleted.

7 changes: 7 additions & 0 deletions src/Mod/Fem/ObjectsFem.py
Expand Up @@ -30,6 +30,13 @@
import FreeCAD


########## analysis ##########
def makeAnalysis(name):
'''makeAnalysis(name): makes a Fem Analysis object'''
obj = FreeCAD.ActiveDocument.addObject("Fem::FemAnalysisPython", name)
return obj


########## constraints ##########
def makeConstraintBearing(name):
'''makeConstraintBearing(name): makes a Fem ConstraintBearing object'''
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Fem/TestFem.py
Expand Up @@ -27,7 +27,7 @@
import Fem
import FemToolsCcx
import FreeCAD
import FemAnalysis
import ObjectsFem
import FemSolverCalculix
import FemMaterial
import csv
Expand Down Expand Up @@ -82,7 +82,7 @@ def setUp(self):
self.active_doc.recompute()

def create_new_analysis(self):
self.analysis = FemAnalysis.makeFemAnalysis('Analysis')
self.analysis = ObjectsFem.makeAnalysis('Analysis')
self.active_doc.recompute()

def create_new_solver(self):
Expand Down Expand Up @@ -304,7 +304,7 @@ def setUp(self):
self.active_doc.recompute()

def create_new_analysis(self):
self.analysis = FemAnalysis.makeFemAnalysis('Analysis')
self.analysis = ObjectsFem.makeAnalysis('Analysis')
self.active_doc.recompute()

def create_new_solver(self):
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/_CommandAnalysis.py
Expand Up @@ -46,9 +46,9 @@ def __init__(self):
def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Create Analysis")
FreeCADGui.addModule("FemGui")
FreeCADGui.addModule("FemAnalysis")
FreeCADGui.addModule("ObjectsFem")
FreeCADGui.addModule("FemSolverCalculix")
FreeCADGui.doCommand("FemAnalysis.makeFemAnalysis('Analysis')")
FreeCADGui.doCommand("ObjectsFem.makeAnalysis('Analysis')")
FreeCADGui.doCommand("FemGui.setActiveAnalysis(App.activeDocument().ActiveObject)")
FreeCADGui.doCommand("FemSolverCalculix.makeFemSolverCalculix('CalculiX')")
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [App.activeDocument().ActiveObject]")
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/importCcxFrdResults.py
Expand Up @@ -70,8 +70,8 @@ def importFrd(filename, analysis=None, result_name_prefix=None):
if(len(m['Nodes']) > 0):
if analysis is None:
analysis_name = os.path.splitext(os.path.basename(filename))[0]
import FemAnalysis
analysis_object = FemAnalysis.makeFemAnalysis('Analysis')
import ObjectsFem
analysis_object = ObjectsFem.makeAnalysis('Analysis')
analysis_object.Label = analysis_name
else:
analysis_object = analysis # see if statement few lines later, if not analysis -> no FemMesh object is created !
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/importVTKResults.py
Expand Up @@ -78,8 +78,8 @@ def importVTK(filename, analysis=None, result_name_prefix=None):
result_name_prefix = ''
if analysis is None:
analysis_name = os.path.splitext(os.path.basename(filename))[0]
import FemAnalysis
analysis_object = FemAnalysis.makeFemAnalysis('Analysis')
import ObjectsFem
analysis_object = ObjectsFem.makeAnalysis('Analysis')
analysis_object.Label = analysis_name
else:
analysis_object = analysis
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/importZ88O2Results.py
Expand Up @@ -71,8 +71,8 @@ def import_z88_disp(filename, analysis=None, result_name_prefix=None):
if(len(m['Nodes']) > 0):
if analysis is None:
analysis_name = os.path.splitext(os.path.basename(filename))[0]
import FemAnalysis
analysis_object = FemAnalysis.makeFemAnalysis('Analysis')
import ObjectsFem
analysis_object = ObjectsFem.makeAnalysis('Analysis')
analysis_object.Label = analysis_name
else:
analysis_object = analysis # see if statement few lines later, if not analysis -> no FemMesh object is created !
Expand Down

0 comments on commit c63f1e7

Please sign in to comment.