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.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(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.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);
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.n_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.n_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.n_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.n_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"
void distribute_local_to_global(const InVector &local_vector, const std::vector< size_type > &local_dof_indices, OutVector &global_vector) const
void add_entries_local_to_global(const std::vector< size_type > &local_dof_indices, SparsityPatternType &sparsity_pattern, const bool keep_constrained_entries=true, const Table< 2, bool > &dof_mask=Table< 2, bool >()) const
unsigned int size() const
unsigned int n_selected_components(const unsigned int overall_number_of_components=numbers::invalid_unsigned_int) const
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
const Triangulation< dim, spacedim > & get_triangulation() const
types::global_dof_index n_dofs() 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
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
typename ActiveSelector::cell_iterator cell_iterator
@ matrix
Contents is actually a matrix.
void create_interpolation_sparsity_pattern(const DoFHandler< dim, spacedim > &space_dh, const Particles::ParticleHandler< dim, spacedim > &particle_handler, SparsityType &sparsity, const AffineConstraints< number > &constraints=AffineConstraints< number >(), const ComponentMask &space_comps=ComponentMask())
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=ComponentMask())
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
static const unsigned int invalid_unsigned_int