[Dune] Problems with dune-grid
Patrick Leidenberger
patrick.leidenberger at psi.ch
Tue Aug 8 16:22:17 CEST 2006
Hi,
I have a problem with the size function for a mapper object
Here you can see the main part of my dune application (very similar to
listing 15 in the Dune grid howto):
/* provide a simplicial grid via ALUGRid/DGF */
std::string gridfile("./grids/cube.dgf");
Dune::GridPtr<GridType> alusimplexgrid(gridfile);
// Make a mapper for codim 0 entities in the leaf grid.
Dune::LeafMultipleCodimMultipleGeomTypeMapper<GridType, P0Layout>
mapper(*alusimplexgrid);
// Allocate a vector for data.
std::vector<int> data1(mapper.size());
rDebug("Vector size: %d", data1.size());
// Loop over all elements and set user datas to the number of the
// element.
int elemN = 0;
for (GridType::Codim<0>::LeafIterator it = (*alusimplexgrid).leafbegin<0>();
it!=(*alusimplexgrid).leafend<0>(); ++it)
{
rDebug("Element number: %d",elemN);
++elemN;
}
The data1.size returns 216, the loop goes over 750 elements.
The dgf file I read has 5 x 5 x 5 cells -> 125 cells in total. With 6
tetrahedrons per cell I get 750 tets.
Why does the .size operator not return this value?
Thank's a lot
Patrick
More information about the Dune
mailing list