Skip to content
Snippets Groups Projects
Commit c0e91821 authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Simply code a bit using a range-based for loop

parent eb2799dc
Branches
No related tags found
No related merge requests found
Pipeline #
...@@ -115,10 +115,8 @@ struct BasisInterpolator ...@@ -115,10 +115,8 @@ struct BasisInterpolator
template <class BitVectorType> template <class BitVectorType>
static void interpolate(const B& basis, RepresentationType& coeff, const F& f, const BitVectorType& interpolateDOFFlags) static void interpolate(const B& basis, RepresentationType& coeff, const F& f, const BitVectorType& interpolateDOFFlags)
{ {
typedef typename GridView::template Codim<0>::Iterator ElementIterator;
typedef typename B::LocalFiniteElement LocalFiniteElement; typedef typename B::LocalFiniteElement LocalFiniteElement;
typedef typename Dune::LocalFiniteElementFunctionBase<LocalFiniteElement>::type FunctionBaseClass;
typedef typename Dune::LocalFiniteElementFunctionBase<typename B::LocalFiniteElement>::type FunctionBaseClass;
typedef LocalFunctionComponentWrapper<F, Grid, FunctionBaseClass> LocalWrapper; typedef LocalFunctionComponentWrapper<F, Grid, FunctionBaseClass> LocalWrapper;
const GridView& gridview = basis.getGridView(); const GridView& gridview = basis.getGridView();
...@@ -143,11 +141,8 @@ struct BasisInterpolator ...@@ -143,11 +141,8 @@ struct BasisInterpolator
std::vector<typename LocalWrapper::RangeType> interpolationValues; std::vector<typename LocalWrapper::RangeType> interpolationValues;
ElementIterator it = gridview.template begin<0>(); for(const auto& element : elements(gridview))
ElementIterator end = gridview.template end<0>();
for(; it != end; ++it)
{ {
auto&& element = *it;
const LocalFiniteElement& fe = basis.getLocalFiniteElement(element); const LocalFiniteElement& fe = basis.getLocalFiniteElement(element);
// check if all components have already been processed // check if all components have already been processed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment