[FEM] Elmer: add support for 2D magnetodynamics
- adds the corresponding Elmer equation (it is now possible to do Elmer's tutorial example no. 16)
This commit is contained in:
@@ -84,14 +84,14 @@ class TestObjectCreate(unittest.TestCase):
|
||||
# thus they are not added to the analysis group ATM
|
||||
# https://forum.freecadweb.org/viewtopic.php?t=25283
|
||||
# thus they should not be counted
|
||||
# solver children: equations --> 6
|
||||
# solver children: equations --> 7
|
||||
# gmsh mesh children: group, region, boundary layer --> 3
|
||||
# resule children: mesh result --> 1
|
||||
# post pipeline children: region, scalar, cut, wrap --> 4
|
||||
# analysis itself is not in analysis group --> 1
|
||||
# thus: -14
|
||||
# thus: -16
|
||||
|
||||
self.assertEqual(len(doc.Analysis.Group), count_defmake - 15)
|
||||
self.assertEqual(len(doc.Analysis.Group), count_defmake - 16)
|
||||
self.assertEqual(len(doc.Objects), count_defmake)
|
||||
|
||||
fcc_print("doc objects count: {}, method: {}".format(
|
||||
@@ -366,6 +366,10 @@ class TestObjectType(unittest.TestCase):
|
||||
"Fem::EquationElmerHeat",
|
||||
type_of_obj(ObjectsFem.makeEquationHeat(doc, solverelmer))
|
||||
)
|
||||
self.assertEqual(
|
||||
"Fem::EquationElmerMagnetodynamic2D",
|
||||
type_of_obj(ObjectsFem.makeEquationMagnetodynamic2D(doc, solverelmer))
|
||||
)
|
||||
|
||||
fcc_print("doc objects count: {}, method: {}".format(
|
||||
len(doc.Objects),
|
||||
@@ -597,6 +601,10 @@ class TestObjectType(unittest.TestCase):
|
||||
ObjectsFem.makeEquationHeat(doc, solverelmer),
|
||||
"Fem::EquationElmerHeat"
|
||||
))
|
||||
self.assertTrue(is_of_type(
|
||||
ObjectsFem.makeEquationMagnetodynamic2D(doc, solverelmer),
|
||||
"Fem::EquationElmerMagnetodynamic2D"
|
||||
))
|
||||
|
||||
fcc_print("doc objects count: {}, method: {}".format(
|
||||
len(doc.Objects),
|
||||
@@ -1422,6 +1430,21 @@ class TestObjectType(unittest.TestCase):
|
||||
"Fem::EquationElmerHeat"
|
||||
))
|
||||
|
||||
# EquationElmerMagnetodynamic2D
|
||||
equation_magnetodynamic2D = ObjectsFem.makeEquationMagnetodynamic2D(doc, solver_elmer)
|
||||
self.assertTrue(is_derived_from(
|
||||
equation_magnetodynamic2D,
|
||||
"App::DocumentObject"
|
||||
))
|
||||
self.assertTrue(is_derived_from(
|
||||
equation_magnetodynamic2D,
|
||||
"App::FeaturePython"
|
||||
))
|
||||
self.assertTrue(is_derived_from(
|
||||
equation_magnetodynamic2D,
|
||||
"Fem::EquationElmerMagnetodynamic2D"
|
||||
))
|
||||
|
||||
fcc_print("doc objects count: {}, method: {}".format(
|
||||
len(doc.Objects),
|
||||
sys._getframe().f_code.co_name)
|
||||
@@ -1706,6 +1729,12 @@ class TestObjectType(unittest.TestCase):
|
||||
solverelmer
|
||||
).isDerivedFrom("App::FeaturePython")
|
||||
)
|
||||
self.assertTrue(
|
||||
ObjectsFem.makeEquationMagnetodynamic2D(
|
||||
doc,
|
||||
solverelmer
|
||||
).isDerivedFrom("App::FeaturePython")
|
||||
)
|
||||
|
||||
fcc_print("doc objects count: {}, method: {}".format(
|
||||
len(doc.Objects),
|
||||
@@ -1786,6 +1815,7 @@ def create_all_fem_objects_doc(
|
||||
ObjectsFem.makeEquationFlow(doc, sol)
|
||||
ObjectsFem.makeEquationFlux(doc, sol)
|
||||
ObjectsFem.makeEquationHeat(doc, sol)
|
||||
ObjectsFem.makeEquationMagnetodynamic2D(doc, sol)
|
||||
|
||||
doc.recompute()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user