Skip to content
Snippets Groups Projects
Commit 821702ee authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

Merge branch 'use-range-based-for' into 'master'

use range-based for

See merge request agnumpde/dune-fufem!49
parents c2f66bc5 3108d979
Branches
Tags
No related merge requests found
......@@ -30,7 +30,6 @@ class FunctionalAssembler
template <class LocalFunctionalAssemblerType, class GlobalVectorType>
void assemble(LocalFunctionalAssemblerType& localAssembler, GlobalVectorType& b, bool initializeVector=true) const
{
typedef typename GridView::template Codim<0>::Iterator ElementIterator;
typedef typename LocalFunctionalAssemblerType::LocalVector LocalVector;
typedef typename TrialBasis::LinearCombination LinearCombination;
......@@ -42,19 +41,17 @@ class FunctionalAssembler
b=0.0;
}
ElementIterator it = tBasis_.getGridView().template begin<0>();
ElementIterator end = tBasis_.getGridView().template end<0>();
for (; it != end; ++it)
for (const auto& element : elements(tBasis_.getGridView()))
{
// get shape functions
const typename TrialBasis::LocalFiniteElement& tFE = tBasis_.getLocalFiniteElement(*it);
const typename TrialBasis::LocalFiniteElement& tFE = tBasis_.getLocalFiniteElement(element);
LocalVector localB(tFE.localBasis().size());
localAssembler.assemble(*it, localB, tFE);
localAssembler.assemble(element, localB, tFE);
for (size_t i=0; i<tFE.localBasis().size(); ++i)
{
int idx = tBasis_.index(*it, i);
int idx = tBasis_.index(element, i);
const LinearCombination& constraints = tBasis_.constraints(idx);
bool isConstrained = tBasis_.isConstrained(idx);
if (isConstrained)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment