154 std::span<const std::int32_t> entities,
155 std::span<scalar_type> values,
156 std::array<std::size_t, 2> vshape)
const
159 if (mesh.topology()->dim() == _x_ref.second[1])
163 else if (mesh.topology()->dim() == _x_ref.second[1] + 1)
169 throw std::runtime_error(
"Invalid dimension of evaluation points.");
173 const std::vector<scalar_type> constant_data =
pack_constants(*
this);
177 auto x_dofmap = mesh.geometry().dofmap();
180 auto& cmap = mesh.geometry().cmap();
182 const std::size_t num_dofs_g = cmap.dim();
183 auto x_g = mesh.geometry().x();
186 std::vector<geometry_type> coord_dofs(3 * num_dofs_g);
188 int num_argument_dofs = 1;
189 std::span<const std::uint32_t> cell_info;
190 std::function<void(std::span<scalar_type>, std::span<const std::uint32_t>,
193 = [](std::span<scalar_type>, std::span<const std::uint32_t>,
199 if (_argument_function_space)
202 = _argument_function_space->dofmap()->element_dof_layout().num_dofs();
203 auto element = _argument_function_space->element();
206 if (element->needs_dof_transformations())
208 mesh.topology_mutable()->create_entity_permutations();
209 cell_info = std::span(mesh.topology()->get_cell_permutation_info());
211 = element->template dof_transformation_right_fn<scalar_type>(
217 std::function<
const std::int32_t*(std::span<const std::int32_t>,
220 = []([[maybe_unused]] std::span<const std::int32_t> entities,
221 [[maybe_unused]] std::size_t idx) {
return nullptr; };
225 = [](std::span<const std::int32_t> entities, std::size_t idx)
226 {
return entities.data() + 2 * idx + 1; };
230 const int size0 = _x_ref.second[0] *
value_size();
231 std::vector<scalar_type> values_local(size0 * num_argument_dofs, 0);
232 for (std::size_t e = 0; e < entities.size() / estride; ++e)
234 const std::int32_t entity = entities[e * estride];
235 auto x_dofs = MDSPAN_IMPL_STANDARD_NAMESPACE::submdspan(
236 x_dofmap, entity, MDSPAN_IMPL_STANDARD_NAMESPACE::full_extent);
237 for (std::size_t i = 0; i < x_dofs.size(); ++i)
239 std::copy_n(std::next(x_g.begin(), 3 * x_dofs[i]), 3,
240 std::next(coord_dofs.begin(), 3 * i));
243 const scalar_type* coeff_cell = coeffs.data() + e * cstride;
244 const int* entity_index = get_entity_index(entities, e);
246 std::fill(values_local.begin(), values_local.end(), 0);
247 _fn(values_local.data(), coeff_cell, constant_data.data(),
248 coord_dofs.data(), entity_index,
nullptr);
250 post_dof_transform(values_local, cell_info, e, size0);
251 for (std::size_t j = 0; j < values_local.size(); ++j)
252 values[e * vshape[1] + j] = values_local[j];