[Dune] gmshreader problem with ALUSimplexGrid<3,3>
Martin Nolte
nolte at mathematik.uni-freiburg.de
Mon Apr 4 18:31:53 CEST 2011
Hi,
the GridFactory for ALUGrid does not support creation with a given grid. The
following code will do just fine:
typedef Dune::ALUSimplexGrid<3,3> GridType;
const std::string filename = "grids/test3d.msh";
std::vector<int> boundaryid;
std::vector<int> elementid;
Dune::GridPtr<GridType> gridptr
= Dune::GmshReader<GridType>::read(filename,boundaryid, elementid,
true, false);
Why does the GmshReader have a read method taking a grid anyway? Is this some
UG relic or did I miss something about the grid factory?
Best,
Martin
On 04/04/2011 05:13 PM, Jayesh Badwaik wrote:
> Hi,
>
> I'm trying to read the the .msh file and store it into ALUSimplexGrid<3,3>. I
> have written the following lines to do the job.
>
> typedef Dune::ALUSimplexGrid<3,3> GridType;
> const std::string filename = "grids/test3d.msh";
> std::vector<int> boundaryid;
> std::vector<int> elementid;
> GridType grid;
> Dune::GridPtr<GridType> gridptr = Dune::GmshReader<GridType>::read(grid,
> filename, boundaryid, elementid, true, false);
>
> and I get an error given below
> /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&, std::vector<T,
> std::allocator<_Tp1> >&, std::vector<T, std::allocator<_Tp1> >&, bool, bool)
> [with T = int, GridType = Dune::ALUSimplexGrid<3, 3>]’:
> finiteelements.cc:267: instantiated from here
> /users/jayesh/Build-Spot/DUNE/dune-grid-2.0/dune/grid/io/file/gmshreader.hh:812:
> error: invalid conversion from ‘Dune::ALUSimplexGrid<3, 3>*’ to ‘MPI_Comm’
> /users/jayesh/Build-Spot/DUNE/dune-grid-2.0/dune/grid/io/file/gmshreader.hh:812:
> error: initializing argument 1 of ‘Dune::GridFactory<Dune::ALUSimplexGrid<3,
> 3> >::GridFactory(const MPI_Comm&)’
>
>
> The part here that appears to be a problem is the GridFactory argument.
> Upon reading gmshreader.hh, at line 812, I found that the argument given is grid
> while the ALUGrid is apparently demanding a MPI_COMM-like argument....
>
>
>
>
>
>
>
>
> 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