[Dune] GridType in GmshReader

Jayesh Badwaik jayesh.badwaik90 at gmail.com
Wed Jul 20 11:06:08 CEST 2011


Having said that, yes you are right...
the name should be shortened to Grid

Should I put in a feature request?

Cheers and Regards
Jayesh Vinay Badwaik
Electronics and Communication Engineering
VNIT, Nagpur
INDIA

-----------------------------------------------------------------------------------------------------------------------------------------------
"We are servants rather than masters in mathematics" -- Charles Hermite



On Wed, Jul 20, 2011 at 2:34 PM, Jayesh Badwaik
<jayesh.badwaik90 at gmail.com>wrote:

> you are right, I have been dointg that till now.
> But then, my DeviceFactory does a lot of operations on the grid
> (it especially requires the scsgmapper etc.) and it is logical that the
> definition of GridType for the gridview
> should come from the implementation of the grid as defined with the
> GmshReader
>
> to define it separately would put the onus on keeping the two consistent on
> the code writer and this is not necessary
> and surely not desired.....
>
>
> Cheers and Regards
> Jayesh Vinay Badwaik
> Electronics and Communication Engineering
> VNIT, Nagpur
> INDIA
>
>
> -----------------------------------------------------------------------------------------------------------------------------------------------
> "We are servants rather than masters in mathematics" -- Charles Hermite
>
>
>
> On Wed, Jul 20, 2011 at 2:17 PM, Jö Fahlke <jorrit at jorrit.de> 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ö.
>>
>> --
>> Cernlib: turns your plain old PC into a quantum computer.
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (GNU/Linux)
>>
>> iQIVAwUBTiaWL+mx9CKgc0OWAQgz3Q//Vvo2+PbvimsGAfqPHyPaB37DDe5k/Sp9
>> a4Pa/v/fQLkdDjzByuyYQzVSfcSCxi2zXXtULFOADTzhi/DK+TpwvcLezDNsuR6f
>> fZTIU/aRpMJmwmovZyhtn8Rw0ORiT+oobT6QUPVVLRqucGGDANAmYItXJM4SOden
>> kwRbcGPfNR+M9Cx/Yzx2/pfOvTW9r67NQLIB3rDcXvXU1v2DWHG139TjTkcAm5X6
>> TcKXwDzlwOoJblH1cfay+o0at+Y1LQ6mKWhXd37P/9khOZ1JtpZhcOXDaRxbJfHN
>> Dt4GhwNyBqHLSMb4BFOdxQutEzLDC0pKhU92AnArnPPv91Pvyhgex+KxvlCPMaPw
>> onEznle31fsO8OjaGdRKNEu5vTHuOz8cQ8NC0+xZT6AvY/gH4qu4oS8UwN1xODPK
>> 5Sq2EbGCQVd/ECGYvqPrQY0AgD/+HhqYnsPXxjYTQ22FydAiqwcPZfFldy9/mWsf
>> jfP/uEhwe1lKECFyy2iBwyS0ei6ru182AlsWkAnE02BRxE8H13po4+OoviWpJuJJ
>> gd6DM1ERxy3unQviwgOpbEgQnMivY+o5TCQJmp/69yCLNZEyHhBnKzfj6XwEBVs+
>> IA7fnPnD7D0fSMEDYFOcPlYGKCT0ACIXCuB+d88oVJq7fn8zLRmk7zpDd5JZ6Gl6
>> ngxFk9Pfpi4=
>> =h/O+
>> -----END PGP SIGNATURE-----
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110720/8d2d19c4/attachment.htm>


More information about the Dune mailing list