![]() |
Reference documentation for deal.II version 9.5.1
|
Functions | |
template<int dim, int spacedim, typename number = double> | |
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=ComponentMask()) |
template<int dim, int spacedim, typename MatrixType > | |
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()) |
template<int dim, int spacedim, typename InputVectorType , typename OutputVectorType > | |
void | interpolate_field_on_particles (const DoFHandler< dim, spacedim > &field_dh, const Particles::ParticleHandler< dim, spacedim > &particle_handler, const InputVectorType &field_vector, OutputVectorType &interpolated_field, const ComponentMask &field_comps=ComponentMask()) |
A namespace for functions offering tools to handle ParticleHandler objects and their coupling with DoFHandler objects.
void Particles::Utilities::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 = ComponentMask() ) |
Create an interpolation sparsity pattern for particles.
Given a triangulation representing the domain
where space_dh
, and the index i
is given by the particle id whose position is x_i
.
In the case of vector valued finite element spaces, the components on which interpolation must be performed can be selected using a component mask. Only primitive finite element spaces are supported.
When selecting more than one component, the resulting sparsity will have dimension equal to particle_handler.n_global_particles() * mask.n_selected_components()
times space_dh.n_dofs()
, and the corresponding matrix entries are given by
where comp_j
is the only non zero component of the vector valued basis function v_j
(equal to fe.system_to_component_index(j).first
), k
corresponds to its index within the selected components of the mask, and comp_j
.
The sparsity
is filled by locating the position of the particle with index i
within the particle handler with respect to the embedding triangulation space_comps
, following the ordering in which they are selected in the mask space_comps
.
If a particle does not fall within
Constraints of the form supported by the AffineConstraints class may be supplied with the constraints
argument. The method AffineConstraints::add_entries_local_to_global() is used to fill the final sparsity pattern.
Definition at line 32 of file utilities.cc.
void Particles::Utilities::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() ) |
Create an interpolation matrix for particles.
Given a triangulation representing the domains
where space_dh
, and the index i
is given by the particle id whose position is x_i
.
In the case of vector valued finite element spaces, the components on which interpolation must be performed can be selected using a component mask. Only primitive finite element spaces are supported.
When selecting more than one component, the resulting sparsity will have dimension equal to particle_handler.n_global_particles() * mask.n_selected_components()
times space_dh.n_dofs()
, and the corresponding matrix entries are given by
where comp_j
is the only non zero component of the vector valued basis function v_j
(equal to fe.system_to_component_index(j).first
), k
corresponds to its index within the selected components of the mask, and comp_j
.
The matrix is filled by locating the position of the particle with index i
within the particle handler with respect to the embedding triangulation space_comps
, following the ordering in which they are selected in the mask space_comps
.
If a particle does not fall within
Constraints of the form supported by the AffineConstraints class may be supplied with the constraints
argument. The method AffineConstraints::distribute_local_to_global() is used to distribute the entries of the matrix to respect the given constraints.
Definition at line 114 of file utilities.cc.
void Particles::Utilities::interpolate_field_on_particles | ( | const DoFHandler< dim, spacedim > & | field_dh, |
const Particles::ParticleHandler< dim, spacedim > & | particle_handler, | ||
const InputVectorType & | field_vector, | ||
OutputVectorType & | interpolated_field, | ||
const ComponentMask & | field_comps = ComponentMask() ) |
Given a DoFHandler and a ParticleHandler, interpolate a vector field at the position of the particles. The result is stored in an output vector whose size corresponds to the number of locally owned particles * number of active components
[in] | field_dh | The DOF Handler which was used to generate the field vector that is to be interpolated. |
[in] | particle_handler | The particle handler whose particle serve as the interpolation points. |
[in] | field_vector | The vector of the field to be interpolated. This vector must be coherent with the dof_handler provided |
[in,out] | interpolated_field | The interpolated value of the field at the position of the particles. The size of the vector must be n_locally_owned_particles times the n_components |
[in] | field_comps | An optional component mask that decides which subset of the vector fields are interpolated |
Definition at line 184 of file utilities.h.