30 template <
int dim,
int spacedim,
typename SparsityType,
typename number>
35 SparsityType & sparsity,
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.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(tria);
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.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);
113 template <
int dim,
int spacedim,
typename MatrixType>
131 const auto &fe = space_dh.
get_fe();
132 const auto max_particles_per_cell =
147 std::vector<unsigned int> space_gtl(fe.n_components(),
149 for (
unsigned int i = 0, j = 0; i < space_gtl.size(); ++i)
167 std::vector<types::global_dof_index> dof_indices(fe.dofs_per_cell);
168 std::vector<types::particle_index> particle_indices(
169 max_particles_per_cell * n_comps);
172 max_particles_per_cell * n_comps, fe.dofs_per_cell);
174 auto particle = particle_handler.
begin();
175 while (particle != particle_handler.
end())
177 const auto &cell = particle->get_surrounding_cell(tria);
178 const auto &dh_cell =
180 dh_cell->get_dof_indices(dof_indices);
183 particle_indices.resize(n_particles * n_comps);
184 local_matrix.
reinit({n_particles * n_comps, fe.dofs_per_cell});
186 for (
unsigned int i = 0; particle != pic.end(); ++particle, ++i)
188 const auto &reference_location =
189 particle->get_reference_location();
191 for (
unsigned int d = 0;
d < n_comps; ++
d)
192 particle_indices[i * n_comps +
d] =
193 particle->get_id() * n_comps +
d;
195 for (
unsigned int j = 0; j < fe.dofs_per_cell; ++j)
198 space_gtl[fe.system_to_component_index(j).first];
200 local_matrix(i * n_comps + comp_j, j) =
201 fe.shape_value(j, reference_location);
212 #include "utilities.inst"