Commit 1bf96b9b authored by Ansgar Burchardt's avatar Ansgar Burchardt

Merge branch 'feature/new-mcmgmapper-interface' into 'master'

Use new MCMGMapper interface

See merge request !15
parents a9f5434d 11b50e3b
Pipeline #3302 passed with stage
in 15 minutes and 26 seconds
......@@ -22,8 +22,8 @@ template<class G>
void timeloop (G& grid, double tend, int lmin, int lmax)
{
// make a mapper for codim 0 entities in the leaf grid
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,Dune::MCMGElementLayout>
mapper(grid);
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G>
mapper(grid, Dune::mcmgElementLayout());
// allocate a vector for the concentration
std::vector<double> c(mapper.size());
......
......@@ -1619,13 +1619,11 @@ The class template
\lstinline!Dune::LeafMultipleCodimMultipleGeomTypeMapper! provides an
index-based mapper where the entities in the subset $E^\prime$ are all
leaf entities and can further be selected depending on the codimension
and the geometry type. To that end the second template argument has to
be a class template with one integer template parameter containing a
method \lstinline!contains!. Just look at the example
\lstinline!P0Layout!. When the method \lstinline!contains! returns
true for a combination of dimension, codimension and geometry type
then all leaf entities with that dimension, codimension and geometry
type will be in the subset $E^\prime$. The mapper object is
and the geometry type. To that end the constructor takes a function object
called with a geometry type and the grid dimension and returning a Boolean
value. When the function object returns true for a combination of geometry
type and grid dimension then all leaf entities with that geometry type
will be in the subset $E^\prime$. The mapper object is
constructed in line \ref{edh:mapper}. A similar mapper is available
also for the entities of a grid level.
......
......@@ -9,19 +9,6 @@
#include <dune/grid/io/visual/grapedatadisplay.hh>
#endif
//! Parameter for mapper class
/** This class is only here to show what such a class looks like -- it does
exactly the same as Dune::MCMGElementLayout. */
template<int dimgrid>
struct P0Layout
{
bool contains (Dune::GeometryType gt)
{
if (gt.dim()==dimgrid) return true;
return false;
}
};
// demonstrate attaching data to elements
template<class G, class F>
void elementdata (const G& grid, const F& f)
......@@ -38,8 +25,8 @@ void elementdata (const G& grid, const F& f)
GridView gridView = grid.leafGridView();
// make a mapper for codim 0 entities in the leaf grid
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,P0Layout>
mapper(grid); /*@\label{edh:mapper}@*/
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G>
mapper(grid, Dune::mcmgElementLayout()); /*@\label{edh:mapper}@*/
// allocate a vector for the data
std::vector<double> c(mapper.size()); /*@\label{edh:c}@*/
......
......@@ -20,8 +20,8 @@ template<class G>
void timeloop (const G& grid, double tend)
{
// make a mapper for codim 0 entities in the leaf grid
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,Dune::MCMGElementLayout>
mapper(grid);
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G>
mapper(grid, Dune::mcmgElementLayout());
// allocate a vector for the concentration
std::vector<double> c(mapper.size());
......
......@@ -25,8 +25,8 @@ template<class G>
void partimeloop (const G& grid, double tend)
{
// make a mapper for codim 0 entities in the leaf grid
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,Dune::MCMGElementLayout>
mapper(grid);
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G>
mapper(grid, Dune::mcmgElementLayout());
// allocate a vector for the concentration
std::vector<double> c(mapper.size());
......
......@@ -9,19 +9,6 @@
#include <dune/grid/io/visual/grapedatadisplay.hh>
#endif
//! Parameter for mapper class
/** This class is only here to show what such a class looks like -- it does
exactly the same as Dune::MCMGVertexLayout. */
template<int dimgrid>
struct P1Layout
{
bool contains (Dune::GeometryType gt)
{
if (gt.dim()==0) return true;
return false;
}
};
// demonstrate attaching data to elements
template<class G, class F>
void vertexdata (const G& grid, const F& f)
......@@ -36,8 +23,8 @@ void vertexdata (const G& grid, const F& f)
GridView gridView = grid.leafGridView();
// make a mapper for codim 0 entities in the leaf grid
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,P1Layout>
mapper(grid);
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G>
mapper(grid, Dune::mcmgVertexLayout());
// allocate a vector for the data
std::vector<double> c(mapper.size());
......
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