From: Peter Munch Date: Mon, 10 May 2021 14:44:03 +0000 (+0200) Subject: FEPointEvaluation: check if evaluation points are provided X-Git-Tag: v9.3.0-rc1~107^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12169%2Fhead;p=dealii.git FEPointEvaluation: check if evaluation points are provided --- diff --git a/include/deal.II/fe/fe_point_evaluation.h b/include/deal.II/fe/fe_point_evaluation.h index d756d71528..53d87bad3d 100644 --- a/include/deal.II/fe/fe_point_evaluation.h +++ b/include/deal.II/fe/fe_point_evaluation.h @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -611,6 +612,13 @@ FEPointEvaluation::evaluate( const ArrayView & solution_values, const EvaluationFlags::EvaluationFlags & evaluation_flag) { + if (unit_points.size() == 0) // no evaluation points provided + { + values.clear(); + gradients.clear(); + return; + } + AssertDimension(solution_values.size(), fe->dofs_per_cell); if (((evaluation_flag & EvaluationFlags::values) || (evaluation_flag & EvaluationFlags::gradients)) && @@ -747,6 +755,9 @@ FEPointEvaluation::integrate( const ArrayView & solution_values, const EvaluationFlags::EvaluationFlags & integration_flags) { + if (unit_points.size() == 0) // no evaluation points provided + return; + AssertDimension(solution_values.size(), fe->dofs_per_cell); if (false /*TODO*/ && (((integration_flags & EvaluationFlags::values) || (integration_flags & EvaluationFlags::gradients)) &&