FEM: code formatting, pep8, 302
This commit is contained in:
@@ -219,6 +219,7 @@ class _ConstraintCentrif(CommandManager):
|
||||
self.is_active = "with_analysis"
|
||||
self.do_activated = "add_obj_on_gui_set_edit"
|
||||
|
||||
|
||||
class _ConstraintCurrentDensity(CommandManager):
|
||||
"The FEM_ConstraintCurrentDensity command definition"
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Deformation (nonlinear elasticity) - Elmer",
|
||||
@@ -47,6 +48,7 @@ def get_information():
|
||||
"equations": ["deformation"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -58,6 +60,7 @@ Deformation equation - Elmer solver
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -34,6 +34,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Electrostatics Capacitance Two Balls",
|
||||
@@ -45,6 +46,7 @@ def get_information():
|
||||
"equations": ["electrostatic"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -60,6 +62,7 @@ Electrostatics equation in FreeCAD FEM-Elmer
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -37,6 +37,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Electrostatics Electricforce - Elmer NonGUI6",
|
||||
@@ -48,6 +49,7 @@ def get_information():
|
||||
"equations": ["electrostatic"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -63,6 +65,7 @@ Electrostatics equation in FreeCAD FEM-Elmer
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -35,6 +35,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Flow - Elmer 2D",
|
||||
@@ -47,6 +48,7 @@ def get_information():
|
||||
"equations": ["flow", "heat"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -58,6 +60,7 @@ Flow and Heat equation - Elmer solver
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -35,6 +35,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Initial Flow - Elmer 2D",
|
||||
@@ -47,6 +48,7 @@ def get_information():
|
||||
"equations": ["flow", "heat"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -58,6 +60,7 @@ Flow and Heat equation with initial velocity - Elmer solver
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -35,6 +35,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Turbulent Flow - Elmer 2D",
|
||||
@@ -47,6 +48,7 @@ def get_information():
|
||||
"equations": ["flow", "heat"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -58,6 +60,7 @@ Flow and Heat equation in turbulent flow - Elmer solver
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -31,6 +31,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Flux - Elmer",
|
||||
@@ -42,6 +43,7 @@ def get_information():
|
||||
"equations": ["electrostatic", "flux", "heat"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -53,6 +55,7 @@ Potential flux and heat flux - Elmer solver
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -36,6 +36,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Inductive heating - Elmer 2D",
|
||||
@@ -47,6 +48,7 @@ def get_information():
|
||||
"equations": ["electromagnetic"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -58,6 +60,7 @@ Magnetodynamic2D equation - Elmer solver
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -35,6 +35,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Magnetic Field Around Wire",
|
||||
@@ -46,6 +47,7 @@ def get_information():
|
||||
"equations": ["electromagnetic"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -57,6 +59,7 @@ Magnetodynamic equation - Elmer solver
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -34,6 +34,7 @@ from . import manager
|
||||
from .manager import get_meshname
|
||||
from .manager import init_doc
|
||||
|
||||
|
||||
def get_information():
|
||||
return {
|
||||
"name": "Magnetostatic - Elmer 2D",
|
||||
@@ -45,6 +46,7 @@ def get_information():
|
||||
"equations": ["magnetostatic"]
|
||||
}
|
||||
|
||||
|
||||
def get_explanation(header=""):
|
||||
return header + """
|
||||
|
||||
@@ -56,6 +58,7 @@ Magnetodynamic2D equation - Elmer solver
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def setup(doc=None, solvertype="elmer"):
|
||||
|
||||
# init FreeCAD document
|
||||
|
||||
@@ -32,6 +32,7 @@ from femtools import femutils
|
||||
from . import nonlinear
|
||||
from ... import equationbase
|
||||
|
||||
|
||||
def create(doc, name="Deformation"):
|
||||
return femutils.createObject(
|
||||
doc, name, Proxy, ViewProxy)
|
||||
|
||||
@@ -35,6 +35,7 @@ from .. import sifio
|
||||
from .. import writer as general_writer
|
||||
from femtools import femutils
|
||||
|
||||
|
||||
class DeformationWriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -36,6 +36,7 @@ from .. import writer as general_writer
|
||||
from femtools import femutils
|
||||
from . import elasticity
|
||||
|
||||
|
||||
class ElasticityWriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -32,6 +32,7 @@ __url__ = "https://www.freecad.org"
|
||||
from .. import sifio
|
||||
from . import electricforce
|
||||
|
||||
|
||||
class EFwriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -32,6 +32,7 @@ __url__ = "https://www.freecad.org"
|
||||
|
||||
from .. import sifio
|
||||
|
||||
|
||||
class ESwriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -34,6 +34,7 @@ from .. import sifio
|
||||
from .. import writer as general_writer
|
||||
from . import flow
|
||||
|
||||
|
||||
class Flowwriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -33,6 +33,7 @@ __url__ = "https://www.freecad.org"
|
||||
from .. import sifio
|
||||
from . import flux
|
||||
|
||||
|
||||
class Fluxwriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -36,6 +36,7 @@ from femtools import membertools
|
||||
from femmesh import meshtools
|
||||
from . import heat
|
||||
|
||||
|
||||
class Heatwriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -32,6 +32,7 @@ from femtools import femutils
|
||||
from . import nonlinear
|
||||
from ... import equationbase
|
||||
|
||||
|
||||
def create(doc, name="Magnetodynamic"):
|
||||
return femutils.createObject(
|
||||
doc, name, Proxy, ViewProxy)
|
||||
|
||||
@@ -32,6 +32,7 @@ from femtools import femutils
|
||||
from . import nonlinear
|
||||
from ... import equationbase
|
||||
|
||||
|
||||
def create(doc, name="Magnetodynamic2D"):
|
||||
return femutils.createObject(
|
||||
doc, name, Proxy, ViewProxy)
|
||||
|
||||
@@ -34,6 +34,7 @@ from FreeCAD import Units
|
||||
from .. import sifio
|
||||
from .. import writer as general_writer
|
||||
|
||||
|
||||
class MgDyn2Dwriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -34,6 +34,7 @@ from FreeCAD import Units
|
||||
from .. import sifio
|
||||
from .. import writer as general_writer
|
||||
|
||||
|
||||
class MgDynwriter:
|
||||
|
||||
def __init__(self, writer, solver):
|
||||
|
||||
@@ -167,6 +167,7 @@ def get_dir_setting():
|
||||
return DirSetting.CUSTOM
|
||||
return DirSetting.TEMPORARY
|
||||
|
||||
|
||||
def get_default_solver():
|
||||
""" Return default solver name.
|
||||
"""
|
||||
@@ -182,6 +183,7 @@ def get_default_solver():
|
||||
param_group = FreeCAD.ParamGet(_GENERAL_PARAM)
|
||||
return solver_map[param_group.GetInt("DefaultSolver", 0)]
|
||||
|
||||
|
||||
class _SolverDlg(object):
|
||||
""" Internal query logic for solver specific settings.
|
||||
|
||||
|
||||
@@ -397,6 +397,7 @@ def startProgramInfo(code):
|
||||
info.dwFlags = subprocess.STARTF_USESHOWWINDOW
|
||||
return info
|
||||
|
||||
|
||||
def expandParentObject():
|
||||
""" expands parent and selected obj in tree view """
|
||||
trees = FreeCADGui.getMainWindow().findChildren(QtGui.QTreeWidget)
|
||||
|
||||
Reference in New Issue
Block a user