[pyfr] 16/88: Refactor the naming conventions for artificial viscosity.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Nov 16 12:05:25 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 a84ae841e52b0729f8a5a62c93bf4d82ded1eb68
Author: Freddie Witherden <freddie at witherden.org>
Date:   Thu Apr 21 11:32:39 2016 -0700

    Refactor the naming conventions for artificial viscosity.
    
    We now make consistent use of the abbreviation artvisc.  The
    parameter max-amu in the configuration file has been
    changed accordingly to max-artvisc.
---
 doc/src/user_guide.rst                             |   4 +-
 pyfr/solvers/baseadvec/inters.py                   |  18 ++--
 pyfr/solvers/baseadvecdiff/elements.py             | 109 ++++++++++-----------
 pyfr/solvers/baseadvecdiff/inters.py               |  73 +++++++-------
 .../solvers/baseadvecdiff/kernels/shocksensor.mako |   8 +-
 pyfr/solvers/baseadvecdiff/system.py               |   8 +-
 pyfr/solvers/euler/inters.py                       |   6 +-
 pyfr/solvers/navstokes/elements.py                 |   4 +-
 pyfr/solvers/navstokes/inters.py                   |  24 ++---
 pyfr/solvers/navstokes/kernels/bccflux.mako        |   4 +-
 pyfr/solvers/navstokes/kernels/bcs/ghost.mako      |   4 +-
 .../navstokes/kernels/bcs/slp-adia-wall.mako       |   2 +-
 pyfr/solvers/navstokes/kernels/intcflux.mako       |   8 +-
 pyfr/solvers/navstokes/kernels/mpicflux.mako       |   8 +-
 pyfr/solvers/navstokes/kernels/tflux.mako          |   4 +-
 15 files changed, 143 insertions(+), 141 deletions(-)

diff --git a/doc/src/user_guide.rst b/doc/src/user_guide.rst
index 9478317..f250613 100644
--- a/doc/src/user_guide.rst
+++ b/doc/src/user_guide.rst
@@ -719,7 +719,7 @@ Example::
 
 Parameterises artificial viscosity for shock capturing with
 
-1. ``max-amu`` --- maximum artificial viscosity:
+1. ``max-artvisc`` --- maximum artificial viscosity:
 
     *float*
 
@@ -734,7 +734,7 @@ Parameterises artificial viscosity for shock capturing with
 Example::
 
     [solver-artificial-viscosity]
-    max-amu = 0.01
+    max-artvisc = 0.01
     s0 = 0.01
     kappa = 5.0
 
diff --git a/pyfr/solvers/baseadvec/inters.py b/pyfr/solvers/baseadvec/inters.py
index 7425605..54d1e36 100644
--- a/pyfr/solvers/baseadvec/inters.py
+++ b/pyfr/solvers/baseadvec/inters.py
@@ -16,8 +16,8 @@ class BaseAdvectionIntInters(BaseInters):
         self._gen_perm(lhs, rhs)
 
         # Generate the left and right hand side view matrices
-        self._scal0_lhs = self._scal_view(lhs, 'get_scal_fpts_for_inter')
-        self._scal0_rhs = self._scal_view(rhs, 'get_scal_fpts_for_inter')
+        self._scal_lhs = self._scal_view(lhs, 'get_scal_fpts_for_inter')
+        self._scal_rhs = self._scal_view(rhs, 'get_scal_fpts_for_inter')
 
         # Generate the constant matrices
         self._mag_pnorm_lhs = const_mat(lhs, 'get_mag_pnorms_for_inter')
@@ -42,24 +42,24 @@ class BaseAdvectionMPIInters(BaseInters):
         const_mat = self._const_mat
 
         # Generate the left hand view matrix and its dual
-        self._scal0_lhs = self._scal_xchg_view(lhs, 'get_scal_fpts_for_inter')
-        self._scal0_rhs = be.xchg_matrix_for_view(self._scal0_lhs)
+        self._scal_lhs = self._scal_xchg_view(lhs, 'get_scal_fpts_for_inter')
+        self._scal_rhs = be.xchg_matrix_for_view(self._scal_lhs)
 
         self._mag_pnorm_lhs = const_mat(lhs, 'get_mag_pnorms_for_inter')
         self._norm_pnorm_lhs = const_mat(lhs, 'get_norm_pnorms_for_inter')
 
         # Kernels
         self.kernels['scal_fpts_pack'] = lambda: be.kernel(
-            'pack', self._scal0_lhs
+            'pack', self._scal_lhs
         )
         self.kernels['scal_fpts_send'] = lambda: be.kernel(
-            'send_pack', self._scal0_lhs, self._rhsrank, self.MPI_TAG
+            'send_pack', self._scal_lhs, self._rhsrank, self.MPI_TAG
         )
         self.kernels['scal_fpts_recv'] = lambda: be.kernel(
-            'recv_pack', self._scal0_rhs, self._rhsrank, self.MPI_TAG
+            'recv_pack', self._scal_rhs, self._rhsrank, self.MPI_TAG
         )
         self.kernels['scal_fpts_unpack'] = lambda: be.kernel(
-            'unpack', self._scal0_rhs
+            'unpack', self._scal_rhs
         )
 
 
