Commit 821702ee authored by Ansgar Burchardt's avatar Ansgar Burchardt

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

use range-based for

See merge request !49
parents c2f66bc5 3108d979
Pipeline #17160 failed with stage
in 62 minutes and 39 seconds
......@@ -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
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)
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