Commit 909727c7 authored by Lukas Riedel's avatar Lukas Riedel

Make FlowParameters::bind work with entities of refined grids

parent 4a0af80d
......@@ -85,7 +85,7 @@ private:
void verify_cache () const
{
if (not std::get<std::shared_ptr<Parameterization>>(_cache.second)) {
DUNE_THROW(Dune::Exception, "No parameterization cached."
DUNE_THROW(Dune::Exception, "No parameterization cached. "
<< "Call 'bind' before accessing the parameterization.");
}
}
......@@ -123,8 +123,12 @@ public:
/** \param entity Grid entity (codim 0) to bind to
*/
template <class Entity>
void bind (const Entity& entity) const
void bind (Entity entity) const
{
// retrieve index of top father element of chosen entity
while(entity.hasFather()) {
entity = entity.father();
}
const auto index = _mapper.index(entity);
// done if index is already cached
......@@ -134,9 +138,10 @@ public:
return;
}
// otherwise find the index in the stored map and cache the values
const auto it = _param.find(index);
if (it == _param.end()) {
DUNE_THROW(Dune::Exception, "Could not retrieve parameterization"
DUNE_THROW(Dune::Exception, "Could not retrieve parameterization "
<< "for entity " << index);
}
_cache = *it;
......
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