FEM: code formatting, pep8, E265

This commit is contained in:
Bernd Hahnebach
2023-04-03 20:45:32 +02:00
committed by wwmayer
parent 4b71146e5d
commit 4fe41c5372
3 changed files with 18 additions and 18 deletions

View File

@@ -599,7 +599,7 @@ class FemSelectionObserver:
def __init__(self, parseSelectionFunction, print_message=""):
self.parseSelectionFunction = parseSelectionFunction
FreeCADGui.Selection.addObserver(self)
#FreeCAD.Console.PrintMessage(print_message + "!\n")
# FreeCAD.Console.PrintMessage(print_message + "!\n")
def addSelection(self, docName, objName, sub, pos):
selected_object = FreeCAD.getDocument(docName).getObject(objName) # get the obj objName

View File

@@ -394,10 +394,10 @@ class GmshTools():
self.group_elements[ge] = new_group_elements[ge]
else:
Console.PrintError(" A group with this name exists already.\n")
#else:
# else:
# Console.PrintMessage(" No Group meshing for analysis.\n")
#if self.group_elements:
# if self.group_elements:
# Console.PrintMessage(" {}\n".format(self.group_elements))
def get_gmsh_version(self):
@@ -447,7 +447,7 @@ class GmshTools():
# print(" No mesh regions.")
pass
else:
#Console.PrintMessage(" Mesh regions, we need to get the elements.\n")
# Console.PrintMessage(" Mesh regions, we need to get the elements.\n")
# by the use of MeshRegion object and a BooleanSplitCompound
# there could be problems with node numbers see
# http://forum.freecadweb.org/viewtopic.php?f=18&t=18780&start=40#p149467
@@ -530,8 +530,8 @@ class GmshTools():
ele_shape = geomtools.get_element(self.part_obj, eleml)
ele_vertexes = geomtools.get_vertexes_by_element(self.part_obj.Shape, ele_shape)
self.ele_node_map[eleml] = ele_vertexes
#Console.PrintMessage(" {}\n".format(self.ele_length_map))
#Console.PrintMessage(" {}\n".format(self.ele_node_map))
# Console.PrintMessage(" {}\n".format(self.ele_length_map))
# Console.PrintMessage(" {}\n".format(self.ele_node_map))
def get_boundary_layer_data(self):
# mesh boundary layer
@@ -543,7 +543,7 @@ class GmshTools():
# print(" No mesh boundary layer setting document object.")
pass
else:
#Console.PrintMessage(" Mesh boundary layers, we need to get the elements.\n")
# Console.PrintMessage(" Mesh boundary layers, we need to get the elements.\n")
if self.part_obj.Shape.ShapeType == "Compound":
# see http://forum.freecadweb.org/viewtopic.php?f=18&t=18780&start=40#p149467 and
# http://forum.freecadweb.org/viewtopic.php?f=18&t=18780&p=149520#p149520

View File

@@ -419,7 +419,7 @@ class Writer(object):
)
solver.TimestepSizes = [0.1]
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Deformation
def _handleDeformation(self):
@@ -447,7 +447,7 @@ class Writer(object):
DEFW.handleDeformationBodyForces(activeIn)
DEFW.handleDeformationMaterial(activeIn)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Elasticity
def _handleElasticity(self):
@@ -475,7 +475,7 @@ class Writer(object):
ELW.handleElasticityBodyForces(activeIn)
ELW.handleElasticityMaterial(activeIn)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Electrostatic
def _handleElectrostatic(self):
@@ -495,7 +495,7 @@ class Writer(object):
ESW.handleElectrostaticBndConditions()
ESW.handleElectrostaticMaterial(activeIn)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Electricforce
def _handleElectricforce(self):
@@ -511,7 +511,7 @@ class Writer(object):
for body in activeIn:
self._addSolver(body, solverSection)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Flow
def _handleFlow(self):
@@ -539,7 +539,7 @@ class Writer(object):
FlowW.handleFlowInitialVelocity(activeIn)
FlowW.handleFlowMaterial(activeIn)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Flux
def _handleFlux(self):
@@ -555,7 +555,7 @@ class Writer(object):
for body in activeIn:
self._addSolver(body, solverSection)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Heat
def _handleHeat(self):
@@ -578,7 +578,7 @@ class Writer(object):
HeatW.handleHeatBodyForces(activeIn)
HeatW.handleHeatMaterial(activeIn)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Magnetodynamic
def _handleMagnetodynamic(self):
@@ -602,7 +602,7 @@ class Writer(object):
MgDyn.handleMagnetodynamicBodyForces(activeIn, equation)
MgDyn.handleMagnetodynamicMaterial(activeIn)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Magnetodynamic2D
def _handleMagnetodynamic2D(self):
@@ -635,7 +635,7 @@ class Writer(object):
MgDyn2D.handleMagnetodynamic2DBodyForces(activeIn, equation)
MgDyn2D.handleMagnetodynamic2DMaterial(activeIn)
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Solver handling
def createEmptySolver(self):
@@ -730,7 +730,7 @@ class Writer(object):
equation.NonlinearNewtonAfterTolerance
return s
#-------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# Helper functions
def _haveMaterialSolid(self):