From b5a34817dbb38524b9598082de020b8cd2af1980 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sat, 6 Aug 2022 16:01:55 +0200 Subject: [PATCH] [FEM] Elmer: fix mistake with transient solving - there is proper info, just in another Elmer manual. This unveiled my mistake - the timestepping parameters are a list --- src/Mod/Fem/femsolver/elmer/solver.py | 17 ++++++----------- src/Mod/Fem/femsolver/elmer/writer.py | 14 ++++++++------ 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/Mod/Fem/femsolver/elmer/solver.py b/src/Mod/Fem/femsolver/elmer/solver.py index 1d874ff706..55c9b0eb86 100644 --- a/src/Mod/Fem/femsolver/elmer/solver.py +++ b/src/Mod/Fem/femsolver/elmer/solver.py @@ -83,26 +83,21 @@ class Proxy(solverbase.Proxy): obj.BDFOrder = (2, 1, 5, 1) obj.addProperty( - "App::PropertyIntegerConstraint", + "App::PropertyIntegerList", "TimestepIntervals", "Timestepping", - "Maximum optimization rounds if 'Simulation Type'\nis either 'Scanning' or 'Transient'" + "List of maximum optimization rounds if 'Simulation Type'\nis either 'Scanning' or 'Transient'" ) obj.addProperty( - "App::PropertyFloatConstraint", + "App::PropertyFloatList", "TimestepSizes", "Timestepping", - "Time step of optimization if 'Simulation Type'\nis either 'Scanning' or 'Transient'" + "List of time steps of optimization if 'Simulation Type'\nis either 'Scanning' or 'Transient'" ) # there is no universal default, it all depends on the analysis, however # we have to set something and set 10 seconds in steps of 0.1s - # since the Emler manual lacks proper info, here a link to a forum thread: - # http://www.elmerfem.org/forum/viewtopic.php?p=18057&sid=73169c4ec544fd7f181f85178bbc8ffe#p18057 - # ----- - # Set maximum to 1e8 because on Win the max int is always 32bit (4.29e9) - # for TimestepSizes also 1e8 just to set something - obj.TimestepIntervals = (100, 1, int(1e8), 10) - obj.TimestepSizes = (0.1, 1e-8, 1e8, 0.1) + obj.TimestepIntervals = [100] + obj.TimestepSizes = [0.1] obj.addProperty( "App::PropertyEnumeration", diff --git a/src/Mod/Fem/femsolver/elmer/writer.py b/src/Mod/Fem/femsolver/elmer/writer.py index b24a6a2e49..7fe8478424 100644 --- a/src/Mod/Fem/femsolver/elmer/writer.py +++ b/src/Mod/Fem/femsolver/elmer/writer.py @@ -341,6 +341,8 @@ class Writer(object): ): self._simulation("Timestep Intervals", self.solver.TimestepIntervals) self._simulation("Timestep Sizes", self.solver.TimestepSizes) + # Output Intervals must be equal to Timestep Intervals + self._simulation("Output Intervals", self.solver.TimestepIntervals) if hasHeat: self._simulation("Timestepping Method", "BDF") self._simulation("Use Mesh Names", True) @@ -366,26 +368,26 @@ class Writer(object): solver.SimulationType = "Steady State" if not hasattr(self.solver, "TimestepIntervals"): solver.addProperty( - "App::PropertyIntegerConstraint", + "App::PropertyIntegerList", "TimestepIntervals", "Timestepping", ( - "Maximum optimization rounds if 'Simulation Type'\n" + "List of maximum optimization rounds if 'Simulation Type'\n" "is either 'Scanning' or 'Transient'" ) ) - solver.TimestepIntervals = (100, 1, int(1e8), 10) + solver.TimestepIntervals = [100] if not hasattr(self.solver, "TimestepSizes"): solver.addProperty( - "App::PropertyFloatConstraint", + "App::PropertyFloatList", "TimestepSizes", "Timestepping", ( - "Time step of optimization if 'Simulation Type'\n" + "List of time steps of optimization if 'Simulation Type'\n" "is either 'Scanning' or 'Transient'" ) ) - solver.TimestepSizes = (0.1, 1e-8, 1e8, 0.1) + solver.TimestepSizes = [0.1] def _handleHeat(self): activeIn = []