Commit 1913c0aa authored by Christian Engwer's avatar Christian Engwer

argh! fix errors in the last commit

[[Imported from SVN: r232]]
parent 259f76a2
......@@ -33,6 +33,43 @@ struct P0Layout
template<class G>
void gnuplot (G& grid, std::vector<double>& c)
// first we extract the dimensions of the grid
const int dim = G::dimension;
const int dimworld = G::dimensionworld;
// type used for coordinates in the grid
// such a type is exported by every grid implementation
typedef typename G::ctype ct;
// the grid has an iterator providing the access to
// all elements (better codim 0 entities) which are leafs
// of the refinement tree.
// Note the use of the typename keyword and the traits class
typedef typename G::template Codim<0>::LeafIterator ElementLeafIterator;
// make a mapper for codim 0 entities in the leaf grid
// iterate through all entities of codim 0 at the leafs
int count = 0;
for (ElementLeafIterator it = grid.template leafbegin<0>();
it!=grid.template leafend<0>(); ++it)
Dune::GeometryType gt = it->type();
const Dune::FieldVector<ct,dim>&
local = Dune::ReferenceElements<ct,dim>::general(gt).position(0,0);
global = it->geometry().global(local);
std::cout << global[0] << " " << c[*it)] << std::endl;
template<class G>
void timeloop (G& grid, double tend, int lmin, int lmax)
......@@ -33,7 +33,7 @@ CURDIR=doc/grid-howto
doc_DATA = grid-howto.pdf grid-howto.html
doc_DATA = grid-howto.pdf
EXTRAINSTALL = grid-howto.pdf grid-howto*.html *.png *.css
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment