[Dune] [Dune-Commit] dune-grid r7063 - in trunk/dune/grid: albertagrid alugrid/2d alugrid/3d common onedgrid uggrid

Carsten Gräser graeser at math.fu-berlin.de
Wed Nov 3 15:07:49 CET 2010


Am 03.11.2010 14:44, schrieb Jö Fahlke:
> Am Wed,  3. Nov 2010, 11:06:26 +0100 schrieb Oliver Sander:
>> Isn't this an interface change which should be voted upon
>> before implementation?
> 
> Hmm, possibly.  I saw this as a backward compatible addition rather than a
> change but probably the latter is meant to contain the former.  Shall we vote
> on that now or shall I move the stuff to a branch and we vote on it later?
> 
> Here are the exact additions, later addition depend on earlier ones:
> 
> 1) I propose the give the GridFactory an additional constructor signature of
>    the form
> 
>      GridFactory(const ParameterTree &);
> 
>    This constructor is meant for passing options from a (user written)
>    parameter file to the grid creation process.  An empty ParameterTree here
>    is equivalent to calling the default constructor.  Parameters unknown to
>    the particular grid manager are ignored.
> 
> 2) Use 1) to support passing UG's heapSize parameter as a "heap_size"
>    ParameterTree option to the GridFactory.
> 
> 3) On the StructuredGridFactory add the signatures
> 
>      static shared_ptr<GridType>
>      createSimplexGrid(const FieldVector<ctype,dimworld>& lowerLeft,
>                        const FieldVector<ctype,dimworld>& upperRight,
>                        const array<unsigned int,dim>& elements,
>                        const ParameterTree &params);
>      static shared_ptr<GridType>
>      createCubeGrid(const FieldVector<ctype,dimworld>& lowerLeft,
>                        const FieldVector<ctype,dimworld>& upperRight,
>                        const array<unsigned int,dim>& elements,
>                        const ParameterTree &params);
> 
>    The additional ParameterTree parameter is simply passed to the underlying
>    GridFactory and not otherwise acted upon by the StructuredGridFactory
>    itself.
> 
> 4) On the StructuredGridFactory add the signatures
> 
>      static shared_ptr<GridType>
>      createSimplexGrid(const ParameterTree &params);
>      static shared_ptr<GridType>
>      createCubeGrid(const ParameterTree &params);
> 
>    These extract the properties of the Grid to create from the ParameterTree
>    and then call the functions introduced in 3).  The following options are
>    recognized:
> 
>      bbox.lower -> lowerLeft  (default: vector of 0)
>      bbox.upper -> upperRight (default: vector of 1)
>      elements   -> elements   (default: array of 1)
> 
> 5) On the StructuredGridFactory add the following ParameterTree option to the
>    to the functions introduced in 4)
> 
>      global_refines -> number of globalRefines() to do after the grid has been
>                        created according to the other options.
>                        (default: 0)


This is directly related to fs#699. If we use ParameterTree during creation
we should consider to also export a ParameterTree on already created grids in order
to change parameters at runtime.

Regards,
Carsten




More information about the Dune mailing list