FEM: Python pep8 code formatting

This commit is contained in:
Bernd Hahnebach
2022-08-06 20:09:03 +02:00
parent d3e920f7cd
commit 0ed91f1b6a
3 changed files with 30 additions and 9 deletions

View File

@@ -32,8 +32,15 @@ from femtools import femutils
from ... import equationbase
from . import linear
EIGEN_SYSTEM_SELECT = ["Smallest Magnitude", "Largest Magnitude", "Smallest Real Part",\
"Largest Real Part", "Smallest Imag Part", "Largest Imag Part"]
EIGEN_SYSTEM_SELECT = [
"Smallest Magnitude",
"Largest Magnitude",
"Smallest Real Part",
"Largest Real Part",
"Smallest Imag Part",
"Largest Imag Part"
]
def create(doc, name="Elasticity"):
return femutils.createObject(

View File

@@ -86,13 +86,19 @@ class Proxy(solverbase.Proxy):
"App::PropertyIntegerList",
"TimestepIntervals",
"Timestepping",
"List of maximum optimization rounds if 'Simulation Type'\nis either 'Scanning' or 'Transient'"
(
"List of maximum optimization rounds if 'Simulation Type'\n"
"is either 'Scanning' or 'Transient'"
)
)
obj.addProperty(
"App::PropertyFloatList",
"TimestepSizes",
"Timestepping",
"List of time steps of optimization if 'Simulation Type'\nis either 'Scanning' or 'Transient'"
(
"List of time steps of optimization if 'Simulation Type'\n"
"is either 'Scanning' or 'Transient'"
)
)
# there is no universal default, it all depends on the analysis, however
# we have to set something and set 10 seconds in steps of 0.1s

View File

@@ -842,7 +842,7 @@ class Writer(object):
"EigenSystemComputeResiduals",
"Eigen Values",
"Computes residuals of eigen value system"
)
)
if not hasattr(equation, "EigenSystemDamped"):
equation.addProperty(
"App::PropertyBool",
@@ -861,8 +861,14 @@ class Writer(object):
"Max iterations for iterative eigensystem solver"
)
equation.EigenSystemMaxIterations = (300, 1, int(1e8), 1)
EIGEN_SYSTEM_SELECT = ["Smallest Magnitude", "Largest Magnitude", "Smallest Real Part",\
"Largest Real Part", "Smallest Imag Part", "Largest Imag Part"]
EIGEN_SYSTEM_SELECT = [
"Smallest Magnitude",
"Largest Magnitude",
"Smallest Real Part",
"Largest Real Part",
"Smallest Imag Part",
"Largest Imag Part"
]
if not hasattr(equation, "EigenSystemSelect"):
equation.addProperty(
"App::PropertyEnumeration",
@@ -1270,8 +1276,10 @@ class Writer(object):
if self._hasExpression(equation) != equation.NonlinearTolerance:
equation.setExpression("NonlinearTolerance", str(equation.NonlinearTolerance))
if self._hasExpression(equation) != equation.NonlinearNewtonAfterTolerance:
equation.setExpression("NonlinearNewtonAfterTolerance",\
str(equation.NonlinearNewtonAfterTolerance))
equation.setExpression(
"NonlinearNewtonAfterTolerance",
str(equation.NonlinearNewtonAfterTolerance)
)
def _createNonlinearSolver(self, equation):
# first check if we have to update