@@ -455,11 +455,7 @@ evaluate(FieldElement &fes, Kokkos::View<Real **> localCoords,
455455 " to evaluate(...) were invalid\n " );
456456 }
457457 }
458- if (localCoords.extent (0 ) < fes.numMeshEnts ) {
459- fail (" The size of dimension 0 of the local coordinates input array "
460- " must be at least %zu.\n " ,
461- fes.numMeshEnts );
462- }
458+
463459 if (localCoords.extent (1 ) != fes.MeshEntDim + 1 ) {
464460 fail (" Dimension 1 of the input array of local coordinates "
465461 " must have size = %zu.\n " ,
@@ -469,6 +465,15 @@ evaluate(FieldElement &fes, Kokkos::View<Real **> localCoords,
469465 fail (" The input array of offsets must have size = %zu\n " ,
470466 fes.numMeshEnts + 1 );
471467 }
468+ LO numLocalCoords;
469+ Kokkos::deep_copy (numLocalCoords,
470+ Kokkos::subview (offsets, offsets.size () - 1 ));
471+ if (localCoords.extent (0 ) != numLocalCoords) {
472+ fail (" The size of dimension 0 of the local coordinates input array (%zu) "
473+ " does not match the last entry of the offsets array (%zu).\n " ,
474+ localCoords.extent (0 ), numLocalCoords);
475+ }
476+
472477 constexpr const auto numComponents = FieldElement::ValArray::size ();
473478 const auto numPts = MeshFieldUtil::getLastValue (offsets);
474479 Kokkos::View<Real *[numComponents]> res (" result" , numPts);
0 commit comments