43 const auto &fe = space_dh.
get_fe();
44 const auto max_particles_per_cell =
56 std::vector<unsigned int> space_gtl(fe.n_components(),
58 for (
unsigned int i = 0, j = 0; i < space_gtl.size(); ++i)
76 std::vector<types::global_dof_index> dof_indices(fe.n_dofs_per_cell());
77 std::vector<types::particle_index> particle_indices(
78 max_particles_per_cell * n_comps);
80 auto particle = particle_handler.
begin();
81 while (particle != particle_handler.
end())
83 const auto &cell = particle->get_surrounding_cell();
86 dh_cell->get_dof_indices(dof_indices);
89 particle_indices.resize(n_particles * n_comps);
91 for (
unsigned int i = 0; particle != pic.end(); ++particle, ++i)
93 const auto p_id = particle->get_id();
94 for (
unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j)
97 space_gtl[fe.system_to_component_index(j).first];
100 {p_id * n_comps + comp_j}, {dof_indices[j]}, sparsity);
130 const auto &fe = space_dh.
get_fe();
131 const auto max_particles_per_cell =
146 std::vector<unsigned int> space_gtl(fe.n_components(),
148 for (
unsigned int i = 0, j = 0; i < space_gtl.size(); ++i)
166 std::vector<types::global_dof_index> dof_indices(fe.n_dofs_per_cell());
167 std::vector<types::particle_index> particle_indices(
168 max_particles_per_cell * n_comps);
171 max_particles_per_cell * n_comps, fe.n_dofs_per_cell());
173 auto particle = particle_handler.
begin();
174 while (particle != particle_handler.
end())
176 const auto &cell = particle->get_surrounding_cell();
177 const auto &dh_cell =
179 dh_cell->get_dof_indices(dof_indices);
182 particle_indices.resize(n_particles * n_comps);
183 local_matrix.reinit({n_particles * n_comps, fe.n_dofs_per_cell()});
185 for (
unsigned int i = 0; particle != pic.end(); ++particle, ++i)
187 const auto &reference_location =
188 particle->get_reference_location();
190 for (
unsigned int d = 0; d < n_comps; ++d)
191 particle_indices[i * n_comps + d] =
192 particle->get_id() * n_comps + d;
194 for (
unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j)
197 space_gtl[fe.system_to_component_index(j).first];
199 local_matrix(i * n_comps + comp_j, j) =
200 fe.shape_value(j, reference_location);
void add_entries_local_to_global(const std::vector< size_type > &local_dof_indices, SparsityPatternBase &sparsity_pattern, const bool keep_constrained_entries=true, const Table< 2, bool > &dof_mask=Table< 2, bool >()) const
types::particle_index n_global_particles() const
particle_iterator begin() const
particle_iterator end() const
types::particle_index n_locally_owned_particles() const
types::particle_index n_particles_in_cell(const typename Triangulation< dim, spacedim >::active_cell_iterator &cell) const
particle_iterator_range particles_in_cell(const typename Triangulation< dim, spacedim >::active_cell_iterator &cell)
types::particle_index n_global_max_particles_per_cell() const
void create_interpolation_matrix(const DoFHandler< dim, spacedim > &space_dh, const Particles::ParticleHandler< dim, spacedim > &particle_handler, MatrixType &matrix, const AffineConstraints< typename MatrixType::value_type > &constraints=AffineConstraints< typename MatrixType::value_type >(), const ComponentMask &space_comps={})
void create_interpolation_sparsity_pattern(const DoFHandler< dim, spacedim > &space_dh, const Particles::ParticleHandler< dim, spacedim > &particle_handler, SparsityPatternBase &sparsity, const AffineConstraints< number > &constraints=AffineConstraints< number >(), const ComponentMask &space_comps={})