Commit 98e6d63f authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

removed dependency on dune-functions interpolate due to breaking changes

parent cf41b398
...@@ -84,22 +84,22 @@ double calcError(Problem const& prob, Fcts const& funcs) ...@@ -84,22 +84,22 @@ double calcError(Problem const& prob, Fcts const& funcs)
auto& globalBasis = *prob->globalBasis(); auto& globalBasis = *prob->globalBasis();
auto localView = globalBasis.localView(); auto localView = globalBasis.localView();
auto const& sol = prob->solution().coefficients(); auto const& sol = prob->solution().coefficients();
std::vector<double> ref;
ref.resize(globalBasis.dimension()); auto ref = makeDOFVector(globalBasis, DataTransferOperation::NO_OPERATION);
int k = 0; int k = 0;
// interpolate given function onto reference vector // interpolate given function onto reference vector
for_each_leaf_node(localView.tree(), [&](auto const& node, auto tp) for_each_leaf_node(localView.tree(), [&](auto const& node, auto tp)
{ {
auto gf = makeGridFunction(funcs[k], globalBasis.gridView()); auto gf = makeGridFunction(funcs[k], globalBasis.gridView());
Dune::Functions::interpolate(globalBasis, tp, ref, gf); AMDiS::interpolate(globalBasis, ref, gf, tp);
k++; k++;
}); });
// compare the solution with the reference // compare the solution with the reference
double maxError = 0; double maxError = 0;
sol.forEach([&](auto dof, double coeff) { sol.forEach([&](auto dof, double coeff) {
double error = std::abs(ref[dof] - coeff); double error = std::abs(ref.at(dof) - coeff);
maxError = std::max(maxError, error); maxError = std::max(maxError, error);
}); });
return maxError; return maxError;
......
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