FEM: elmer equations, code formatting

This commit is contained in:
Bernd Hahnebach
2020-07-14 22:26:19 +02:00
parent 605f1aa2e1
commit 11419ecfaf
6 changed files with 187 additions and 79 deletions

View File

@@ -45,23 +45,41 @@ class Proxy(linear.Proxy, equationbase.ElasticityProxy):
def __init__(self, obj):
super(Proxy, self).__init__(obj)
obj.addProperty(
"App::PropertyBool", "DoFrequencyAnalysis",
"Elasticity", "Select type of solver for linear system")
"App::PropertyBool",
"DoFrequencyAnalysis",
"Elasticity",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyInteger", "EigenmodesCount",
"Elasticity", "Select type of solver for linear system")
"App::PropertyInteger",
"EigenmodesCount",
"Elasticity",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyBool", "CalculateStrains",
"Elasticity", "Select type of solver for linear system")
"App::PropertyBool",
"CalculateStrains",
"Elasticity",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyBool", "CalculateStresses",
"Elasticity", "Select type of solver for linear system")
"App::PropertyBool",
"CalculateStresses",
"Elasticity",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyBool", "CalculatePrincipal",
"Elasticity", "Select type of solver for linear system")
"App::PropertyBool",
"CalculatePrincipal",
"Elasticity",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyBool", "CalculatePangle",
"Elasticity", "Select type of solver for linear system")
"App::PropertyBool",
"CalculatePangle",
"Elasticity",
"Select type of solver for linear system"
)
obj.EigenmodesCount = 5
obj.Priority = 10

View File

@@ -45,24 +45,42 @@ class Proxy(linear.Proxy, equationbase.ElectrostaticProxy):
def __init__(self, obj):
super(Proxy, self).__init__(obj)
obj.addProperty(
"App::PropertyBool", "CalculateElectricField",
"Electrostatic", "Select type of solver for linear system")
"App::PropertyBool",
"CalculateElectricField",
"Electrostatic",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyBool", "CalculateElectricFlux",
"Electrostatic", "Select type of solver for linear system")
"App::PropertyBool",
"CalculateElectricFlux",
"Electrostatic",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyBool", "CalculateElectricEnergy",
"Electrostatic", "Select type of solver for linear system")
"App::PropertyBool",
"CalculateElectricEnergy",
"Electrostatic",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyBool", "CalculateSurfaceCharge",
"Electrostatic", "Select type of solver for linear system")
"App::PropertyBool",
"CalculateSurfaceCharge",
"Electrostatic",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyBool", "CalculateCapacitanceMatrix",
"Electrostatic", "Select type of solver for linear system")
"App::PropertyBool",
"CalculateCapacitanceMatrix",
"Electrostatic",
"Select type of solver for linear system"
)
"""
#obj.addProperty(
#"App::PropertyInteger", "CapacitanceBodies",
#"Electrostatic", "Select type of solver for linear system")
obj.addProperty(
"App::PropertyInteger",
"CapacitanceBodies",
"Electrostatic",
"Select type of solver for linear system"
)
"""
obj.Priority = 10

View File

@@ -42,8 +42,11 @@ class Proxy(equationbase.BaseProxy):
def __init__(self, obj):
super(Proxy, self).__init__(obj)
obj.addProperty(
"App::PropertyInteger", "Priority",
"Base", "Select type of solver for linear system")
"App::PropertyInteger",
"Priority",
"Base",
"Select type of solver for linear system"
)
class ViewProxy(equationbase.BaseViewProxy):

View File

