Commit d2648624 authored by Christoph Grüninger's avatar Christoph Grüninger

Merge branch 'remove-entity-pointers' into 'master'

[cleanup] Remove entity pointers



See merge request !3
parents 37bc369b 0f67dc6f
......@@ -78,8 +78,8 @@ void adaptiveintegration (Grid& grid, const Functor& f)
maxerror = std::max(maxerror,error);
// error on father entity
double fatherlowresult=integrateEntity(*(it->father()),f,loworder);
double fatherhighresult=integrateEntity(*(it->father()),f,highorder);
double fatherlowresult=integrateEntity(it->father(),f,loworder);
double fatherhighresult=integrateEntity(it->father(),f,highorder);
double fathererror = std::abs(fatherlowresult-fatherhighresult);
// local extrapolation
......
......@@ -29,8 +29,8 @@ void evolve (const G& grid, const M& mapper, V& c, double t, double& dt)
// intersection geometry
typedef typename IntersectionIterator::Intersection::Geometry IntersectionGeometry;
// entity pointer type
typedef typename G::template Codim<0>::EntityPointer EntityPointer;
// entity type
typedef typename G::template Codim<0>::Entity Entity;
// get grid view on leaf part
GridView gridView = grid.leafGridView();
......@@ -87,14 +87,14 @@ void evolve (const G& grid, const M& mapper, V& c, double t, double& dt)
if (is->neighbor()) // "correct" version /*@\label{evh:neighbor}@*/
{
// access neighbor
EntityPointer outside = is->outside();
int indexj = mapper.index(*outside);
Entity outside = is->outside();
int indexj = mapper.index(outside);
// compute flux from one side only
if (indexi<indexj)
{
// compute factor in neighbor
const LeafGeometry nbgeo = outside->geometry();
const LeafGeometry nbgeo = outside.geometry();
double nbvolume = nbgeo.volume();
double nbfactor = velocity*integrationOuterNormal/nbvolume;
......
......@@ -34,7 +34,6 @@ bool finitevolumeadapt (G& grid, M& mapper, V& c, int lmin, int lmax, int k)
// entity and entity pointer
typedef typename G::template Codim<0>::Entity Entity;
typedef typename G::template Codim<0>::EntityPointer EntityPointer;
// intersection iterator type
typedef typename LeafGridView::IntersectionIterator LeafIntersectionIterator;
......@@ -64,8 +63,7 @@ bool finitevolumeadapt (G& grid, M& mapper, V& c, int lmin, int lmax, int k)
continue;
// access neighbor
const EntityPointer pOutside = intersection.outside();
const Entity &outside = *pOutside;
const Entity &outside = intersection.outside();
int indexj = mapper.index(outside);
// handle face from one side only
......@@ -98,8 +96,7 @@ bool finitevolumeadapt (G& grid, M& mapper, V& c, int lmin, int lmax, int k)
if( !intersection.neighbor() )
continue;
const EntityPointer pOutside = intersection.outside();
const Entity &outside = *pOutside;
const Entity &outside = intersection.outside();
if( (outside.level() < lmax) || !outside.isRegular() )
grid.mark( 1, outside );
}
......@@ -138,8 +135,7 @@ bool finitevolumeadapt (G& grid, M& mapper, V& c, int lmin, int lmax, int k)
// average in father
if (it->level() > 0)
{
EntityPointer ep = it->father();
RestrictedValue& rvf = restrictionmap[*ep];
RestrictedValue& rvf = restrictionmap[it->father()];
rvf.value += rv.value/rv.count;
rvf.count += 1;
}
......@@ -176,8 +172,7 @@ bool finitevolumeadapt (G& grid, M& mapper, V& c, int lmin, int lmax, int k)
{
// value is not in map, interpolate from father element
assert (it->level() > 0);
EntityPointer ep = it->father();
RestrictedValue& rvf = restrictionmap[*ep];
RestrictedValue& rvf = restrictionmap[it->father()];
if (it->isLeaf())
{
int indexi = mapper.index(*it);
......
......@@ -40,8 +40,8 @@ void parevolve (const G& grid, const M& mapper, V& c, double t, double& dt)
// intersection geometry
typedef typename Intersection::Geometry IntersectionGeometry;
// entity pointer type
typedef typename G::template Codim<0>::EntityPointer EntityPointer;
// entity type
typedef typename G::template Codim<0>::Entity Entity;
// allocate a temporary vector for the update
V update(c.size());
......@@ -100,18 +100,18 @@ void parevolve (const G& grid, const M& mapper, V& c, double t, double& dt)
if( intersection.neighbor() )
{
// access neighbor
EntityPointer outside = intersection.outside();
int indexj = mapper.index(*outside);
Entity outside = intersection.outside();
int indexj = mapper.index(outside);
const int insideLevel = it->level();
const int outsideLevel = outside->level();
const int outsideLevel = outside.level();
// handle face from one side
if( (insideLevel > outsideLevel)
|| ((insideLevel == outsideLevel) && (indexi < indexj)) )
{
// compute factor in neighbor
const LeafGeometry nbgeo = outside->geometry();
const LeafGeometry nbgeo = outside.geometry();
double nbvolume = nbgeo.volume();
double nbfactor = velocity*integrationOuterNormal/nbvolume;
......
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