195 const InputVectorType &field_vector,
196 OutputVectorType &interpolated_field,
205 const auto &fe = field_dh.
get_fe();
206 auto particle = particle_handler.
begin();
210 (field_comps.size() == 0 ?
ComponentMask(fe.n_components(),
true) :
221 std::vector<unsigned int> space_gtl(fe.n_components(),
223 for (
unsigned int i = 0, j = 0; i < space_gtl.size(); ++i)
227 std::vector<types::global_dof_index> dof_indices(fe.n_dofs_per_cell());
229 while (particle != particle_handler.
end())
231 const auto &cell = particle->get_surrounding_cell();
232 const auto &dh_cell =
234 dh_cell->get_dof_indices(dof_indices);
238 for (
unsigned int i = 0; particle != pic.end(); ++particle, ++i)
241 particle->get_reference_location();
243 const auto id = particle->get_id();
245 for (
unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j)
248 space_gtl[fe.system_to_component_index(j).first];
250 interpolated_field[
id * n_comps + comp_j] +=
251 fe.shape_value(j, reference_location) *
252 field_vector(dof_indices[j]);
316 const InputVectorType &field_vector,
317 OutputVectorType &interpolated_field,
320 (ReferenceCells::get_hypercube<dim>()
322 .template get_default_linear_mapping<spacedim>()
324 .ReferenceCell<dim>::get_default_linear_mapping<spacedim>()
337 const auto &fe = field_dh.
get_fe();
338 auto particle = particle_handler.
begin();
342 (field_comps.size() == 0 ?
ComponentMask(n_components,
true) :
352 std::vector<types::global_dof_index> dof_indices(fe.n_dofs_per_cell());
359 std::vector<Point<dim>> particle_reference_locations;
360 std::vector<types::particle_index> particle_indices;
363 while (particle != particle_handler.
end())
365 const auto &cell = particle->get_surrounding_cell();
366 const auto &dh_cell =
368 dh_cell->get_dof_indices(dof_indices);
369 dh_cell->get_dof_values(field_vector, local_dof_values);
375 particle_reference_locations.clear();
376 particle_indices.clear();
377 for (
const auto &p : pic)
379 particle_reference_locations.emplace_back(
380 p.get_reference_location());
381 particle_indices.emplace_back(p.get_id());
384 evaluator.reinit(cell, particle_reference_locations);
387 for (
unsigned int particle_index = 0; particle != pic.end();
393 if constexpr (n_components == 1)
399 interpolated_field[global_particle_id] =
400 evaluator.get_value(particle_index);
404 unsigned int j_comp = 0;
405 for (
unsigned int j = 0; j < n_components; ++j)
409 interpolated_field[global_particle_id *
412 evaluator.get_value(particle_index)[j];