Skip to content

Commit

Permalink
FEM: pyhton code formating: comment should start with '# '
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach authored and yorikvanhavre committed Jul 21, 2016
1 parent 30bacee commit 5c2ffb7
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Fem/FemAnalysis.py
Expand Up @@ -34,5 +34,5 @@ def makeFemAnalysis(name):
_FemAnalysis._FemAnalysis(obj)
import _ViewProviderFemAnalysis
_ViewProviderFemAnalysis._ViewProviderFemAnalysis()
#FreeCAD.ActiveDocument.recompute()
# FreeCAD.ActiveDocument.recompute()
return obj
6 changes: 3 additions & 3 deletions src/Mod/Fem/FemCommands.py
Expand Up @@ -39,7 +39,7 @@ def __init__(self):
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_Command", "Default Fem Command MenuText"),
'Accel': "",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_Command", "Default Fem Command ToolTip")}
#FIXME add option description
# FIXME add option description
self.is_active = None

def GetResources(self):
Expand Down Expand Up @@ -101,8 +101,8 @@ def analysis_has_solver(self):
def hide_parts_constraints_show_meshes(self):
if FreeCAD.GuiUp:
for acnstrmesh in FemGui.getActiveAnalysis().Member:
#if "Constraint" in acnstrmesh.TypeId:
# acnstrmesh.ViewObject.Visibility = False
# if "Constraint" in acnstrmesh.TypeId:
# acnstrmesh.ViewObject.Visibility = False
if "Mesh" in acnstrmesh.TypeId:
aparttoshow = acnstrmesh.Name.replace("_Mesh", "")
for apart in FreeCAD.activeDocument().Objects:
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Fem/FemInputWriter.py
Expand Up @@ -103,14 +103,14 @@ def get_constraints_force_nodeloads(self):
# frc_obj.References could be empty ! # TODO in FemTools: check
FreeCAD.Console.PrintError('At least one Force Object has empty References!\n')
if femobj['RefShapeType'] == 'Vertex':
#print("load on vertices --> we do not need the femelement_table and femnodes_mesh for node load calculation")
# print("load on vertices --> we do not need the femelement_table and femnodes_mesh for node load calculation")
pass
elif femobj['RefShapeType'] == 'Face' and FemMeshTools.is_solid_femmesh(self.femmesh) and not FemMeshTools.has_no_face_data(self.femmesh):
#print("solid_mesh with face data --> we do not need the femelement_table but we need the femnodes_mesh for node load calculation")
# print("solid_mesh with face data --> we do not need the femelement_table but we need the femnodes_mesh for node load calculation")
if not self.femnodes_mesh:
self.femnodes_mesh = self.femmesh.Nodes
else:
#print("mesh without needed data --> we need the femelement_table and femnodes_mesh for node load calculation")
# print("mesh without needed data --> we need the femelement_table and femnodes_mesh for node load calculation")
if not self.femnodes_mesh:
self.femnodes_mesh = self.femmesh.Nodes
if not self.femelement_table:
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Fem/_CommandRunSolver.py
Expand Up @@ -73,15 +73,15 @@ def load_results(ret_code):
QtGui.QMessageBox.critical(None, "Missing prerequisite", message)
return
self.fea.run() # test z88
#self.fea.finished.connect(load_results)
#QtCore.QThreadPool.globalInstance().start(self.fea)
# self.fea.finished.connect(load_results)
# QtCore.QThreadPool.globalInstance().start(self.fea)
else:
QtGui.QMessageBox.critical(None, "Not known solver type", message)

def show_results_on_mesh(self):
#FIXME proprer mesh refreshing as per FreeCAD.FEM_dialog settings required
# FIXME proprer mesh refreshing as per FreeCAD.FEM_dialog settings required
# or confirmation that it's safe to call restore_result_dialog
#FIXME if an analysis has multiple results (frequence) the first result object found is restored
# FIXME if an analysis has multiple results (frequence) the first result object found is restored
import _TaskPanelShowResult
tp = _TaskPanelShowResult._TaskPanelShowResult()
tp.restore_result_dialog()
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Fem/_CommandShowResult.py
Expand Up @@ -56,7 +56,7 @@ def Activated(self):
FreeCADGui.Control.showDialog(taskd)


#Code duplidation - to be removed after migration to FemTools
# Code duplidation - to be removed after migration to FemTools
def get_results_object(sel):
import FemGui
if (len(sel) == 1):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Fem/_FemSolverCalculix.py
Expand Up @@ -55,7 +55,7 @@ def __init__(self, obj):
obj.NumberOfEigenmodes = (noe, 1, 100, 1)

obj.addProperty("App::PropertyFloatConstraint", "EigenmodeLowLimit", "Fem", "Low frequency limit for eigenmode calculations")
#Not yet in prefs, so it will always default to 0.0
# Not yet in prefs, so it will always default to 0.0
ell = fem_prefs.GetFloat("EigenmodeLowLimit", 0.0)
obj.EigenmodeLowLimit = (ell, 0.0, 1000000.0, 10000.0)

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Fem/_TaskPanelFemSolverCalculix.py
Expand Up @@ -63,7 +63,7 @@ def __init__(self, solver_object):

