you are right, I have been dointg that till now.<br>But then, my DeviceFactory does a lot of operations on the grid<br>(it especially requires the scsgmapper etc.) and it is logical that the definition of GridType for the gridview<br>

should come from the implementation of the grid as defined with the GmshReader<br><br>to define it separately would put the onus on keeping the two consistent on the code writer and this is not necessary<br>and surely not desired..... <br>

<br><br clear="all">Cheers and Regards<br>Jayesh Vinay Badwaik<br>Electronics and Communication Engineering<br>VNIT, Nagpur<br>INDIA<br><br>-----------------------------------------------------------------------------------------------------------------------------------------------<br>

"We are servants rather than masters in mathematics" -- Charles Hermite<br><br>
<br><br><div class="gmail_quote">On Wed, Jul 20, 2011 at 2:17 PM, Jö Fahlke <span dir="ltr"><<a href="mailto:jorrit@jorrit.de">jorrit@jorrit.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Am Wed, 20. Jul 2011, 13:51:13 +0530 schrieb Jayesh Badwaik:<br>
<div class="im">> I needed to extract the gridtype from the GmshReader and hence, for the same<br>
> purpose,<br>
> I have made the GridType public in my gmshreader.hh file in the defintion of<br>
> GmshReader class definition by adding the following line<br>
><br>
> typedef GridType GridImp;<br>
><br>
> I think it is a good idea for me, what do you think?<br>
> Has anybody ever felt this need?<br>
> I am creating a framework over dune, and there is a class named as<br>
> DeviceFactory which creates a grid and then collects the grid data<br>
> from the file and then converts the data into a form which i am using and<br>
> then after that sends all the information to a class Device.<br>
> I was already passing the GmshReader<GridImp> as a template Parameter to the<br>
> DeviceFactory<br>
> and I found the extra GridImp Parameter that I had to pass to create the<br>
> grid redundant. and so the change.<br>
<br>
</div>Why don't you use GridImp as the template parameter for the Device class?<br>
E.g.<br>
<br>
  template<class GridImp><br>
  class Device {<br>
    typedef GmshReader<GridImp> Reader;<br>
    ...<br>
  };<br>
<br>
Or you can use partial specialization:<br>
<br>
  template<class Reader><br>
  class Device;<br>
<br>
  template<class GridImp><br>
  class Device<GmshReader<GridImp> > {<br>
    typedef GmshReader<GridImp> Reader;<br>
    ...<br>
  };<br>
<br>
That said, I'm slightly in favour of the GmshReader exporting the grid type,<br>
since that allows to substitude the GmshReader by a modified class (which<br>
wouldn't work with the above constructs).  I'm against exporting it under the<br>
name "GridType" however, I would much prefer the shorter name "Grid".<br>
<br>
Jö.<br>
<font color="#888888"><br>
--<br>
Cernlib: turns your plain old PC into a quantum computer.<br>
</font><br>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.10 (GNU/Linux)<br>
<br>
iQIVAwUBTiaWL+mx9CKgc0OWAQgz3Q//Vvo2+PbvimsGAfqPHyPaB37DDe5k/Sp9<br>
a4Pa/v/fQLkdDjzByuyYQzVSfcSCxi2zXXtULFOADTzhi/DK+TpwvcLezDNsuR6f<br>
fZTIU/aRpMJmwmovZyhtn8Rw0ORiT+oobT6QUPVVLRqucGGDANAmYItXJM4SOden<br>
kwRbcGPfNR+M9Cx/Yzx2/pfOvTW9r67NQLIB3rDcXvXU1v2DWHG139TjTkcAm5X6<br>
TcKXwDzlwOoJblH1cfay+o0at+Y1LQ6mKWhXd37P/9khOZ1JtpZhcOXDaRxbJfHN<br>
Dt4GhwNyBqHLSMb4BFOdxQutEzLDC0pKhU92AnArnPPv91Pvyhgex+KxvlCPMaPw<br>
onEznle31fsO8OjaGdRKNEu5vTHuOz8cQ8NC0+xZT6AvY/gH4qu4oS8UwN1xODPK<br>
5Sq2EbGCQVd/ECGYvqPrQY0AgD/+HhqYnsPXxjYTQ22FydAiqwcPZfFldy9/mWsf<br>
jfP/uEhwe1lKECFyy2iBwyS0ei6ru182AlsWkAnE02BRxE8H13po4+OoviWpJuJJ<br>
gd6DM1ERxy3unQviwgOpbEgQnMivY+o5TCQJmp/69yCLNZEyHhBnKzfj6XwEBVs+<br>
IA7fnPnD7D0fSMEDYFOcPlYGKCT0ACIXCuB+d88oVJq7fn8zLRmk7zpDd5JZ6Gl6<br>
ngxFk9Pfpi4=<br>
=h/O+<br>
-----END PGP SIGNATURE-----<br>
<br></blockquote></div><br>