diff --git a/include/numerics/analytic_function.h b/include/numerics/analytic_function.h index 9dfbb27ded..ecaae0f23f 100644 --- a/include/numerics/analytic_function.h +++ b/include/numerics/analytic_function.h @@ -111,7 +111,10 @@ inline Output AnalyticFunction::operator() (const Point & p, const Real time) { - libmesh_assert (this->initialized()); + libmesh_assert(this->initialized()); + libmesh_assert_msg(_number_fptr, + "You must construct AnalyticFunction with a scalar-valued " + "function in order to use this operator() override."); return (this->_number_fptr(p, time)); } @@ -123,7 +126,10 @@ void AnalyticFunction::operator() (const Point & p, const Real time, DenseVector & output) { - libmesh_assert (this->initialized()); + libmesh_assert(this->initialized()); + libmesh_assert_msg(_vector_fptr, + "You must construct AnalyticFunction with a vector-valued " + "function in order to use this operator() override."); this->_vector_fptr(output, p, time); return; }