From fc9c8a4fee235d8019069ab589d5b1c11e1268e2 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Tue, 18 Feb 2020 05:19:38 +0100 Subject: [PATCH] FEM: elmer writer, fix by HoWil --- src/Mod/Fem/femsolver/elmer/writer.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Mod/Fem/femsolver/elmer/writer.py b/src/Mod/Fem/femsolver/elmer/writer.py index 66e67781febb..a5370f99f46a 100644 --- a/src/Mod/Fem/femsolver/elmer/writer.py +++ b/src/Mod/Fem/femsolver/elmer/writer.py @@ -324,6 +324,7 @@ def _getElectrostaticSolver(self, equation): # s["Calculate Electric Flux"] = equation.CalculateElectricFlux s["Calculate Electric Energy"] = equation.CalculateElectricEnergy s["Calculate Surface Charge"] = equation.CalculateSurfaceCharge + s["Calculate Capacitance Matrix"] = equation.CalculateCapacitanceMatrix s["Displace mesh"] = False s["Exec Solver"] = "Always" s["Stabilize"] = equation.Stabilize @@ -353,10 +354,11 @@ def _handleElectrostaticBndConditions(self): for obj in self._getMember("Fem::ConstraintElectrostaticPotential"): if obj.References: for name in obj.References[0][1]: - if hasattr(obj, "Potential"): - # https://forum.freecadweb.org/viewtopic.php?f=18&t=41488&start=10#p369454 - potential = getFromUi(obj.Potential, "V", "M*L^2/(T^3 * I)") - self._boundary(name, "Potential", potential) + # https://forum.freecadweb.org/viewtopic.php?f=18&t=41488&start=10#p369454 ff + if obj.PotentialEnabled: + if hasattr(obj, 'Potential'): + potential = getFromUi(obj.Potential, "V", "M*L^2/(T^3 * I)") + self._boundary(name, "Potential", potential) if obj.PotentialConstant: self._boundary(name, "Potential Constant", True) self._handled(obj)