[Dune] GridType in GmshReader

Andreas Dedner A.S.Dedner at warwick.ac.uk
Wed Jul 20 12:12:17 CEST 2011


Hi.

I know it is not part of the "official" coding style but i do think
that all (complex) return and parameter types used in methods of a Dune
class should be made publicly available by that class-
so yes I think Grid should be exported.

Best
Andreas

On 07/20/2011 09:47 AM, Jö Fahlke wrote:
> Am Wed, 20. Jul 2011, 13:51:13 +0530 schrieb Jayesh Badwaik:
>    
>> I needed to extract the gridtype from the GmshReader and hence, for the same
>> purpose,
>> I have made the GridType public in my gmshreader.hh file in the defintion of
>> GmshReader class definition by adding the following line
>>
>> typedef GridType GridImp;
>>
>> I think it is a good idea for me, what do you think?
>> Has anybody ever felt this need?
>> I am creating a framework over dune, and there is a class named as
>> DeviceFactory which creates a grid and then collects the grid data
>> from the file and then converts the data into a form which i am using and
>> then after that sends all the information to a class Device.
>> I was already passing the GmshReader<GridImp>  as a template Parameter to the
>> DeviceFactory
>> and I found the extra GridImp Parameter that I had to pass to create the
>> grid redundant. and so the change.
>>      
> Why don't you use GridImp as the template parameter for the Device class?
> E.g.
>
>    template<class GridImp>
>    class Device {
>      typedef GmshReader<GridImp>  Reader;
>      ...
>    };
>
> Or you can use partial specialization:
>
>    template<class Reader>
>    class Device;
>
>    template<class GridImp>
>    class Device<GmshReader<GridImp>  >  {
>      typedef GmshReader<GridImp>  Reader;
>      ...
>    };
>
> That said, I'm slightly in favour of the GmshReader exporting the grid type,
> since that allows to substitude the GmshReader by a modified class (which
> wouldn't work with the above constructs).  I'm against exporting it under the
> name "GridType" however, I would much prefer the shorter name "Grid".
>
> Jö.
>
>    
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110720/246a44dd/attachment.htm>


More information about the Dune mailing list