@@ -78,7 +78,7 @@ class BaseAdvectionBCInters(BaseInters):
         self._perm = get_opt_view_perm(lhs, 'get_scal_fpts_for_inter', elemap)
 
         # LHS view and constant matrices
-        self._scal0_lhs = self._scal_view(lhs, 'get_scal_fpts_for_inter')
+        self._scal_lhs = self._scal_view(lhs, 'get_scal_fpts_for_inter')
         self._mag_pnorm_lhs = const_mat(lhs, 'get_mag_pnorms_for_inter')
         self._norm_pnorm_lhs = const_mat(lhs, 'get_norm_pnorms_for_inter')
         self._ploc = None
diff --git a/pyfr/solvers/baseadvecdiff/elements.py b/pyfr/solvers/baseadvecdiff/elements.py
index 11c881d..b57b7b3 100644
--- a/pyfr/solvers/baseadvecdiff/elements.py
+++ b/pyfr/solvers/baseadvecdiff/elements.py
@@ -24,59 +24,6 @@ class BaseAdvectionDiffusionElements(BaseAdvectionElements):
 
         return bufs
 
-    def _set_backend_art_visc(self, backend):
-        nvars, neles = self.nvars, self.neles
-        nupts, nfpts = self.nupts, self.nfpts
-        tags = {'align'}
-
-        # Register pointwise kernels
-        backend.pointwise.register(
-            'pyfr.solvers.baseadvecdiff.kernels.shockvar'
-        )
-        backend.pointwise.register(
-            'pyfr.solvers.baseadvecdiff.kernels.shocksensor'
-        )
-
-        # Obtain the scalar variable to be used for shock sensing
-        shockvar = self.convarmap[self.ndims].index(self.shockvar)
-
-        # Common template arguments
-        tplargs = dict(
-            nvars=nvars, nupts=nupts, nfpts=nfpts,
-            c=self.cfg.items_as('solver-artificial-viscosity', float),
-            order=self.basis.order, ubdegs=self.basis.ubasis.degrees,
-            shockvar=shockvar
-        )
-
-        # Allocate space for the artificial viscosity
-        self.avis = backend.matrix((1, neles), extent='avis', tags=tags)
-
-        # Scratch space
-        tmp_upts = backend.matrix((2*nupts, 1, neles),
-                                  aliases=self._vect_upts, tags=tags)
-        svar_upts = tmp_upts.rslice(0, nupts)
-        modal_svar_upts = tmp_upts.rslice(nupts, 2*nupts)
-
-
-        # Extract the scalar variable to be used for shock sensing
-        self.kernels['shockvar'] = lambda: backend.kernel(
-            'shockvar', tplargs=tplargs, dims=[nupts, neles],
-            u=self.scal_upts_inb, s=svar_upts
-        )
-
-        # Obtain the modal coefficients
-        rcpvdm = np.linalg.inv(self.basis.ubasis.vdm.T)
-        rcpvdm = backend.const_matrix(rcpvdm, tags={'align'})
-        self.kernels['shockvar_modal'] = lambda: backend.kernel(
-            'mul', rcpvdm, svar_upts, out=modal_svar_upts
-        )
-
-        # Apply the sensor to estimate the required artificial viscosity
-        self.kernels['shocksensor'] = lambda: backend.kernel(
-            'shocksensor', tplargs=tplargs, dims=[neles],
-            s=modal_svar_upts, amu=self.avis
-        )
-
     def set_backend(self, backend, nscal_upts):
         super().set_backend(backend, nscal_upts)
 
@@ -131,12 +78,60 @@ class BaseAdvectionDiffusionElements(BaseAdvectionElements):
         # Shock capturing
         shock_capturing = self.cfg.get('solver', 'shock-capturing', 'none')
         if shock_capturing == 'artificial-viscosity':
