[Dune-devel] [Dune-Commit] [Commit] dune-geometry - bf6f58c: [Tags] Add tags for dimension and codimension

Steffen Müthing steffen.muething at iwr.uni-heidelberg.de
Mon Jul 21 11:41:20 CEST 2014


Hi Markus,

Am 21.07.2014 um 11:12 schrieb Markus Blatt <markus at dr-blatt.de>:

> Hi,
> 
> On Fri, Jul 18, 2014 at 11:22:51AM +0200, Steffen Müthing wrote:
>> New commit, appeared at Fri Jul 18 11:22:51 2014 +0200
>> as part of the following ref changes:
>> 
>>    branch refs/heads/feature/FS1042-pdesoft-proposal    created as              bf6f58c
>> 
>> Browsable version: http://cgit.dune-project.org/repositories/dune-geometry/commit/?id=bf6f58c8c4accd18ee5ea493d2a259d47caab56a
>> 
>> ======================================================================
>> 
>> commit bf6f58c8c4accd18ee5ea493d2a259d47caab56a
>> Author: Steffen Müthing <muething at dune-project.org>
>> Date:   Fri Jul 18 11:21:35 2014 +0200
>> 
>>    [Tags] Add tags for dimension and codimension
>> 
>> [...]
>> diff --git a/dune/geometry/dimension.hh b/dune/geometry/dimension.hh
>> new file mode 100644
>> index 0000000..c32feec
>> --- /dev/null
>> +++ b/dune/geometry/dimension.hh
>> @@ -0,0 +1,28 @@
>> +// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
>> +// vi: set et ts=4 sw=2 sts=2:
>> +#ifndef DUNE_GEOMETRY_DIMENSION_HH
>> +#define DUNE_GEOMETRY_DIMENSION_HH
>> +
>> +#include <type_traits>
>> +
>> +namespace Dune {
>> +
>> +  //! Static tag representing a dimension.
>> +  template<int dim>
>> +  struct Dim
>> +    : public std::integral_constant<int,dim>
>> +  {
>> +    typedef Dim type;
>> +  };
>> +
>> +  //! Static tag representing a codimension.
>> +  template<int codim>
>> +  struct Codim
>> +    : public std::integral_constant<int,codim>
>> +  {
>> +    typedef Codim type;
>> +  };
>> +
>> +}
>> +
>> +#endif // DUNE_GEOMETRY_DIMENSION_HH
> 
> given the lack of documentation this is probably clear to everybody
> else, but I still do not see it:
> 
> Why is the typedef type needed and what is it used for.

that’s basically just an override of the same typedef in the base class. During our discussions
someone brought up the point that it would be helpful if Codim<x>::type == Codim<x> instead
of Codim<x>::type == std::integral_constant<int,x>.

That’s mostly of interest when writing TMPs etc., though. We could of course document it, but
we thought that the explanation is more confusing to users than leaving it undocumented. Maybe
a standard comment instead of a Doxygen one?

Steffen

> 
> Markus
> 
> -- 
> Do you need more support with DUNE or HPC in general? 
> 
> Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
> Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
> Tel.: +49 (0) 160 97590858
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20140721/5bed068c/attachment.sig>


More information about the Dune-devel mailing list