Hi,<br><br>I am using the GmshReader to read .msh files <br>and have written the following code to read a msh file <br><br>         static const int dim = 2;<br><br>         typedef Dune::ALUSimplexGrid<dim,dim> GridType;<br>

         typedef GridType::LeafGridView GV;<br>
<br>         typedef GridType::ctype ctype;<br><br>         GridType grid(100);<br>         std::string gridName = "./grids/2Dfile.msh" ;<br>         Dune::GmshReader<GridType> gmshreader;<br>         gmshreader.read(grid, gridName);<br>


<br><br>however the code is not working and outputs the error as shown below:<br><br>finiteelements.cc: In function ‘int main(int, char**)’:<br>finiteelements.cc:258: error: invalid initialization of non-const reference of type ‘main(int, char**)::GridType&’ from a temporary of type ‘int’<br>

/users/jayesh/Build-Spot/DUNE/dune-grid-2.0/dune/grid/io/file/gmshreader.hh: In static member function ‘static GridType* Dune::GmshReader<GridType>::read(GridType&, const std::string&, bool, bool) [with GridType = Dune::ALUSimplexGrid<2, 2>]’:<br>

finiteelements.cc:261:   instantiated from here<br>/users/jayesh/Build-Spot/DUNE/dune-grid-2.0/dune/grid/io/file/gmshreader.hh:795: error: no matching function for call to ‘Dune::GridFactory<Dune::ALUSimplexGrid<2, 2> >::GridFactory(Dune::ALUSimplexGrid<2, 2>*)’<br>

/users/jayesh/Build-Spot/DUNE/dune-grid-2.0/dune/grid/alugrid/2d/alu2dgridfactory.hh:276: note: candidates are: Dune::GridFactory<Dune::ALUSimplexGrid<2, 2> >::GridFactory(const std::string&)<br>/users/jayesh/Build-Spot/DUNE/dune-grid-2.0/dune/grid/alugrid/2d/alu2dgridfactory.hh:271: note:                 Dune::GridFactory<Dune::ALUSimplexGrid<2, 2> >::GridFactory()<br>

/users/jayesh/Build-Spot/DUNE/dune-grid-2.0/dune/grid/alugrid/2d/alu2dgridfactory.hh:262: note:                 Dune::GridFactory<Dune::ALUSimplexGrid<2, 2> >::GridFactory(const Dune::GridFactory<Dune::ALUSimplexGrid<2, 2> >&)<br>

<br clear="all">what could be the reason for the error??<br><br>Cheers and Regards,<br>Jayesh Vinay Badwaik<br>-----------------------------------------------------------------------------------------------------------<br>



                
                                                        <div>
                        <p>We are servants rather than masters in mathematics   --- Charles Hermite<br></p>
                </div><br><br><br><br>