diff --git a/src/Mod/Fem/femguiobjects/_TaskPanelFemSolverControl.py b/src/Mod/Fem/femguiobjects/_TaskPanelFemSolverControl.py index c64d821a89..5c2321be73 100644 --- a/src/Mod/Fem/femguiobjects/_TaskPanelFemSolverControl.py +++ b/src/Mod/Fem/femguiobjects/_TaskPanelFemSolverControl.py @@ -333,7 +333,8 @@ class ControlWidget(QtGui.QWidget): self._directoryGrp.setDisabled(False) self._writeBtt.setDisabled(False) self._editBtt.setDisabled( - not machine.solver.Proxy.editSupported() or - machine.state < femsolver.run.PREPARE) + not machine.solver.Proxy.editSupported() + or machine.state < femsolver.run.PREPARE + ) ## @} diff --git a/src/Mod/Fem/feminout/importToolsFem.py b/src/Mod/Fem/feminout/importToolsFem.py index e31b905960..57ba5da7ef 100644 --- a/src/Mod/Fem/feminout/importToolsFem.py +++ b/src/Mod/Fem/feminout/importToolsFem.py @@ -128,18 +128,18 @@ def make_femmesh(mesh_data): if ('Nodes' in m) and (len(m['Nodes']) > 0): FreeCAD.Console.PrintLog("Found: nodes\n") if ( - ('Seg2Elem' in m) or - ('Seg3Elem' in m) or - ('Tria3Elem' in m) or - ('Tria6Elem' in m) or - ('Quad4Elem' in m) or - ('Quad8Elem' in m) or - ('Tetra4Elem' in m) or - ('Tetra10Elem' in m) or - ('Penta6Elem' in m) or - ('Penta15Elem' in m) or - ('Hexa8Elem' in m) or - ('Hexa20Elem' in m) + ('Seg2Elem' in m) + or ('Seg3Elem' in m) + or ('Tria3Elem' in m) + or ('Tria6Elem' in m) + or ('Quad4Elem' in m) + or ('Quad8Elem' in m) + or ('Tetra4Elem' in m) + or ('Tetra10Elem' in m) + or ('Penta6Elem' in m) + or ('Penta15Elem' in m) + or ('Hexa8Elem' in m) + or ('Hexa20Elem' in m) ): nds = m['Nodes'] diff --git a/src/Mod/Fem/feminout/importZ88Mesh.py b/src/Mod/Fem/feminout/importZ88Mesh.py index 4e63d4511d..c5887140bf 100644 --- a/src/Mod/Fem/feminout/importZ88Mesh.py +++ b/src/Mod/Fem/feminout/importZ88Mesh.py @@ -345,11 +345,18 @@ def read_z88_mesh(z88_mesh_input): # write z88 Mesh def write_z88_mesh_to_file(femnodes_mesh, femelement_table, z88_element_type, f): node_dimension = 3 # 2 for 2D not supported - if (z88_element_type == 4 or - z88_element_type == 17 or z88_element_type == 16 or - z88_element_type == 1 or z88_element_type == 10): + if ( + z88_element_type == 4 + or z88_element_type == 17 + or z88_element_type == 16 + or z88_element_type == 1 + or z88_element_type == 10 + ): node_dof = 3 - elif z88_element_type == 23 or z88_element_type == 24: + elif ( + z88_element_type == 23 + or z88_element_type == 24 + ): node_dof = 6 # schalenelemente else: print("Error: wrong z88_element_type") diff --git a/src/Mod/Fem/femsolver/elmer/sifio.py b/src/Mod/Fem/femsolver/elmer/sifio.py index 1502da4b5a..d7c496fe48 100644 --- a/src/Mod/Fem/femsolver/elmer/sifio.py +++ b/src/Mod/Fem/femsolver/elmer/sifio.py @@ -184,11 +184,9 @@ class Builder(object): for solverSection in eqSection[self._ACTIVE_SOLVERS]: if solverSection not in allSections: allSections.append(solverSection) - if (BODY_FORCE in section and - section[BODY_FORCE] not in allSections): + if BODY_FORCE in section and section[BODY_FORCE] not in allSections: allSections.append(section[BODY_FORCE]) - if (INITIAL_CONDITION in section and - section[INITIAL_CONDITION] not in allSections): + if INITIAL_CONDITION in section and section[INITIAL_CONDITION] not in allSections: allSections.append(section[INITIAL_CONDITION]) for name, section in self._boundaries.items(): section["Name"] = name @@ -337,8 +335,10 @@ class _Writer(object): return it.next() def _isCollection(self, data): - return (not isinstance(data, six.string_types) and - isinstance(data, collections.Iterable)) + return ( + not isinstance(data, six.string_types) + and isinstance(data, collections.Iterable) + ) def _checkScalar(self, dataType): if issubclass(dataType, int): diff --git a/src/Mod/Fem/femsolver/run.py b/src/Mod/Fem/femsolver/run.py index be28c82ff7..acb47589ea 100644 --- a/src/Mod/Fem/femsolver/run.py +++ b/src/Mod/Fem/femsolver/run.py @@ -187,8 +187,11 @@ class Machine(BaseTask): self._confTasks() self._isReset = False self._pendingState = self.state - while (not self.aborted and not self.failed and - self._pendingState <= self.target): + while ( + not self.aborted + and not self.failed + and self._pendingState <= self.target + ): task = self._getTask(self._pendingState) self._runTask(task) self.report.extend(task.report) @@ -380,8 +383,11 @@ class _DocObserver(object): def _checkEquation(self, obj): for o in obj.Document.Objects: - if (FemUtils.is_derived_from(o, "Fem::FemSolverObject") and - hasattr(o, "Group") and obj in o.Group): + if ( + FemUtils.is_derived_from(o, "Fem::FemSolverObject") + and hasattr(o, "Group") + and obj in o.Group + ): if o in _machines: _machines[o].reset() diff --git a/src/Mod/Fem/femtools/femutils.py b/src/Mod/Fem/femtools/femutils.py index d88424d107..4ddf4f5b09 100644 --- a/src/Mod/Fem/femtools/femutils.py +++ b/src/Mod/Fem/femtools/femutils.py @@ -108,8 +108,7 @@ def is_derived_from(obj, t): '''returns True if an object or its inheritance chain is of a given TypeId (C++ objects) or Proxy.Type (Python objects)''' # returns true for all FEM objects if given t == 'App::DocumentObject' since this is a father of the given object # see https://forum.freecadweb.org/viewtopic.php?f=10&t=32625 - if (hasattr(obj, "Proxy") and hasattr(obj.Proxy, "Type") and - obj.Proxy.Type == t): + if (hasattr(obj, "Proxy") and hasattr(obj.Proxy, "Type") and obj.Proxy.Type == t): return True return obj.isDerivedFrom(t)