[Dune] FS#848 - add index method to GeometryType

Andreas Dedner dedner at mathematik.uni-freiburg.de
Tue Mar 15 01:05:07 CET 2011


Danke Joe fuer die Implementierung - ich find das sieht
gut so aus.
Koennen wir das ins release noch aufnehmen?
Gruss
Andreas

On 03/11/2011 04:02 PM, Jö Fahlke wrote:
> [ Using the instead of flyspray since I can't log in ]
>
> I like Andreas' proposal.  I modified it a little to provide two utility
> classes:
>
>    class LocalGeometryTypeIndex;
>    class GlobalGeometryTypeIndex;
>
> Each class provides two methods
>
>    static std::size_t index(const GeometryType&gt);
>    static std::size_t size(std::size_t dim);
>
> In the implementation of GlobalGeometryTypeIndex I also use a method
>
>    static std::size_t base(std::size_t dim);
>
> which returns the first index for a given dimension.  This may be useful to
> export in case someone stores stuff for all geometry types up to a certain
> dimension in a vector and want to iterate over the subset of a particular
> dimension in that vector only.
>
> I left out TMP versions of size() (and base()) for now, they are always easy
> to provide should someone need them.
>
> The patch with the implementation is attached, please comment.
>
>    
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110315/94444abb/attachment.htm>


More information about the Dune mailing list