[feature] Make mapper inside stencil a reference to avoid re-computation of offsets when ElementContext is created.

This commit is contained in:
Robert Kloefkorn 2016-10-30 14:58:36 +01:00
parent aa8aca077d
commit a6d8748105
2 changed files with 11 additions and 5 deletions

View File

@ -122,12 +122,12 @@ SET_STRING_PROP(RichardsLensProblem, GridFile, "./data/richardslens_24x16.dgf");
* embedded into a high-permeability domain.
*
* The domain is rectangular. The left and right boundaries are
* free-flow boundaries with fixed water pressure which corrosponds to
* free-flow boundaries with fixed water pressure which corresponds to
* a fixed saturation of \f$S_w = 0\f$ in the Richards model, the
* bottom boundary is closed. The top boundary is also closed except
* for an infiltration section, where water is infiltrating into an
* initially unsaturated porous medium. This problem is very similar
* the the \c LensProblem, with the main difference being that the domain
* the \c LensProblem, with the main difference being that the domain
* is initally fully saturated by gas instead of water and water
* instead of a \c DNAPL infiltrates from the top.
*/
@ -218,7 +218,7 @@ public:
outerK_ = this->toDimMatrix_(5e-12);
// determine which degrees of freedom are in the lens
Stencil stencil(this->gridView());
Stencil stencil(this->gridView(), this->simulator().model().dofMapper() );
auto elemIt = this->gridView().template begin</*codim=*/0>();
auto elemEndIt = this->gridView().template end</*codim=*/0>();
for (; elemIt != elemEndIt; ++elemIt) {

View File

@ -113,7 +113,10 @@ void writeTetrahedronSubControlVolumes(const Grid &grid)
GridFactory2 gf2;
const auto &gridView = grid.leafView();
typedef Ewoms::VcfvStencil<Scalar, GridView> Stencil;
Stencil stencil(gridView);
typedef typename Stencil :: Mapper Mapper;
Mapper mapper( gridView );
Stencil stencil(gridView, mapper);
auto eIt = gridView.template begin<0>();
const auto &eEndIt = gridView.template end<0>();
@ -298,7 +301,10 @@ void testQuadrature()
Scalar result = 0;
// instanciate a stencil
typedef Ewoms::VcfvStencil<Scalar, GridView> Stencil;
Stencil stencil(gridView);
typedef typename Stencil :: Mapper Mapper;
Mapper mapper( gridView );
Stencil stencil(gridView, mapper);
for (; eIt != eEndIt; ++eIt) {
const auto &elemGeom = eIt->geometry();