[Dune] Problem with GmshReader
Martin Nolte
nolte at mathematik.uni-freiburg.de
Thu Mar 31 12:43:57 CEST 2011
Looks like you use some special purpose UG code, here. I don't even know why
ALU's constructor should be taking an integer constant. Maybe you should use
the following construction
GridType *grid = GmshReader< GridType >::read( filename );
Best,
Martin
On 03/31/2011 12:26 PM, Jayesh Badwaik wrote:
> 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
>
>
>
>
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
--
Martin Nolte <nolte at mathematik.uni-freiburg.de>
Universität Freiburg phone: +49-761-203-5630
Abteilung für angewandte Mathematik fax: +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany
More information about the Dune
mailing list