Commit bad1cbd1 authored by Praetorius, Simon's avatar Praetorius, Simon

Merge branch 'feature/discrete_function_added_asserts' into 'develop'

Added asserts to check if LocalBasisCache data is valid

See merge request !54
parents 623e6515 398274a5
Pipeline #1415 passed with stage
in 26 minutes and 22 seconds
......@@ -153,7 +153,8 @@ LocalFunction::operator()(Domain const& x) const
auto&& localBasis = fe.localBasis();
LocalBasisCache<std::decay_t<decltype(localBasis)>> localBasisCache(localBasis);
auto const& shapeFunctionValues = localBasisCache.evaluateFunction(localView_.element(),x);
auto const& shapeFunctionValues = localBasisCache.evaluateFunction(localView_.element(), x);
assert(shapeFunctionValues.size() == localBasis.size());
// Get range entry associated to this node
auto re = Dune::Functions::flatVectorView(nodeToRangeEntry(node, tp, y));
......@@ -196,14 +197,16 @@ GradientLocalFunction::operator()(Domain const& x) const
forEachLeafNode_(*subTree_, [&,this](auto const& node, auto const& tp)
{
// TODO: may DOFVectorView::Range to FieldVector type if necessary
using LocalDerivativeTraits = Dune::Functions::DefaultDerivativeTraits<Dune::FieldVector<double,1>(Domain)>;
using LocalDerivativeTraits
= Dune::Functions::DefaultDerivativeTraits<Dune::FieldVector<double,1>(Domain)>;
using GradientBlock = typename LocalDerivativeTraits::Range;
auto&& fe = node.finiteElement();
auto&& localBasis = fe.localBasis();
LocalBasisCache<std::decay_t<decltype(localBasis)>> localBasisCache(localBasis);
auto const& referenceGradients = localBasisCache.evaluateJacobian(localView_.element(),x);
auto const& referenceGradients = localBasisCache.evaluateJacobian(localView_.element(), x);
assert(referenceGradients.size() == localBasis.size());
// The transposed inverse Jacobian of the map from the reference element to the element
auto&& jacobian = geometry_.value().jacobianInverseTransposed(x);
......
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