-            self._set_backend_art_visc(backend)
+            tags = {'align'}
+
+            # Register pointwise kernels
+            backend.pointwise.register(
+                'pyfr.solvers.baseadvecdiff.kernels.shockvar'
+            )
+            backend.pointwise.register(
+                'pyfr.solvers.baseadvecdiff.kernels.shocksensor'
+            )
+
+            # Obtain the scalar variable to be used for shock sensing
+            shockvar = self.convarmap[self.ndims].index(self.shockvar)
+
+            # Common template arguments
+            tplargs = dict(
+                nvars=self.nvars, nupts=self.nupts, shockvar=shockvar,
+                c=self.cfg.items_as('solver-artificial-viscosity', float),
+                order=self.basis.order, ubdegs=self.basis.ubasis.degrees,
+            )
+
+            # Allocate space for the artificial viscosity
+            self.artvisc = backend.matrix((1, self.neles), extent='artvisc',
+                                          tags=tags)
+
+            # Scratch space
+            tmp_upts = backend.matrix((2*self.nupts, 1, self.neles),
+                                      aliases=self._vect_upts, tags=tags)
+            svar_upts = tmp_upts.rslice(0, self.nupts)
+            modal_svar_upts = tmp_upts.rslice(self.nupts, 2*self.nupts)
+
+
+            # Extract the scalar variable to be used for shock sensing
+            self.kernels['shockvar'] = lambda: backend.kernel(
+                'shockvar', tplargs=tplargs, dims=[self.nupts, self.neles],
+                u=self.scal_upts_inb, s=svar_upts
+            )
+
+            # Obtain the modal coefficients
+            rcpvdm = np.linalg.inv(self.basis.ubasis.vdm.T)
+            rcpvdm = backend.const_matrix(rcpvdm, tags={'align'})
+            self.kernels['shockvar_modal'] = lambda: backend.kernel(
+                'mul', rcpvdm, svar_upts, out=modal_svar_upts
+            )
+
+            # Apply the sensor to estimate the required artificial viscosity
+            self.kernels['shocksensor'] = lambda: backend.kernel(
+                'shocksensor', tplargs=tplargs, dims=[self.neles],
+                s=modal_svar_upts, artvisc=self.artvisc
+            )
         elif shock_capturing == 'none':
-            self.avis = None
+            self.artvisc = None
         else:
             raise ValueError('Invalid shock capturing scheme')
 
-    def get_avis_fpts_for_inter(self, eidx, fidx):
+    def get_artvisc_fpts_for_inter(self, eidx, fidx):
         nfp = self.nfacefpts[fidx]
-        return (self.avis.mid,)*nfp, ((0, eidx),)*nfp
+        return (self.artvisc.mid,)*nfp, ((0, eidx),)*nfp
diff --git a/pyfr/solvers/baseadvecdiff/inters.py b/pyfr/solvers/baseadvecdiff/inters.py
index f84ac2f..516cddb 100644
--- a/pyfr/solvers/baseadvecdiff/inters.py
+++ b/pyfr/solvers/baseadvecdiff/inters.py
@@ -12,15 +12,15 @@ class BaseAdvectionDiffusionIntInters(BaseAdvectionIntInters):
         super().__init__(be, lhs, rhs, elemap, cfg)
 
         # Generate the additional view matrices
-        self._vect0_lhs = self._vect_view(lhs, 'get_vect_fpts_for_inter')
-        self._vect0_rhs = self._vect_view(rhs, 'get_vect_fpts_for_inter')
+        self._vect_lhs = self._vect_view(lhs, 'get_vect_fpts_for_inter')
+        self._vect_rhs = self._vect_view(rhs, 'get_vect_fpts_for_inter')
 
         # Generate the additional view matrices for artificial viscosity
         if cfg.get('solver', 'shock-capturing') == 'artificial-viscosity':
-            self._avis0_lhs = self._view(lhs, 'get_avis_fpts_for_inter')
-            self._avis0_rhs = self._view(rhs, 'get_avis_fpts_for_inter')
+            self._artvisc_lhs = self._view(lhs, 'get_artvisc_fpts_for_inter')
+            self._artvisc_rhs = self._view(rhs, 'get_artvisc_fpts_for_inter')
         else:
-            self._avis0_lhs = self._avis0_rhs = None
+            self._artvisc_lhs = self._artvisc_rhs = None
 
         # Additional kernel constants
         self._tpl_c.update(cfg.items_as('solver-interfaces', float))
@@ -44,8 +44,8 @@ class BaseAdvectionDiffusionMPIInters(BaseAdvectionMPIInters):
         rhsprank = rallocs.mprankmap[rhsrank]
 
         # Generate second set of view matrices
-        self._vect0_lhs = self._vect_xchg_view(lhs, 'get_vect_fpts_for_inter')
-        self._vect0_rhs = be.xchg_matrix_for_view(self._vect0_lhs)
+        self._vect_lhs = self._vect_xchg_view(lhs, 'get_vect_fpts_for_inter')
+        self._vect_rhs = be.xchg_matrix_for_view(self._vect_lhs)
 
         # Additional kernel constants
         self._tpl_c.update(cfg.items_as('solver-interfaces', float))
@@ -59,60 +59,67 @@ class BaseAdvectionDiffusionMPIInters(BaseAdvectionMPIInters):
         # of the two partitions.
         self._tpl_c['ldg-beta'] *= 1.0 if lhsprank > rhsprank else -1.0
 
