[Dune-devel] [Dune-Commit] [Commit] dune-istl - 002e800: [BlockVector] fix usage of FieldTraits (similar to the PromotionTraits)

Oliver Sander sander at igpm.rwth-aachen.de
Thu Aug 15 22:18:38 CEST 2013


Hi Christian,
shouldn't this be enough to fix the issue?  Each BlockVector knows the field_type,
no matter how deep the template nesting hierarchy is.  Why do you still need
specializations of FieldTraits for BlockVectors?  (i.e. Bernd's patch?)
Best,
Oliver

Am 15.08.2013 11:34, schrieb Christian Engwer:
> New commit, appeared at Thu Aug 15 11:34:10 2013 +0200
> as part of the following ref changes:
>
>      branch refs/heads/master    updated from f834769 -> ad74db9
>
> Browsable version: http://cgit.dune-project.org/repositories/dune-istl/commit/?id=002e80097867ffafb1cd4058fd8c8f199a24b7f3
>
> ======================================================================
>
> commit 002e80097867ffafb1cd4058fd8c8f199a24b7f3
> Author: Christian Engwer <christi at dune-project.org>
> Date:   Thu Aug 15 11:18:55 2013 +0200
>
>      [BlockVector]
>      fix usage of FieldTraits (similar to the PromotionTraits)
>
>   dune/istl/bvector.hh | 24 ++++++++++++------------
>   1 file changed, 12 insertions(+), 12 deletions(-)
>
>
>
> diff --git a/dune/istl/bvector.hh b/dune/istl/bvector.hh
> index b7adc5e..1fd965c 100644
> --- a/dune/istl/bvector.hh
> +++ b/dune/istl/bvector.hh
> @@ -164,49 +164,49 @@ namespace Dune {
>       //===== norms
>
>       //! one norm (sum over absolute values of entries)
> -    typename FieldTraits<value_type>::real_type one_norm () const
> +    typename FieldTraits<field_type>::real_type one_norm () const
>       {
> -      typename FieldTraits<value_type>::real_type sum=0;
> +      typename FieldTraits<field_type>::real_type sum=0;
>         for (size_type i=0; i<this->n; ++i) sum += (*this)[i].one_norm();
>         return sum;
>       }
>
>       //! simplified one norm (uses Manhattan norm for complex values)
> -    typename FieldTraits<value_type>::real_type one_norm_real () const
> +    typename FieldTraits<field_type>::real_type one_norm_real () const
>       {
> -      typename FieldTraits<value_type>::real_type sum=0;
> +      typename FieldTraits<field_type>::real_type sum=0;
>         for (size_type i=0; i<this->n; ++i) sum += (*this)[i].one_norm_real();
>         return sum;
>       }
>
>       //! two norm sqrt(sum over squared values of entries)
> -    typename FieldTraits<value_type>::real_type two_norm () const
> +    typename FieldTraits<field_type>::real_type two_norm () const
>       {
> -      typename FieldTraits<value_type>::real_type sum=0;
> +      typename FieldTraits<field_type>::real_type sum=0;
>         for (size_type i=0; i<this->n; ++i) sum += (*this)[i].two_norm2();
>         return sqrt(sum);
>       }
>
>       //! sqare of two norm (sum over squared values of entries), need for block recursion
> -    typename FieldTraits<value_type>::real_type two_norm2 () const
> +    typename FieldTraits<field_type>::real_type two_norm2 () const
>       {
> -      typename FieldTraits<value_type>::real_type sum=0;
> +      typename FieldTraits<field_type>::real_type sum=0;
>         for (size_type i=0; i<this->n; ++i) sum += (*this)[i].two_norm2();
>         return sum;
>       }
>
>       //! infinity norm (maximum of absolute values of entries)
> -    typename FieldTraits<value_type>::real_type infinity_norm () const
> +    typename FieldTraits<field_type>::real_type infinity_norm () const
>       {
> -      typename FieldTraits<value_type>::real_type max=0;
> +      typename FieldTraits<field_type>::real_type max=0;
>         for (size_type i=0; i<this->n; ++i) max = std::max(max,(*this)[i].infinity_norm());
>         return max;
>       }
>
>       //! simplified infinity norm (uses Manhattan norm for complex values)
> -    typename FieldTraits<value_type>::real_type infinity_norm_real () const
> +    typename FieldTraits<field_type>::real_type infinity_norm_real () const
>       {
> -      typename FieldTraits<value_type>::real_type max=0;
> +      typename FieldTraits<field_type>::real_type max=0;
>         for (size_type i=0; i<this->n; ++i) max = std::max(max,(*this)[i].infinity_norm_real());
>         return max;
>       }
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
>





More information about the Dune-devel mailing list