[Dune] Problem with GmshReader

Jayesh Badwaik jayeshb.work at gmail.com
Thu Mar 31 12:26:41 CEST 2011


Hi,

I am using the GmshReader to read .msh files
and have written the following code to read a msh file

         static const int dim = 2;

         typedef Dune::ALUSimplexGrid<dim,dim> GridType;
         typedef GridType::LeafGridView GV;

         typedef GridType::ctype ctype;

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


however the code is not working and outputs the error as shown below:

finiteelements.cc: In function ‘int main(int, char**)’:
finiteelements.cc:258: error: invalid initialization of non-const reference
of type ‘main(int, char**)::GridType&’ from a temporary of type ‘int’
/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>]’:
finiteelements.cc:261:   instantiated from here
/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>*)’
/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&)
/users/jayesh/Build-Spot/DUNE/dune-grid-2.0/dune/grid/alugrid/2d/alu2dgridfactory.hh:271:
note:                 Dune::GridFactory<Dune::ALUSimplexGrid<2, 2>
>::GridFactory()
/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> >&)

what could be the reason for the error??

Cheers and Regards,
Jayesh Vinay Badwaik
-----------------------------------------------------------------------------------------------------------

We are servants rather than masters in mathematics   --- Charles Hermite
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110331/d7ea6dbf/attachment.htm>


More information about the Dune mailing list