[pyfr] 78/88: Include the number of accepted/rejected steps in the stats file.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Nov 16 12:05:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository pyfr.

commit f6d68207178cfdd0f56a714a2da06a5c0468ed5c
Author: Freddie Witherden <freddie at witherden.org>
Date:   Tue Sep 13 16:46:17 2016 -0700

    Include the number of accepted/rejected steps in the stats file.
---
 pyfr/integrators/base.py                | 9 +++++++++
 pyfr/integrators/dual/controllers.py    | 4 ----
 pyfr/integrators/dual/pseudosteppers.py | 2 +-
 pyfr/integrators/std/controllers.py     | 4 ----
 pyfr/integrators/std/steppers.py        | 2 +-
 5 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/pyfr/integrators/base.py b/pyfr/integrators/base.py
index 6be56f1..71ae3ce 100644
--- a/pyfr/integrators/base.py
+++ b/pyfr/integrators/base.py
@@ -198,6 +198,10 @@ class BaseIntegrator(object, metaclass=ABCMeta):
         for t in self.tlist:
             self.advance_to(t)
 
+    @property
+    def nsteps(self):
+        return self.nacptsteps + self.nrjctsteps
+
     def collect_stats(self, stats):
         wtime = time.time() - self._wstart
 
@@ -209,6 +213,11 @@ class BaseIntegrator(object, metaclass=ABCMeta):
         stats.set('solver-time-integrator', 'tcurr', self.tcurr)
         stats.set('solver-time-integrator', 'wall-time', wtime)
 
+        # Step counts
+        stats.set('solver-time-integrator', 'nsteps', self.nsteps)
+        stats.set('solver-time-integrator', 'nacptsteps', self.nacptsteps)
+        stats.set('solver-time-integrator', 'nrjctsteps', self.nrjctsteps)
+
     @property
     def cfgmeta(self):
         cfg = self.cfg.tostr()
diff --git a/pyfr/integrators/dual/controllers.py b/pyfr/integrators/dual/controllers.py
index ea21e0f..8b19c75 100644
--- a/pyfr/integrators/dual/controllers.py
+++ b/pyfr/integrators/dual/controllers.py
@@ -34,10 +34,6 @@ class BaseDualController(BaseDualIntegrator):
         # Fire off any event handlers
         self.completed_step_handlers(self)
 
-    @property
-    def nsteps(self):
-        return self.nacptsteps + self.nrjctsteps
-
 
 class DualNoneController(BaseDualController):
     controller_name = 'none'
diff --git a/pyfr/integrators/dual/pseudosteppers.py b/pyfr/integrators/dual/pseudosteppers.py
index 03861d5..6b05eba 100644
--- a/pyfr/integrators/dual/pseudosteppers.py
+++ b/pyfr/integrators/dual/pseudosteppers.py
@@ -7,7 +7,7 @@ class BaseDualPseudoStepper(BaseDualIntegrator):
     def collect_stats(self, stats):
         super().collect_stats(stats)
 
-        stats.set('solver-time-integrator', 'nsteps', self.nsteps)
+        # Total number of RHS evaluations
         stats.set('solver-time-integrator', 'nfevals', self._stepper_nfevals)
 
     def _add_with_dts(self, *args, c):
diff --git a/pyfr/integrators/std/controllers.py b/pyfr/integrators/std/controllers.py
index 48b96d1..5b7027d 100644
--- a/pyfr/integrators/std/controllers.py
+++ b/pyfr/integrators/std/controllers.py
@@ -48,10 +48,6 @@ class BaseStdController(BaseStdIntegrator):
 
         self._idxcurr = idxold
 
-    @property
-    def nsteps(self):
-        return self.nacptsteps + self.nrjctsteps
-
 
 class StdNoneController(BaseStdController):
     controller_name = 'none'
diff --git a/pyfr/integrators/std/steppers.py b/pyfr/integrators/std/steppers.py
index 160c44c..8774703 100644
--- a/pyfr/integrators/std/steppers.py
+++ b/pyfr/integrators/std/steppers.py
@@ -13,7 +13,7 @@ class BaseStdStepper(BaseStdIntegrator):
     def collect_stats(self, stats):
         super().collect_stats(stats)
 
-        stats.set('solver-time-integrator', 'nsteps', self.nsteps)
+        # Total number of RHS evaluations
         stats.set('solver-time-integrator', 'nfevals', self._stepper_nfevals)
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyfr.git



More information about the debian-science-commits mailing list