diff --git a/dune/gdt/local/discretefunction.hh b/dune/gdt/local/discretefunction.hh index 80a2871887ea892e4e090194d040dd33e5904ade..e1b14e089004c56554a8b797b873c2169c0ab795 100644 --- a/dune/gdt/local/discretefunction.hh +++ b/dune/gdt/local/discretefunction.hh @@ -127,6 +127,7 @@ public: RangeReturnType evaluate(const DomainType& point_in_reference_element, const XT::Common::Parameter& param = {}) const override final { + DUNE_THROW_IF(!basis_, Exceptions::not_bound_to_an_element_yet, "you need to call bind() first!"); RangeReturnType result(0); if (space_.type() == GDT::SpaceType::finite_volume) { for (size_t ii = 0; ii < r; ++ii) @@ -142,6 +143,7 @@ public: DerivativeRangeReturnType jacobian(const DomainType& point_in_reference_element, const XT::Common::Parameter& param = {}) const override final { + DUNE_THROW_IF(!basis_, Exceptions::not_bound_to_an_element_yet, "you need to call bind() first!"); DerivativeRangeReturnType result(0); if (space_.type() == GDT::SpaceType::finite_volume) { return result; @@ -157,6 +159,7 @@ public: const DomainType& point_in_reference_element, const XT::Common::Parameter& /*param*/ = {}) const override final { + DUNE_THROW_IF(!basis_, Exceptions::not_bound_to_an_element_yet, "you need to call bind() first!"); DerivativeRangeReturnType result(0); if (space_.type() == GDT::SpaceType::finite_volume) { for (size_t jj = 0; jj < d; ++jj)