Skip to content

Commit

Permalink
FEEvaluation: Place exception about no block vector correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kronbichler committed Feb 12, 2020
1 parent 9398a7d commit e8b83ac
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions include/deal.II/matrix_free/fe_evaluation.h
Expand Up @@ -3799,7 +3799,17 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
Assert(matrix_info->indices_initialized() == true, ExcNotInitialized());
if (n_fe_components == 1)
for (unsigned int comp = 0; comp < n_components; ++comp)
internal::check_vector_compatibility(*src[comp], *dof_info);
{
Assert(src[comp] != nullptr,
ExcMessage("The finite element underlying this FEEvaluation "
"object is scalar, but you requested " +
std::to_string(n_components) +
" components via the template argument in "
"FEEvaluation. In that case, you must pass an "
"std::vector<VectorType> or a BlockVector to " +
"read_dof_values and distribute_local_to_global."));
internal::check_vector_compatibility(*src[comp], *dof_info);
}
else
{
internal::check_vector_compatibility(*src[0], *dof_info);
Expand Down Expand Up @@ -4049,17 +4059,6 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::

if (n_components == 1 || n_fe_components == 1)
{
for (unsigned int c = 0; c < n_components; ++c)
Assert(src[c] != nullptr,
ExcMessage(
"The finite element underlying this FEEvaluation "
"object is scalar, but you requested " +
std::to_string(n_components) +
" components via the template argument in "
"FEEvaluation. In that case, you must pass an "
"std::vector<VectorType> or a BlockVector to " +
"read_dof_values and distribute_local_to_global."));

unsigned int ind_local = 0;
for (; index_indicators != next_index_indicators; ++index_indicators)
{
Expand Down

0 comments on commit e8b83ac

Please sign in to comment.