Skip to content

Commit

Permalink
FEM: Fix typo. Rename MathObject to MaterialObject
Browse files Browse the repository at this point in the history
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Apr 17, 2015
1 parent 35c5de0 commit 4b56d3d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Mod/Fem/MechanicalAnalysis.py
Expand Up @@ -370,11 +370,11 @@ def check_prerequisites(self):
QtGui.QMessageBox.critical(None, "Missing prerequisite","No mesh object in the Analysis")
return False

self.MathObject = None
self.MaterialObject = None
for i in FemGui.getActiveAnalysis().Member:
if i.isDerivedFrom("App::MaterialObjectPython"):
self.MathObject = i
if not self.MathObject:
self.MaterialObject = i
if not self.MaterialObject:
QtGui.QMessageBox.critical(None, "Missing prerequisite","No material object in the Analysis")
return False

Expand Down Expand Up @@ -405,7 +405,7 @@ def write_calculix_input_file(self):
dirName = self.TempDir
print 'CalculiX run directory: ',dirName

matmap = self.MathObject.Material
matmap = self.MaterialObject.Material

self.Basename = self.TempDir + '/' + self.MeshObject.Name
filename = self.Basename + '.inp'
Expand Down Expand Up @@ -477,15 +477,15 @@ def write_calculix_input_file(self):
inpfile.write('\n\n')

# get material properties
YM = FreeCAD.Units.Quantity(self.MathObject.Material['Mechanical_youngsmodulus'])
YM = FreeCAD.Units.Quantity(self.MaterialObject.Material['Mechanical_youngsmodulus'])
if YM.Unit.Type == '':
print 'Material "Mechanical_youngsmodulus" has no Unit, asuming kPa!'
YM = FreeCAD.Units.Quantity(YM.Value, FreeCAD.Units.Unit('Pa'))
else:
print 'YM unit: ', YM.Unit.Type
print 'YM = ', YM

PR = float(self.MathObject.Material['FEM_poissonratio'])
PR = float(self.MaterialObject.Material['FEM_poissonratio'])
print 'PR = ', PR

# write material properties
Expand Down

0 comments on commit 4b56d3d

Please sign in to comment.