[dune-pdelab] [dune-pdelab-commit] [Commit] dune-pdelab - f3b73d6: [ISTL] Fix reduction parameter type in apply() methods

Christian Engwer christian.engwer at uni-muenster.de
Mon Oct 19 13:55:14 CEST 2015


Hi Steffen,

usually the reduction can safely be stated as double, which is also
what is prescribed by the interface classes in dune-istl.

Ciao
Christian


On Mon, Oct 19, 2015 at 12:43:02PM +0200, Steffen Müthing wrote:
> New commit, appeared at Mon Oct 19 12:43:02 2015 +0200
> as part of the following ref changes:
> 
>     branch refs/heads/master    updated from d426da0 -> f7ea2dc
> 
> Browsable version: http://cgit.dune-project.org/repositories/dune-pdelab/commit/?id=f3b73d633ae77a692e686b65e57dee2dcdba219a
> 
> ======================================================================
> 
> commit f3b73d633ae77a692e686b65e57dee2dcdba219a
> Author: Steffen Müthing <muething at dune-project.org>
> Date:   Mon Oct 19 11:47:45 2015 +0200
> 
>     [ISTL] Fix reduction parameter type in apply() methods
>     
>     This should always be a real value, so extract it from the field type.
> 
>  dune/pdelab/backend/istl/novlpistlsolverbackend.hh | 12 ++++++------
>  dune/pdelab/backend/istl/ovlp_amg_dg_backend.hh    |  2 +-
>  dune/pdelab/backend/istl/ovlpistlsolverbackend.hh  | 14 +++++++-------
>  dune/pdelab/backend/istl/seq_amg_dg_backend.hh     |  2 +-
>  dune/pdelab/backend/istl/seqistlsolverbackend.hh   | 12 ++++++------
>  5 files changed, 21 insertions(+), 21 deletions(-)
> 
> 
> 
> diff --git a/dune/pdelab/backend/istl/novlpistlsolverbackend.hh b/dune/pdelab/backend/istl/novlpistlsolverbackend.hh
> index 5476a08..2035d17 100644
> --- a/dune/pdelab/backend/istl/novlpistlsolverbackend.hh
> +++ b/dune/pdelab/backend/istl/novlpistlsolverbackend.hh
> @@ -360,7 +360,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          typedef Dune::PDELab::NonoverlappingOperator<GFS,M,V,W> POP;
>          POP pop(gfs,A);
> @@ -449,7 +449,7 @@ namespace Dune {
>         * z.
>         */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          typedef NonoverlappingOperator<GFS,M,V,W> POP;
>          POP pop(gfs,A);
> @@ -515,7 +515,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          typedef Dune::PDELab::NonoverlappingOperator<GFS,M,V,W> POP;
>          POP pop(gfs,A);
> @@ -589,7 +589,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          typedef Dune::PDELab::NonoverlappingOperator<GFS,M,V,W> POP;
>          POP pop(gfs,A);
> @@ -667,7 +667,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename W::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
>        {
>          Dune::SeqJac<M,V,W> jac(A,1,1.0);
>          jac.pre(z,r);
> @@ -949,7 +949,7 @@ namespace Dune {
>          return psp.norm(x);
>        }
>  
> -      void apply(M& A, V& z, V& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, V& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          Timer watch;
>          MatrixType& mat = Backend::native(A);
> diff --git a/dune/pdelab/backend/istl/ovlp_amg_dg_backend.hh b/dune/pdelab/backend/istl/ovlp_amg_dg_backend.hh
> index cacf647..cabf29d 100644
> --- a/dune/pdelab/backend/istl/ovlp_amg_dg_backend.hh
> +++ b/dune/pdelab/backend/istl/ovlp_amg_dg_backend.hh
> @@ -657,7 +657,7 @@ public:
>      \param[in] r right hand side
>      \param[in] reduction to be achieved
>    */
> -  void apply (M& A, V& z, V& r, typename V::ElementType reduction)
> +  void apply (M& A, V& z, V& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>    {
>      using Backend::native;
>      // make operator and scalar product for overlapping solver
> diff --git a/dune/pdelab/backend/istl/ovlpistlsolverbackend.hh b/dune/pdelab/backend/istl/ovlpistlsolverbackend.hh
> index 77b5e44..6508e60 100644
> --- a/dune/pdelab/backend/istl/ovlpistlsolverbackend.hh
> +++ b/dune/pdelab/backend/istl/ovlpistlsolverbackend.hh
> @@ -419,7 +419,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          using Backend::native;
> @@ -481,7 +481,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          using Backend::native;
> @@ -544,7 +544,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          using Backend::native;
> @@ -704,7 +704,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          using Backend::native;
> @@ -769,7 +769,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          typedef OverlappingOperator<C,M,V,W> POP;
>          POP pop(c,A);
> @@ -895,7 +895,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename W::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          using Backend::native;
> @@ -1032,7 +1032,7 @@ namespace Dune {
>          \param[in] r right hand side
>          \param[in] reduction to be achieved
>        */
> -      void apply(M& A, V& z, V& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, V& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          Timer watch;
>          Comm oocc(gfs.gridView().comm());
> diff --git a/dune/pdelab/backend/istl/seq_amg_dg_backend.hh b/dune/pdelab/backend/istl/seq_amg_dg_backend.hh
> index cfbce77..4adba14 100644
> --- a/dune/pdelab/backend/istl/seq_amg_dg_backend.hh
> +++ b/dune/pdelab/backend/istl/seq_amg_dg_backend.hh
> @@ -310,7 +310,7 @@ namespace Dune {
>          \param[in] r right hand side
>          \param[in] reduction to be achieved
>        */
> -      void apply (M& A, V& z, V& r, typename V::ElementType reduction)
> +      void apply (M& A, V& z, V& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          using Backend::native;
>          // do triple matrix product ACG = P^T ADG P
> diff --git a/dune/pdelab/backend/istl/seqistlsolverbackend.hh b/dune/pdelab/backend/istl/seqistlsolverbackend.hh
> index 249eb7b..7c7311b 100644
> --- a/dune/pdelab/backend/istl/seqistlsolverbackend.hh
> +++ b/dune/pdelab/backend/istl/seqistlsolverbackend.hh
> @@ -93,7 +93,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename W::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          using Backend::native;
> @@ -188,7 +188,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename W::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          using Backend::native;
> @@ -423,7 +423,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename W::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          using Backend::native;
> @@ -477,7 +477,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename W::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
>        {
>          using Backend::native;
>          using ISTLM = Backend::Native<M>;
> @@ -514,7 +514,7 @@ namespace Dune {
>          \param[in] reduction to be achieved
>        */
>        template<class M, class V, class W>
> -      void apply(M& A, V& z, W& r, typename W::ElementType reduction)
> +      void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
>        {
>          using Backend::Native;
>          Dune::SeqJac<Native<M>,
> @@ -616,7 +616,7 @@ namespace Dune {
>          \param[in] r right hand side
>          \param[in] reduction to be achieved
>        */
> -      void apply(M& A, V& z, V& r, typename V::ElementType reduction)
> +      void apply(M& A, V& z, V& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
>        {
>          Timer watch;
>          MatrixType& mat = Backend::native(A);
> 
> _______________________________________________
> dune-pdelab-commit mailing list
> dune-pdelab-commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-pdelab-commit

-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail  christian.engwer at uni-muenster.de
Telefon +49 251 83-35067
FAX     +49 251 83-32729




More information about the dune-pdelab mailing list