self.fem_console_message = ''

#Connect Signals and Slots
# Connect Signals and Slots
QtCore.QObject.connect(self.form.tb_choose_working_dir, QtCore.SIGNAL("clicked()"), self.choose_working_dir)
QtCore.QObject.connect(self.form.pb_write_inp, QtCore.SIGNAL("clicked()"), self.write_input_file_handler)
QtCore.QObject.connect(self.form.pb_edit_inp, QtCore.SIGNAL("clicked()"), self.editCalculixInputFile)
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/_TaskPanelShowResult.py
Expand Up @@ -43,7 +43,7 @@ def __init__(self):
self.fem_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem")
self.restore_result_settings_in_dialog = self.fem_prefs.GetBool("RestoreResultDialog", True)

#Connect Signals and Slots
# Connect Signals and Slots
QtCore.QObject.connect(self.form.rb_none, QtCore.SIGNAL("toggled(bool)"), self.none_selected)
QtCore.QObject.connect(self.form.rb_x_displacement, QtCore.SIGNAL("toggled(bool)"), self.x_displacement_selected)
QtCore.QObject.connect(self.form.rb_y_displacement, QtCore.SIGNAL("toggled(bool)"), self.y_displacement_selected)
Expand Down Expand Up @@ -231,7 +231,7 @@ def reject(self):
FreeCADGui.Control.closeDialog()


#It's code duplication that should be removes wher we migrate to FemTools.py
# It's code duplication that should be removes wher we migrate to FemTools.py
def get_results_object(sel):
if (len(sel) == 1):
if sel[0].isDerivedFrom("Fem::FemResultObject"):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Fem/_ViewProviderFemAnalysis.py
Expand Up @@ -9,7 +9,7 @@ class _ViewProviderFemAnalysis:
"A View Provider for the FemAnalysis container object"

def __init__(self):
#vobj.addProperty("App::PropertyLength", "BubbleSize", "Base", "The size of the axis bubbles")
# vobj.addProperty("App::PropertyLength", "BubbleSize", "Base", "The size of the axis bubbles")
pass

def getIcon(self):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Fem/ccxDatReader.py
Expand Up @@ -68,7 +68,7 @@ def readResult(dat_input):

def import_dat(filename, Analysis=None):
r = readResult(filename)
#print ("Results {}".format(r))
# print ("Results {}".format(r))
return r


Expand Down
20 changes: 10 additions & 10 deletions src/Mod/Fem/ccxFrdReader.py
Expand Up @@ -64,24 +64,24 @@ def readResult(frd_input):
elemType = 0

for line in frd_file:
#Check if we found nodes section
# Check if we found nodes section
if line[4:6] == "2C":
nodes_found = True
#first lets extract the node and coordinate information from the results file
# first lets extract the node and coordinate information from the results file
if nodes_found and (line[1:3] == "-1"):
elem = int(line[4:13])
nodes_x = float(line[13:25])
nodes_y = float(line[25:37])
nodes_z = float(line[37:49])
nodes[elem] = FreeCAD.Vector(nodes_x, nodes_y, nodes_z)
#Check if we found nodes section
# Check if we found nodes section
if line[4:6] == "3C":
elements_found = True
#first lets extract element number
# first lets extract element number
if elements_found and (line[1:3] == "-1"):
elem = int(line[4:13])
elemType = int(line[14:18])
#then import elements
# then import elements
if elements_found and (line[1:3] == "-2"):
# node order fits with node order in writeAbaqus() in FemMesh.cpp
if elemType == 1:
Expand Down Expand Up @@ -236,13 +236,13 @@ def readResult(frd_input):
nd2 = int(line[13:23])
elements_seg2[elem] = (nd1, nd2)

#Check if we found new eigenmode
# Check if we found new eigenmode
if line[5:10] == "PMODE":
eigenmode = int(line[30:36])
#Check if we found displacement section
# Check if we found displacement section
if line[5:9] == "DISP":
mode_disp_found = True
#we found a displacement line in the frd file
# we found a displacement line in the frd file
if mode_disp_found and (line[1:3] == "-1"):
elem = int(line[4:13])
mode_disp_x = float(line[13:25])
Expand All @@ -251,7 +251,7 @@ def readResult(frd_input):
mode_disp[elem] = FreeCAD.Vector(mode_disp_x, mode_disp_y, mode_disp_z)
if line[5:11] == "STRESS":
mode_stress_found = True
#we found a displacement line in the frd file
# we found a displacement line in the frd file
if mode_stress_found and (line[1:3] == "-1"):
elem = int(line[4:13])
stress_1 = float(line[13:25])
Expand All @@ -261,7 +261,7 @@ def readResult(frd_input):
stress_5 = float(line[61:73])
stress_6 = float(line[73:85])
mode_stress[elem] = (stress_1, stress_2, stress_3, stress_4, stress_5, stress_6)
#Check for the end of a section
# Check for the end of a section
if line[1:3] == "-3":
if mode_disp_found:
mode_disp_found = False
Expand Down

0 comments on commit 5c2ffb7

Please sign in to comment.