@@ -46,32 +46,56 @@ class Proxy(linear.Proxy, equationbase.FluxProxy):
def __init__(self, obj):
super(Proxy, self).__init__(obj)
obj.addProperty(
"App::PropertyBool", "CalculateFlux",
"Flux", "Select type of solver for linear system")
"App::PropertyBool",
"CalculateFlux",
"Flux",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyString", "FluxVariable",
"Flux", "Insert variable name for flux calculation")
"""
#obj.addProperty(
#"App::PropertyBool", "CalculateFluxAbs",
#"Flux", "Select calculation of abs of flux")
#obj.addProperty(
#"App::PropertyBool", "CalculateFluxMagnitude",
#"Flux", "Select calculation of magnitude of flux")
"App::PropertyString",
"FluxVariable",
"Flux",
"Insert variable name for flux calculation"
)
"""
obj.addProperty(
"App::PropertyBool", "CalculateGrad",
"Flux", "Select calculation of gradient")
"App::PropertyBool",
"CalculateFluxAbs",
"Flux",
"Select calculation of abs of flux"
)
obj.addProperty(
"App::PropertyBool",
"CalculateFluxMagnitude",
"Flux",
"Select calculation of magnitude of flux"
)
"""
#obj.addProperty(
#"App::PropertyBool", "CalculateGradAbs",
#"Flux", "Select calculation of abs of gradient")
#obj.addProperty(
#"App::PropertyBool", "CalculateGradMagnitude",
#"Flux", "Select calculation of magnitude of gradient")
#obj.addProperty(
#"App::PropertyBool", "EnforcePositiveMagnitude",
#"Flux", "Select calculation of positive magnitude")
obj.addProperty(
"App::PropertyBool",
"CalculateGrad",
"Flux",
"Select calculation of gradient"
)
"""
obj.addProperty(
"App::PropertyBool",
"CalculateGradAbs",
"Flux",
"Select calculation of abs of gradient"
)
obj.addProperty(
"App::PropertyBool",
"CalculateGradMagnitude",
"Flux",
"Select calculation of magnitude of gradient"
)
obj.addProperty(
"App::PropertyBool",
"EnforcePositiveMagnitude",
"Flux",
"Select calculation of positive magnitude"
)
"""
obj.Priority = 5

View File

@@ -63,46 +63,76 @@ class Proxy(equation.Proxy):
def __init__(self, obj):
super(Proxy, self).__init__(obj)
obj.addProperty(
"App::PropertyEnumeration", "LinearSolverType",
"Linear System", "Select type of solver for linear system")
"App::PropertyEnumeration",
"LinearSolverType",
"Linear System",
"Select type of solver for linear system"
)
obj.LinearSolverType = LINEAR_SOLVER
obj.LinearSolverType = "Iterative"
obj.addProperty(
"App::PropertyEnumeration", "LinearDirectMethod",
"Linear System", "Select type of solver for linear system")
"App::PropertyEnumeration",
"LinearDirectMethod",
"Linear System",
"Select type of solver for linear system"
)
obj.LinearDirectMethod = LINEAR_DIRECT
obj.addProperty(
"App::PropertyEnumeration", "LinearIterativeMethod",
"Linear System", "Select type of solver for linear system")
"App::PropertyEnumeration",
"LinearIterativeMethod",
"Linear System",
"Select type of solver for linear system"
)
obj.LinearIterativeMethod = LINEAR_ITERATIVE
obj.LinearIterativeMethod = "BiCGStab"
obj.addProperty(
"App::PropertyInteger", "BiCGstablDegree",
"Linear System", "Select type of solver for linear system")
"App::PropertyInteger",
"BiCGstablDegree",
"Linear System",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyEnumeration", "LinearPreconditioning",
"Linear System", "Select type of solver for linear system")
"App::PropertyEnumeration",
"LinearPreconditioning",
"Linear System",
"Select type of solver for linear system"
)
obj.LinearPreconditioning = LINEAR_PRECONDITIONING
obj.LinearPreconditioning = "ILU0"
obj.addProperty(
"App::PropertyFloat", "LinearTolerance",
"Linear System", "Select type of solver for linear system")
"App::PropertyFloat",
"LinearTolerance",
"Linear System",
"Select type of solver for linear system"
)
obj.LinearTolerance = 1e-8
obj.addProperty(
"App::PropertyInteger", "LinearIterations",
"Linear System", "Select type of solver for linear system")
"App::PropertyInteger",
"LinearIterations",
"Linear System",
"Select type of solver for linear system"
)
obj.LinearIterations = 500
obj.addProperty(
"App::PropertyFloat", "SteadyStateTolerance",
"Steady State", "Select type of solver for linear system")
"App::PropertyFloat",
"SteadyStateTolerance",
"Steady State",
"Select type of solver for linear system"
)
obj.SteadyStateTolerance = 1e-5
obj.addProperty(
"App::PropertyBool", "Stabilize",
"Base", "Select type of solver for linear system")
"App::PropertyBool",
"Stabilize",
"Base",
"Select type of solver for linear system"
)
obj.Stabilize = True
obj.addProperty(
"App::PropertyBool", "Bubbles",
"Base", "Select type of solver for linear system")
"App::PropertyBool",
"Bubbles",
"Base",
"Select type of solver for linear system"
)
obj.Bubbles = False

View File

@@ -41,20 +41,35 @@ class Proxy(linear.Proxy):
def __init__(self, obj):
super(Proxy, self).__init__(obj)
obj.addProperty(
"App::PropertyFloat", "NonlinearTolerance",
"Nonlinear System", "Select type of solver for linear system")
"App::PropertyFloat",
"NonlinearTolerance",
"Nonlinear System",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyInteger", "NonlinearIterations",
"Nonlinear System", "Select type of solver for linear system")
"App::PropertyInteger",
"NonlinearIterations",
"Nonlinear System",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyFloat", "RelaxationFactor",
"Nonlinear System", "Select type of solver for linear system")
"App::PropertyFloat",
"RelaxationFactor",
"Nonlinear System",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyInteger", "NonlinearNewtonAfterIterations",
"Nonlinear System", "Select type of solver for linear system")
"App::PropertyInteger",
"NonlinearNewtonAfterIterations",
"Nonlinear System",
"Select type of solver for linear system"
)
obj.addProperty(
"App::PropertyFloat", "NonlinearNewtonAfterTolerance",
"Nonlinear System", "Select type of solver for linear system")
"App::PropertyFloat",
"NonlinearNewtonAfterTolerance",
"Nonlinear System",
"Select type of solver for linear system"
)
obj.NonlinearTolerance = 1e-8
obj.NonlinearIterations = 500
obj.RelaxationFactor = 1