46 const auto &fe = space_dh.
get_fe();
47 const auto max_particles_per_cell =
59 std::vector<unsigned int> space_gtl(fe.n_components(),
61 for (
unsigned int i = 0, j = 0; i < space_gtl.size(); ++i)
79 std::vector<types::global_dof_index> dof_indices(fe.n_dofs_per_cell());
80 std::vector<types::particle_index> particle_indices(
81 max_particles_per_cell * n_comps);
83 auto particle = particle_handler.
begin();
84 while (particle != particle_handler.
end())
86 const auto &cell = particle->get_surrounding_cell();
89 dh_cell->get_dof_indices(dof_indices);
92 particle_indices.resize(n_particles * n_comps);
94 for (; particle != pic.end(); ++particle)
96 const auto p_id = particle->get_id();
97 for (
unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j)
100 space_gtl[fe.system_to_component_index(j).first];
103 {p_id * n_comps + comp_j}, {dof_indices[j]}, sparsity);
133 const auto &fe = space_dh.
get_fe();
134 const auto max_particles_per_cell =
149 std::vector<unsigned int> space_gtl(fe.n_components(),
151 for (
unsigned int i = 0, j = 0; i < space_gtl.size(); ++i)
169 std::vector<types::global_dof_index> dof_indices(fe.n_dofs_per_cell());
170 std::vector<types::particle_index> particle_indices(
171 max_particles_per_cell * n_comps);
174 max_particles_per_cell * n_comps, fe.n_dofs_per_cell());
176 auto particle = particle_handler.
begin();
177 while (particle != particle_handler.
end())
179 const auto &cell = particle->get_surrounding_cell();
180 const auto &dh_cell =
182 dh_cell->get_dof_indices(dof_indices);
185 particle_indices.resize(n_particles * n_comps);
186 local_matrix.reinit({n_particles * n_comps, fe.n_dofs_per_cell()});
188 for (
unsigned int i = 0; particle != pic.end(); ++particle, ++i)
190 const auto &reference_location =
191 particle->get_reference_location();
193 for (
unsigned int d = 0; d < n_comps; ++d)
194 particle_indices[i * n_comps + d] =
195 particle->get_id() * n_comps + d;
197 for (
unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j)
200 space_gtl[fe.system_to_component_index(j).first];
202 local_matrix(i * n_comps + comp_j, j) =
203 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={})