[pyfr] 44/88: Simplify how BC expressions are evaluated.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Nov 16 12:05:28 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 24ace85ee7810876ebf8036e666793c2f729ba68
Author: Freddie Witherden <freddie at witherden.org>
Date:   Wed Jun 1 15:03:28 2016 -0700

    Simplify how BC expressions are evaluated.
---
 pyfr/solvers/baseadvec/inters.py |  8 +++-----
 pyfr/solvers/euler/inters.py     |  6 ++----
 pyfr/solvers/navstokes/inters.py | 13 ++++---------
 3 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/pyfr/solvers/baseadvec/inters.py b/pyfr/solvers/baseadvec/inters.py
index 7425605..3407476 100644
--- a/pyfr/solvers/baseadvec/inters.py
+++ b/pyfr/solvers/baseadvec/inters.py
@@ -111,9 +111,7 @@ class BaseAdvectionBCInters(BaseInters):
             else:
                 exprs[k] = cfg.getexpr(sect, k, subs=subs)
 
-        if any('ploc' in ex for ex in exprs.values()):
-            plocpts = self._const_mat(lhs, 'get_ploc_for_inter')
-        else:
-            plocpts = None
+        if any('ploc' in ex for ex in exprs.values()) and not self._ploc:
+            self._ploc = self._const_mat(lhs, 'get_ploc_for_inter')
 
-        return exprs, plocpts
+        return exprs
diff --git a/pyfr/solvers/euler/inters.py b/pyfr/solvers/euler/inters.py
index 257d80e..89ab669 100644
--- a/pyfr/solvers/euler/inters.py
+++ b/pyfr/solvers/euler/inters.py
@@ -62,10 +62,9 @@ class EulerSupInflowBCInters(EulerBaseBCInters):
     def __init__(self, be, lhs, elemap, cfgsect, cfg):
         super().__init__(be, lhs, elemap, cfgsect, cfg)
 
-        tplc, self._ploc = self._exp_opts(
+        tplc = self._exp_opts(
             ['rho', 'p', 'u', 'v', 'w'][:self.ndims + 2], lhs
         )
-
         self._tpl_c.update(tplc)
 
 
@@ -75,10 +74,9 @@ class EulerCharRiemInvBCInters(EulerBaseBCInters):
     def __init__(self, be, lhs, elemap, cfgsect, cfg):
         super().__init__(be, lhs, elemap, cfgsect, cfg)
 
-        tplc, self._ploc = self._exp_opts(
+        tplc = self._exp_opts(
             ['rho', 'p', 'u', 'v', 'w'][:self.ndims + 2], lhs
         )
-
         self._tpl_c.update(tplc)
 
 
diff --git a/pyfr/solvers/navstokes/inters.py b/pyfr/solvers/navstokes/inters.py
index 7cad8ee..1f6fcc8 100644
--- a/pyfr/solvers/navstokes/inters.py
+++ b/pyfr/solvers/navstokes/inters.py
@@ -172,10 +172,9 @@ class NavierStokesCharRiemInvBCInters(NavierStokesBaseBCInters):
     def __init__(self, be, lhs, elemap, cfgsect, cfg):
         super().__init__(be, lhs, elemap, cfgsect, cfg)
 
-        tplc, self._ploc = self._exp_opts(
+        tplc = self._exp_opts(
             ['rho', 'p', 'u', 'v', 'w'][:self.ndims + 2], lhs
         )
-
         self._tpl_c.update(tplc)
 
 
@@ -186,10 +185,9 @@ class NavierStokesSupInflowBCInters(NavierStokesBaseBCInters):
     def __init__(self, be, lhs, elemap, cfgsect, cfg):
         super().__init__(be, lhs, elemap, cfgsect, cfg)
 
-        tplc, self._ploc = self._exp_opts(
+        tplc = self._exp_opts(
             ['rho', 'p', 'u', 'v', 'w'][:self.ndims + 2], lhs
         )
-
         self._tpl_c.update(tplc)
 
 
@@ -205,11 +203,10 @@ class NavierStokesSubInflowFrvBCInters(NavierStokesBaseBCInters):
     def __init__(self, be, lhs, elemap, cfgsect, cfg):
         super().__init__(be, lhs, elemap, cfgsect, cfg)
 
-        tplc, self._ploc = self._exp_opts(
+        tplc = self._exp_opts(
             ['rho', 'u', 'v', 'w'][:self.ndims + 1], lhs,
             default={'u': 0, 'v': 0, 'w': 0}
         )
-
         self._tpl_c.update(tplc)
 
 
@@ -247,6 +244,4 @@ class NavierStokesSubOutflowBCInters(NavierStokesBaseBCInters):
     def __init__(self, be, lhs, elemap, cfgsect, cfg):
         super().__init__(be, lhs, elemap, cfgsect, cfg)
 
-        tplc, self._ploc = self._exp_opts(['p'], lhs)
-        self._tpl_c.update(tplc)
-
+        self._tpl_c.update(self._exp_opts(['p'], lhs))

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