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

Dune flyspray at dune-project.org
Wed Dec 1 22:12:30 CET 2010


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Andreas Dedner (dedner) 

Attached to Project - Dune
Summary - add index method to GeometryType
Task Type - Discussion
Category - Dune Core Modules
Status - New
Assigned To - 
Operating System - Unspecified / All
Severity - High
Priority - High
Reported Version - SVN (pre2.1)
Due in Version - Undecided
Due Date - Undecided
Details - Here two suggestions for GeometryType - the first one is the central one:

A) To avoid some of the problems caused by the fact that each Topology is represented by two topologIds (due to the lowest bit) I suggest to add the following to the GeometryType:
  
   size_t index() const { return (topologyId_ >> 1); }  
   size_t size() const { return (1 << (dim_-1)); }
   static size_t size(int dim) { return (1 << (dim_-1)); }

This makes it easier to use the topologyId for vector storage 
because one otherwise has to do the shift oneself or use twice as much storage and then runs into difficulties because each type uses two different sentries in the vector.

Furthermore it simplifies the rest of the GeometryType implementation, e.g.

   bool operator==(...) { return other.dim_==dim_ &&
                                 other.index()==index(); }

B) there are at least 7 ways to construct a 1d line:
1) GeometryType(1)       (id=0)
2) GeometryType(1u)      (id=0)
3) GeometryType(0,1)     (id=0)
4) GeometryType(1,1)     (id=1)
5) GeometryType(Simplex<Point>)  (id=0)
6) GeometryType(Cube<Point>)     (id=1)
7) makeLine              (id=0)
Do we need the first two? (3) and (4) seem just as good...
They are used in onedgrid but apparently nowhere else in dune-grid at least.

and for consistency makeLine(int id=0) seems to make sense...



More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=848

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list