[Dune] How to set boundary ids
Oliver Sander
sander at mi.fu-berlin.de
Thu Jun 18 11:04:06 CEST 2009
Hi Andreas, hi Martin!
I do not think that this is a good idea, because:
- The GridFactory interface gets a lot more complicated
- In your proposal, the grid factory returns a mapping that does
a renumbering from level<0> index to insertion order.
This mapping could also be a part of the grid implementation
and remain invisible to the user. Since we are only talking
about level 0 the time overhead should not be a problem.
Concerning your postscriptum: Preferably we do not prescribe
any order. This is easiest for the user, and if the actual grid
needs the entities in a specific ordering the grid factory can
cache elements and vertices. This is how it is done in UGGrid.
--
Oliver
Andreas Dedner schrieb:
> 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
>>
--
************************************************************************
* Oliver Sander ** email: sander at mi.fu-berlin.de *
* Freie Universität Berlin ** phone: + 49 (30) 838 75348 *
* Institut für Mathematik ** URL : page.mi.fu-berlin.de/~sander *
* Arnimallee 6 ** -------------------------------------*
* 14195 Berlin, Germany ** Member of MATHEON (www.matheon.de) *
************************************************************************
More information about the Dune
mailing list