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

Christian Engwer christian.engwer at uni-muenster.de
Thu Aug 15 23:01:15 CEST 2013


On Thu, Aug 15, 2013 at 10:43:05PM +0200, Oliver Sander wrote:
> Am 15.08.2013 22:36, schrieb Christian Engwer:
> >On Thu, Aug 15, 2013 at 10:18:38PM +0200, Oliver Sander wrote:
> >>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?)
> >
> >Because the documentation of FieldTraits currently state that it also
> >retrieves the correct types for Vector and Matrix classes.
> >
> >... although I must admit that I was tempted to change the docs
> >instead of the code ...
> >
> I would be tempted to do so as well.  If I am not mistaken that would save
> from from having to specialize it for every class that uses it.

well... we could also fix/improve the implementation in
dune-common. The problem is that we have to extend the traits class
with some additional template arguments to be able to disable/enable
certain specializations. For a general Matrix/Vector class we want to
provide the field_type of the block_type if it is a hierarchic
matrix/vector. For PODs we want to use the class itself.

I think the main question will be, whether we prefer traits or
in-class typedef... I don't like duplicating information and in this
sense it is a bit strange to export the field_type as
Matrix::field_type _and_ FieldTraits<Matrix>::field_type. On the other
hand we need the traits anyway, and thus I would actually prefer the
traits. But before we remove the typedef from the matrix classes, I'm
sure we will have a big discussion.

Christian




More information about the Dune-devel mailing list