[Dune] How to set boundary ids

Andreas Dedner dedner at mathematik.uni-freiburg.de
Thu Jun 18 10:20:39 CEST 2009


Hi,
a second suggestion for handling data attached to the initial grid:

    For a grid implementation preserving the order of insertion might be
    difficult and might require wrapping the level<0> index set of the
    grid even after grid creation. Alternatively the grid factory could
    provide a mapping from level<0> index to insertion order.
    Possible interface:
    class Factory < G > {
      void insert(entity) {...}
      void create() {...}
      View view() {...}
      int operator[](const Entity<0>& en) { return insertionOrder; }
      int operator[](const Entity<dim>& vtx) { return insertionOrder; }
      int operator[](const Intersection& bnd) { return insertionOrder; }
      G* finalize() { return grid; }
    };
    Note that create() does not return the grid and does not finalize the
    Factory. The old method createGrid() could still be available and
    would be equivalent to calling create(); finalize();

Greetings
Andreas and Martin

PS:
    do we specify the order in which vertices, elements, and boundary
    segments are added to the Factory, e.g., first all vertices and
    then the elements, or at least all that all vertices needed for the
    inserted element have already been inserted?



Oliver Sander wrote:
> Dear Dune!
> As far as I know the question of who sets boundaryIds and how
> is still unsettled.  Two days ago Peter, Christian, Benedikt and me
> discussed this issue again.  We came up with a solution that was
> acceptable to all four of us and combines (in our view) a consistent
> interface with ease of use.
> 
> We propose that boundary ids should be consecutive and starting
> from zero.  The user can influence the ordering by calling insert-
> BoundarySegment in the desired order.  The second argument
> (the segment geometry) will be made optional such that the user can
> specify boundary segment orderings and still leave the geometry to the
> implementation.I have described the solution in some more detail in
> Sections 4.4 and 4.5 of the grid-howto.
> 
> We propose that the behavior described there be part of the official
> Dune grid interface.  Please read it carefully and give us feedback.
> 
> Yours,
> Oliver
> 




More information about the Dune mailing list