[pyfr] 28/88: Allow the residual plugin to function when nsteps = 1.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Nov 16 12:05:27 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 239a4bad9c9ba249625d7a77da084df38a5b7d4b
Author: Freddie Witherden <freddie at witherden.org>
Date:   Thu Apr 28 07:39:35 2016 -0700

    Allow the residual plugin to function when nsteps = 1.
---
 pyfr/plugins/residual.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/pyfr/plugins/residual.py b/pyfr/plugins/residual.py
index 7b5c49c..0ca64b7 100644
--- a/pyfr/plugins/residual.py
+++ b/pyfr/plugins/residual.py
@@ -25,13 +25,12 @@ class ResidualPlugin(BasePlugin):
             # Open
             self.outf = init_csv(self.cfg, cfgsect, ','.join(header))
 
+        # Call ourself in case output is needed after the first step
+        self(intg)
+
     def __call__(self, intg):
-        # If an output is due next step
-        if (intg.nacptsteps + 1) % self.nsteps == 0:
-            self._prev = [s.copy() for s in intg.soln]
-            self._tprev = intg.tcurr
         # If an output is due this step
-        elif intg.nacptsteps % self.nsteps == 0:
+        if intg.nacptsteps % self.nsteps == 0 and intg.nacptsteps:
             # MPI info
             comm, rank, root = get_comm_rank_root()
 
@@ -63,3 +62,8 @@ class ResidualPlugin(BasePlugin):
                 self.outf.flush()
 
             del self._prev, self._tprev
+
+        # If an output is due next step
+        if (intg.nacptsteps + 1) % self.nsteps == 0:
+            self._prev = [s.copy() for s in intg.soln]
+            self._tprev = intg.tcurr

-- 
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