[FEM] use magnetization constraint for 2D

- uses the constraint for 2D magnetodynamics to perform e.g. Elmer's tutorial non. 15

- modify the Material manager to get rid of magnetization but keep the vectorial functionality because in future there will be support for e.g. birefringence materials etc.
This commit is contained in:
Uwe
2023-02-09 15:20:26 +01:00
parent f6abb77758
commit a2ffadcb59
7 changed files with 68 additions and 77 deletions

View File

@@ -682,15 +682,12 @@ def matProperWidget(parent=None, matproperty=None, Type="String", Value=None,
# for properties with an underscored number (vectorial values),
# we must strip the part after the first underscore to obtain the bound unit
# since in cardutils.py in def get_material_template
# the underscores were removed, we must first check for numbers
# and then for "Im" (denotes an imaginery value)
# the underscores were removed, we must check for numbers
import re
if re.search(r'\d', matproperty):
matpropertyNum = matproperty.rstrip('0123456789')
matproperty = matpropertyNum
if matproperty.find("Im") != -1:
matproperty = matproperty.split("Im")[0]
if hasattr(FreeCAD.Units, matproperty):
unit = getattr(FreeCAD.Units, matproperty)
quantity = FreeCAD.Units.Quantity(1, unit)