[Dune] IdentityGrid in dune-grid-dev-howto
Oliver Sander
sander at mi.fu-berlin.de
Fri May 29 11:18:23 CEST 2009
Hi Atgeirr!
I'm glad to hear that people start implementing more grids. You can
always ask questions on the Dune mailing list, but since IdentityGrid
was originally written be me you may as well ask me directly.
In fact, I'll cc this to the mailing list, as it may be of interest to
more people.
I know that the documentation in dune-grid-dev-howto is... incomplete
(what a nice euphemism for 'nonexisting'!) We would love to have a
friendly, informative, detailed text there, but nobody ever got around
to actually writing it.
As for your question: your first impression is correct. You are supposed
to copy IdentityGrid, rename, and start implementing. So what is the
HostGrid all about? I wanted IdentityGrid to be as small as possible,
but also to actually do something. Therefore, IdentityGrid takes any
other Dune grid as a parameter, and just forwards all method calls to
this parameter grid (i.e., the HostGrid). You get precisely the
functionality
of the HostGrid, but IdentityGrid hardly contains any functionality at all.
In fact, this is why it is called 'IdentityGrid': it behaves just like
the HostGrid.
If you want to write a Dune grid that wraps an existing grid manager,
that legacy manager and the host grid are in a similar position. You
then "simply" have to replace all calls to the host grids by calls to the
legacy manager. If you want to write a grid from scratch you can just
scrap all references to HostGrid and start putting the required
functionality
into the empty IdentityGrid methods.
I hope I've made myself reasonably clear. Don't hesitate to ask if there
are further questions.
Cheers,
Oliver
Atgeirr Rasmussen schrieb:
> Hi!
>
> We are just about to implement a new Dune grid capable of handling corner-point grids
> (a type of grids popular in reservoir simulation).
>
> I've had a look at the dune-grid-dev-howto module, but the documentation seems somewhat
> incomplete in the 1.2 release, and not much more in svn (in fact, it's just the word 'foo'...).
> Therefore I was hoping that you would be able to give me a few hints about how it should be
> used. If you are not the right person to ask, just tell me, and I won't bother you anymore!
>
> My first impression was that I should take IdentityGrid and copy it and all its auxillary classes,
> rename them, and implement everything. But then I noticed that everything depends on a HostGrid,
> and now I think that the HostGrid is the class I should implement, and then use IdentityGrid on top
> of that to get a proper Dune grid. Is that correct? If so, why is it done like that, i.e. what is the
> complexity I am spared by using IdentityGrid, compared to implementing a grid more or less
> directly?
>
> Sincerely Yours,
> Atgeirr Flø Rasmussen
> Sintef ICT, Applied Mathematics
>
>
--
************************************************************************
* 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