+        # Null kernel generators
+        null_mpi_kern = lambda: NullMPIKernel()
+        null_comp_kern = lambda: NullComputeKernel()
+
         # If we need to send our gradients to the RHS
         if self._tpl_c['ldg-beta'] != -0.5:
             self.kernels['vect_fpts_pack'] = lambda: be.kernel(
-                'pack', self._vect0_lhs
+                'pack', self._vect_lhs
             )
             self.kernels['vect_fpts_send'] = lambda: be.kernel(
-                'send_pack', self._vect0_lhs, self._rhsrank, self.MPI_TAG
+                'send_pack', self._vect_lhs, self._rhsrank, self.MPI_TAG
             )
         else:
-            self.kernels['vect_fpts_pack'] = lambda: NullComputeKernel()
-            self.kernels['vect_fpts_send'] = lambda: NullMPIKernel()
+            self.kernels['vect_fpts_pack'] = null_comp_kern
+            self.kernels['vect_fpts_send'] = null_mpi_kern
 
         # If we need to recv gradients from the RHS
         if self._tpl_c['ldg-beta'] != 0.5:
             self.kernels['vect_fpts_recv'] = lambda: be.kernel(
-                'recv_pack', self._vect0_rhs, self._rhsrank, self.MPI_TAG
+                'recv_pack', self._vect_rhs, self._rhsrank, self.MPI_TAG
             )
             self.kernels['vect_fpts_unpack'] = lambda: be.kernel(
-                'unpack', self._vect0_rhs
+                'unpack', self._vect_rhs
             )
         else:
-            self.kernels['vect_fpts_recv'] = lambda: NullMPIKernel()
-            self.kernels['vect_fpts_unpack'] = lambda: NullComputeKernel()
+            self.kernels['vect_fpts_recv'] = null_mpi_kern
+            self.kernels['vect_fpts_unpack'] = null_comp_kern
 
         # Generate the additional kernels/views for artificial viscosity
         if cfg.get('solver', 'shock-capturing') == 'artificial-viscosity':
-            self._avis0_lhs = self._xchg_view(lhs, 'get_avis_fpts_for_inter')
-            self._avis0_rhs = be.xchg_matrix_for_view(self._avis0_lhs)
+            self._artvisc_lhs = self._xchg_view(lhs,
+                                                'get_artvisc_fpts_for_inter')
+            self._artvisc_rhs = be.xchg_matrix_for_view(self._artvisc_lhs)
 
             # If we need to send our artificial viscosity to the RHS
             if self._tpl_c['ldg-beta'] != -0.5:
-                self.kernels['avis_fpts_pack'] = lambda: be.kernel(
-                    'pack', self._avis0_lhs
+                self.kernels['artvisc_fpts_pack'] = lambda: be.kernel(
+                    'pack', self._artvisc_lhs
                 )
-                self.kernels['avis_fpts_send'] = lambda: be.kernel(
-                    'send_pack', self._avis0_lhs, self._rhsrank, self.MPI_TAG
+                self.kernels['artvisc_fpts_send'] = lambda: be.kernel(
+                    'send_pack', self._artvisc_lhs, self._rhsrank,
+                    self.MPI_TAG
                 )
             else:
-                self.kernels['avis_fpts_pack'] = lambda: NullComputeKernel()
-                self.kernels['avis_fpts_send'] = lambda: NullMPIKernel()
+                self.kernels['artvisc_fpts_pack'] = null_comp_kern
+                self.kernels['artvisc_fpts_send'] = null_mpi_kern
 
             # If we need to recv artificial viscosity from the RHS
             if self._tpl_c['ldg-beta'] != 0.5:
-                self.kernels['avis_fpts_recv'] = lambda: be.kernel(
-                    'recv_pack', self._avis0_rhs, self._rhsrank, self.MPI_TAG
+                self.kernels['artvisc_fpts_recv'] = lambda: be.kernel(
+                    'recv_pack', self._artvisc_rhs, self._rhsrank,
+                    self.MPI_TAG
                 )
-                self.kernels['avis_fpts_unpack'] = lambda: be.kernel(
-                    'unpack', self._avis0_rhs
+                self.kernels['artvisc_fpts_unpack'] = lambda: be.kernel(
+                    'unpack', self._artvisc_rhs
                 )
             else:
-                self.kernels['avis_fpts_recv'] = lambda: NullMPIKernel()
-                self.kernels['avis_fpts_unpack'] = lambda: NullComputeKernel()
+                self.kernels['artvisc_fpts_recv'] = null_mpi_kern
+                self.kernels['artvisc_fpts_unpack'] = null_comp_kern
         else:
-            self._avis0_lhs = self._avis0_rhs = None
+            self._artvisc_lhs = self._artvisc_rhs = None
 
 
 class BaseAdvectionDiffusionBCInters(BaseAdvectionBCInters):
@@ -120,13 +127,13 @@ class BaseAdvectionDiffusionBCInters(BaseAdvectionBCInters):
         super().__init__(be, lhs, elemap, cfgsect, cfg)
 
         # Additional view matrices
-        self._vect0_lhs = self._vect_view(lhs, 'get_vect_fpts_for_inter')
+        self._vect_lhs = self._vect_view(lhs, 'get_vect_fpts_for_inter')
 
         # Additional kernel constants
         self._tpl_c.update(cfg.items_as('solver-interfaces', float))
 
         # Generate the additional view matrices for artificial viscosity
         if cfg.get('solver', 'shock-capturing') == 'artificial-viscosity':
-            self._avis0_lhs = self._view(lhs, 'get_avis_fpts_for_inter')
+            self._artvisc_lhs = self._view(lhs, 'get_artvisc_fpts_for_inter')
         else:
-            self._avis0_lhs = None
+            self._artvisc_lhs = None
diff --git a/pyfr/solvers/baseadvecdiff/kernels/shocksensor.mako b/pyfr/solvers/baseadvecdiff/kernels/shocksensor.mako
index 8a9aefb..c677f63 100644
--- a/pyfr/solvers/baseadvecdiff/kernels/shocksensor.mako
+++ b/pyfr/solvers/baseadvecdiff/kernels/shocksensor.mako
@@ -4,7 +4,7 @@
 
 <%pyfr:kernel name='shocksensor' ndim='1'
               s='in fpdtype_t[${str(nupts)}]'
-              amu='out fpdtype_t'>
+              artvisc='out fpdtype_t'>
     // Smoothness indicator
     fpdtype_t totEn = 0.0, pnEn = 1e-15;
 
@@ -21,8 +21,8 @@
     // Compute cell-wise artificial viscosity
     fpdtype_t mu = (se < se0 - ${c['kappa']})
                  ? 0.0
-                 : ${0.5*c['max-amu']}*(1.0 + sin(${0.5*math.pi/c['kappa']}*(se - se0)));
-    mu = (se < se0 + ${c['kappa']}) ? mu : ${c['max-amu']};
+                 : ${0.5*c['max-artvisc']}*(1.0 + sin(${0.5*math.pi/c['kappa']}*(se - se0)));
+    mu = (se < se0 + ${c['kappa']}) ? mu : ${c['max-artvisc']};
 
-    amu = mu;
+    artvisc = mu;
 </%pyfr:kernel>
diff --git a/pyfr/solvers/baseadvecdiff/system.py b/pyfr/solvers/baseadvecdiff/system.py
index dee45d3..458b5a5 100644
--- a/pyfr/solvers/baseadvecdiff/system.py
+++ b/pyfr/solvers/baseadvecdiff/system.py
@@ -24,7 +24,7 @@ class BaseAdvectionDiffusionSystem(BaseAdvectionSystem):
             q1 << kernels['eles', 'shockvar']()
             q1 << kernels['eles', 'shockvar_modal']()
             q1 << kernels['eles', 'shocksensor']()
-            q1 << kernels['mpiint', 'avis_fpts_pack']()
+            q1 << kernels['mpiint', 'artvisc_fpts_pack']()
         q1 << kernels['eles', 'tgradpcoru_upts']()
         q2 << kernels['mpiint', 'scal_fpts_send']()
         q2 << kernels['mpiint', 'scal_fpts_recv']()
@@ -38,9 +38,9 @@ class BaseAdvectionDiffusionSystem(BaseAdvectionSystem):
         q1 << kernels['eles', 'gradcoru_fpts']()
         q1 << kernels['mpiint', 'vect_fpts_pack']()
         if ('eles', 'shockvar') in kernels:
-            q2 << kernels['mpiint', 'avis_fpts_send']()
-            q2 << kernels['mpiint', 'avis_fpts_recv']()
-            q2 << kernels['mpiint', 'avis_fpts_unpack']()
+            q2 << kernels['mpiint', 'artvisc_fpts_send']()
+            q2 << kernels['mpiint', 'artvisc_fpts_recv']()
+            q2 << kernels['mpiint', 'artvisc_fpts_unpack']()
 
         runall([q1, q2])
 
diff --git a/pyfr/solvers/euler/inters.py b/pyfr/solvers/euler/inters.py
index 257d80e..f403488 100644
--- a/pyfr/solvers/euler/inters.py
+++ b/pyfr/solvers/euler/inters.py
@@ -17,7 +17,7 @@ class EulerIntInters(BaseAdvectionIntInters):
 
         self.kernels['comm_flux'] = lambda: self._be.kernel(
             'intcflux', tplargs=tplargs, dims=[self.ninterfpts],
-            ul=self._scal0_lhs, ur=self._scal0_rhs,
+            ul=self._scal_lhs, ur=self._scal_rhs,
             magnl=self._mag_pnorm_lhs, nl=self._norm_pnorm_lhs
         )
 
@@ -34,7 +34,7 @@ class EulerMPIInters(BaseAdvectionMPIInters):
 
         self.kernels['comm_flux'] = lambda: self._be.kernel(
             'mpicflux', tplargs, dims=[self.ninterfpts],
-            ul=self._scal0_lhs, ur=self._scal0_rhs,
+            ul=self._scal_lhs, ur=self._scal_rhs,
             magnl=self._mag_pnorm_lhs, nl=self._norm_pnorm_lhs
         )
 
@@ -50,7 +50,7 @@ class EulerBaseBCInters(BaseAdvectionBCInters):
                        c=self._tpl_c, bctype=self.type)
 
         self.kernels['comm_flux'] = lambda: self._be.kernel(
-            'bccflux', tplargs, dims=[self.ninterfpts], ul=self._scal0_lhs,
+            'bccflux', tplargs, dims=[self.ninterfpts], ul=self._scal_lhs,
             magnl=self._mag_pnorm_lhs, nl=self._norm_pnorm_lhs,
             ploc=self._ploc
         )
diff --git a/pyfr/solvers/navstokes/elements.py b/pyfr/solvers/navstokes/elements.py
index 1d22eb6..a887434 100644
--- a/pyfr/solvers/navstokes/elements.py
+++ b/pyfr/solvers/navstokes/elements.py
@@ -25,11 +25,11 @@ class NavierStokesElements(BaseFluidElements, BaseAdvectionDiffusionElements):
             self.kernels['tdisf'] = lambda: backend.kernel(
                 'tflux', tplargs=tplargs, dims=[self.nqpts, self.neles],
                 u=self._scal_qpts, smats=self.smat_at('qpts'),
-                f=self._vect_qpts, amu=self.avis
+                f=self._vect_qpts, artvisc=self.artvisc
             )
         else:
             self.kernels['tdisf'] = lambda: backend.kernel(
                 'tflux', tplargs=tplargs, dims=[self.nupts, self.neles],
                 u=self.scal_upts_inb, smats=self.smat_at('upts'),
-                f=self._vect_upts, amu=self.avis
+                f=self._vect_upts, artvisc=self.artvisc
             )
diff --git a/pyfr/solvers/navstokes/inters.py b/pyfr/solvers/navstokes/inters.py
index d86a438..88d96cc 100644
--- a/pyfr/solvers/navstokes/inters.py
+++ b/pyfr/solvers/navstokes/inters.py
@@ -24,14 +24,14 @@ class NavierStokesIntInters(BaseAdvectionDiffusionIntInters):
 
         self.kernels['con_u'] = lambda: be.kernel(
             'intconu', tplargs=tplargs, dims=[self.ninterfpts],
-            ulin=self._scal0_lhs, urin=self._scal0_rhs,
-            ulout=self._vect0_lhs, urout=self._vect0_rhs
+            ulin=self._scal_lhs, urin=self._scal_rhs,
+            ulout=self._vect_lhs, urout=self._vect_rhs
         )
         self.kernels['comm_flux'] = lambda: be.kernel(
             'intcflux', tplargs=tplargs, dims=[self.ninterfpts],
-            ul=self._scal0_lhs, ur=self._scal0_rhs,
-            gradul=self._vect0_lhs, gradur=self._vect0_rhs,
-            amul=self._avis0_lhs, amur=self._avis0_rhs,
+            ul=self._scal_lhs, ur=self._scal_rhs,
+            gradul=self._vect_lhs, gradur=self._vect_rhs,
+            artviscl=self._artvisc_lhs, artviscr=self._artvisc_rhs,
             magnl=self._mag_pnorm_lhs, nl=self._norm_pnorm_lhs
         )
 
@@ -53,13 +53,13 @@ class NavierStokesMPIInters(BaseAdvectionDiffusionMPIInters):
 
         self.kernels['con_u'] = lambda: be.kernel(
             'mpiconu', tplargs=tplargs, dims=[self.ninterfpts],
-            ulin=self._scal0_lhs, urin=self._scal0_rhs, ulout=self._vect0_lhs
+            ulin=self._scal_lhs, urin=self._scal_rhs, ulout=self._vect_lhs
         )
         self.kernels['comm_flux'] = lambda: be.kernel(
             'mpicflux', tplargs=tplargs, dims=[self.ninterfpts],
-            ul=self._scal0_lhs, ur=self._scal0_rhs,
-            gradul=self._vect0_lhs, gradur=self._vect0_rhs,
-            amul=self._avis0_lhs, amur=self._avis0_rhs,
+            ul=self._scal_lhs, ur=self._scal_rhs,
+            gradul=self._vect_lhs, gradur=self._vect_rhs,
+            artviscl=self._artvisc_lhs, artviscr=self._artvisc_rhs,
             magnl=self._mag_pnorm_lhs, nl=self._norm_pnorm_lhs
         )
 
@@ -84,14 +84,14 @@ class NavierStokesBaseBCInters(BaseAdvectionDiffusionBCInters):
 
         self.kernels['con_u'] = lambda: be.kernel(
             'bcconu', tplargs=tplargs, dims=[self.ninterfpts],
-            ulin=self._scal0_lhs, ulout=self._vect0_lhs,
+            ulin=self._scal_lhs, ulout=self._vect_lhs,
             nlin=self._norm_pnorm_lhs, ploc=self._ploc
         )
         self.kernels['comm_flux'] = lambda: be.kernel(
             'bccflux', tplargs=tplargs, dims=[self.ninterfpts],
-            ul=self._scal0_lhs, gradul=self._vect0_lhs, amul=self._avis0_lhs,
+            ul=self._scal_lhs, gradul=self._vect_lhs,
             magnl=self._mag_pnorm_lhs, nl=self._norm_pnorm_lhs,
-            ploc=self._ploc
+            ploc=self._ploc, artviscl=self._artvisc_lhs
         )
 
 
diff --git a/pyfr/solvers/navstokes/kernels/bccflux.mako b/pyfr/solvers/navstokes/kernels/bccflux.mako
index 871b609..03f63d7 100644
--- a/pyfr/solvers/navstokes/kernels/bccflux.mako
+++ b/pyfr/solvers/navstokes/kernels/bccflux.mako
@@ -11,10 +11,10 @@
 <%pyfr:kernel name='bccflux' ndim='1'
               ul='inout view fpdtype_t[${str(nvars)}]'
               gradul='in view fpdtype_t[${str(ndims)}][${str(nvars)}]'
-              amul='in view fpdtype_t'
+              artviscl='in view fpdtype_t'
               nl='in fpdtype_t[${str(ndims)}]'
               magnl='in fpdtype_t'
               ploc='in fpdtype_t[${str(ndims)}]'
               t='scalar fpdtype_t'>
-    ${pyfr.expand('bc_common_flux_state', 'ul', 'gradul', 'amul', 'nl', 'magnl', 'ploc', 't')};
+    ${pyfr.expand('bc_common_flux_state', 'ul', 'gradul', 'artviscl', 'nl', 'magnl', 'ploc', 't')};
 </%pyfr:kernel>
diff --git a/pyfr/solvers/navstokes/kernels/bcs/ghost.mako b/pyfr/solvers/navstokes/kernels/bcs/ghost.mako
index 38ccd64..abe76b0 100644
--- a/pyfr/solvers/navstokes/kernels/bcs/ghost.mako
+++ b/pyfr/solvers/navstokes/kernels/bcs/ghost.mako
@@ -6,7 +6,7 @@
 
 <% tau = c['ldg-tau'] %>
 
-<%pyfr:macro name='bc_common_flux_state' params='ul, gradul, amul, nl, magnl, ploc, t'>
+<%pyfr:macro name='bc_common_flux_state' params='ul, gradul, artviscl, nl, magnl, ploc, t'>
     // Viscous states
     fpdtype_t ur[${nvars}], gradur[${ndims}][${nvars}];
     ${pyfr.expand('bc_ldg_state', 'ul', 'nl', 'ur', 'ploc', 't')};
@@ -14,7 +14,7 @@
 
     fpdtype_t fvr[${ndims}][${nvars}] = {{0}};
     ${pyfr.expand('viscous_flux_add', 'ur', 'gradur', 'fvr')};
-    ${pyfr.expand('artificial_viscosity_add', 'gradur', 'fvr', 'amul')};
+    ${pyfr.expand('artificial_viscosity_add', 'gradur', 'fvr', 'artviscl')};
 
     // Inviscid (Riemann solve) state
     ${pyfr.expand('bc_rsolve_state', 'ul', 'nl', 'ur', 'ploc', 't')};
diff --git a/pyfr/solvers/navstokes/kernels/bcs/slp-adia-wall.mako b/pyfr/solvers/navstokes/kernels/bcs/slp-adia-wall.mako
index e4bf0f6..087330e 100644
--- a/pyfr/solvers/navstokes/kernels/bcs/slp-adia-wall.mako
+++ b/pyfr/solvers/navstokes/kernels/bcs/slp-adia-wall.mako
@@ -15,7 +15,7 @@
     ur[${nvars - 1}] = ul[${nvars - 1}];
 </%pyfr:macro>
 
-<%pyfr:macro name='bc_common_flux_state' params='ul, gradul, amul, nl, magnl, ploc, t'>
+<%pyfr:macro name='bc_common_flux_state' params='ul, gradul, artviscl, nl, magnl, ploc, t'>
     // Ghost state r
     fpdtype_t ur[${nvars}];
     ${pyfr.expand('bc_ldg_state', 'ul', 'nl', 'ur', 'ploc', 't')};
diff --git a/pyfr/solvers/navstokes/kernels/intcflux.mako b/pyfr/solvers/navstokes/kernels/intcflux.mako
index cc377a6..83d1dc0 100644
--- a/pyfr/solvers/navstokes/kernels/intcflux.mako
+++ b/pyfr/solvers/navstokes/kernels/intcflux.mako
@@ -13,8 +13,8 @@
               ur='inout view fpdtype_t[${str(nvars)}]'
               gradul='in view fpdtype_t[${str(ndims)}][${str(nvars)}]'
               gradur='in view fpdtype_t[${str(ndims)}][${str(nvars)}]'
-              amul='in view fpdtype_t'
-              amur='in view fpdtype_t'
+              artviscl='in view fpdtype_t'
+              artviscr='in view fpdtype_t'
               nl='in fpdtype_t[${str(ndims)}]'
               magnl='in fpdtype_t'>
     // Perform the Riemann solve
@@ -24,13 +24,13 @@
 % if beta != -0.5:
     fpdtype_t fvl[${ndims}][${nvars}] = {{0}};
     ${pyfr.expand('viscous_flux_add', 'ul', 'gradul', 'fvl')};
-    ${pyfr.expand('artificial_viscosity_add', 'gradul', 'fvl', 'amul')};
+    ${pyfr.expand('artificial_viscosity_add', 'gradul', 'fvl', 'artviscl')};
 % endif
 
 % if beta != 0.5:
     fpdtype_t fvr[${ndims}][${nvars}] = {{0}};
     ${pyfr.expand('viscous_flux_add', 'ur', 'gradur', 'fvr')};
-    ${pyfr.expand('artificial_viscosity_add', 'gradur', 'fvr', 'amur')};
+    ${pyfr.expand('artificial_viscosity_add', 'gradur', 'fvr', 'artviscr')};
 % endif
 
 % for i in range(nvars):
diff --git a/pyfr/solvers/navstokes/kernels/mpicflux.mako b/pyfr/solvers/navstokes/kernels/mpicflux.mako
index 10a6be0..465449f 100644
--- a/pyfr/solvers/navstokes/kernels/mpicflux.mako
+++ b/pyfr/solvers/navstokes/kernels/mpicflux.mako
@@ -13,8 +13,8 @@
               ur='inout mpi fpdtype_t[${str(nvars)}]'
               gradul='in view fpdtype_t[${str(ndims)}][${str(nvars)}]'
               gradur='in mpi fpdtype_t[${str(ndims)}][${str(nvars)}]'
-              amul='in view fpdtype_t'
-              amur='in mpi fpdtype_t'
+              artviscl='in view fpdtype_t'
+              artviscr='in mpi fpdtype_t'
               nl='in fpdtype_t[${str(ndims)}]'
               magnl='in fpdtype_t'>
     // Perform the Riemann solve
@@ -24,13 +24,13 @@
 % if beta != -0.5:
     fpdtype_t fvl[${ndims}][${nvars}] = {{0}};
     ${pyfr.expand('viscous_flux_add', 'ul', 'gradul', 'fvl')};
-    ${pyfr.expand('artificial_viscosity_add', 'gradul', 'fvl', 'amul')};
+    ${pyfr.expand('artificial_viscosity_add', 'gradul', 'fvl', 'artviscl')};
 % endif
 
 % if beta != 0.5:
     fpdtype_t fvr[${ndims}][${nvars}] = {{0}};
     ${pyfr.expand('viscous_flux_add', 'ur', 'gradur', 'fvr')};
-    ${pyfr.expand('artificial_viscosity_add', 'gradur', 'fvr', 'amur')};
+    ${pyfr.expand('artificial_viscosity_add', 'gradur', 'fvr', 'artviscr')};
 % endif
 
 % for i in range(nvars):
diff --git a/pyfr/solvers/navstokes/kernels/tflux.mako b/pyfr/solvers/navstokes/kernels/tflux.mako
index a52f3b1..c8ddcf1 100644
--- a/pyfr/solvers/navstokes/kernels/tflux.mako
+++ b/pyfr/solvers/navstokes/kernels/tflux.mako
@@ -9,14 +9,14 @@
 <%pyfr:kernel name='tflux' ndim='2'
               u='in fpdtype_t[${str(nvars)}]'
               smats='in fpdtype_t[${str(ndims)}][${str(ndims)}]'
-              amu='in broadcast fpdtype_t'
+              artvisc='in broadcast fpdtype_t'
               f='inout fpdtype_t[${str(ndims)}][${str(nvars)}]'>
     // Compute the flux (F = Fi + Fv)
     fpdtype_t ftemp[${ndims}][${nvars}];
     fpdtype_t p, v[${ndims}];
     ${pyfr.expand('inviscid_flux', 'u', 'ftemp', 'p', 'v')};
     ${pyfr.expand('viscous_flux_add', 'u', 'f', 'ftemp')};
-    ${pyfr.expand('artificial_viscosity_add', 'f', 'ftemp', 'amu')};
+    ${pyfr.expand('artificial_viscosity_add', 'f', 'ftemp', 'artvisc')};
 
     // Transform the fluxes
 % for i, j in pyfr.ndrange(ndims, nvars):

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