Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
ParticleFieldQCM< dim, n_components, property_start_index > Class Template Reference

#include <particle_projector.h>

Public Member Functions

 ParticleFieldQCM (parallel::DistributedTriangulationBase< dim > *triangulation, const unsigned int fe_degree, const bool simplex, const bool neumann_boundaries, const bool conservative_projection)
void setup_dofs ()

Public Attributes

std::shared_ptr< DoFHandler< dim > > dof_handler
LinearAlgebra::distributed::Vector< double > particle_field_solution
std::shared_ptr< FESystem< dim > > fe
IndexSet locally_owned_dofs
IndexSet locally_relevant_dofs
TrilinosWrappers::SparseMatrix system_matrix
LinearAlgebra::distributed::Vector< double > system_rhs
AffineConstraints< double > particle_field_constraints
std::shared_ptr< TrilinosWrappers::PreconditionILU > ilu_preconditioner
const bool neumann_boundaries
const bool conservative_projection
bool matrix_requires_assembly
bool multigrid_level_dofs_required = false

Detailed Description

template<int dim, int n_components, int property_start_index = -1>
class ParticleFieldQCM< dim, n_components, property_start_index >

ParticleFieldQCM calculator. This class stores the required information for the calculation of a field or a particle-fluid interaction onto a mesh. This class does not solve any equation, but compartmentalize the necessary information for the projection of the particle field or interaction onto a mesh. Multiple instances of this function can be called to establish new projections.In the case of a particle-fluid interaction, there is no particle field to project and, consequently, the property_start_index parameter is given an invalid default value (-1).

Template Parameters
dimAn integer that denotes the number of spatial dimensions.
n_componentsThe number of components in the field. This number should be either 1 (a scalar) or dim (a Tensor<1,dim>)
property_start_indexAn integer that indicates at which particle property the field starts. If the propery_start_index is negative, then there is no property start and this project is not used to project a particle field.

Definition at line 153 of file particle_projector.h.

Constructor & Destructor Documentation

◆ ParticleFieldQCM()

template<int dim, int n_components, int property_start_index = -1>
ParticleFieldQCM< dim, n_components, property_start_index >::ParticleFieldQCM ( parallel::DistributedTriangulationBase< dim > * triangulation,
const unsigned int fe_degree,
const bool simplex,
const bool neumann_boundaries,
const bool conservative_projection )
inline

Constructor.

Parameters
triangulationThe triangulation on which the particles reside
fe_degreeThe finite element degree used to interpolate the field
simplexA flag to indicate if the simulations are being done with simplex elements.
neumann_boundariesA flag to indicate what to do with cells that do not contain particles. If the neumann_boundaries is set to true, then cells without particles do not have a mass matrix assembled. This corresponds to setting a neumann boundary at the cells which do not contain particles.
conservative_projectionA flag to indicate if the projection of the field must be conservative. When a projection is conservative, the integral of the field over the triangulation will be strictly equal to the field summed over all particles. This is useful when projecting a quantity such as the force acting on the particles. When conservative is put to false, the projection is meant to be a smooth representation of the particle information and does not conserve it.

Definition at line 174 of file particle_projector.h.

References conservative_projection, dof_handler, fe, matrix_requires_assembly, and neumann_boundaries.

Member Function Documentation

◆ setup_dofs()

template<int dim, int n_components, int component_start>
void ParticleFieldQCM< dim, n_components, component_start >::setup_dofs ( )

Setup the degrees of freedom. This function allocates the necessary memory.

Definition at line 34 of file particle_projector.cc.

References dof_handler, fe, locally_owned_dofs, locally_relevant_dofs, matrix_requires_assembly, multigrid_level_dofs_required, particle_field_constraints, particle_field_solution, system_matrix, and system_rhs.

Member Data Documentation

◆ conservative_projection

template<int dim, int n_components, int property_start_index = -1>
const bool ParticleFieldQCM< dim, n_components, property_start_index >::conservative_projection

Boolean that indicates if the projection is conservative. If the projection is conservative, the integral over the domain of the field will recover the sum of the field over all particles.

Definition at line 238 of file particle_projector.h.

◆ dof_handler

template<int dim, int n_components, int property_start_index = -1>
std::shared_ptr<DoFHandler<dim> > ParticleFieldQCM< dim, n_components, property_start_index >::dof_handler

DoFHandler that manages the particle field. It is stored as a shared pointer so that it can be provided to the multiphysics interface.

Definition at line 198 of file particle_projector.h.

◆ fe

template<int dim, int n_components, int property_start_index = -1>
std::shared_ptr<FESystem<dim> > ParticleFieldQCM< dim, n_components, property_start_index >::fe

Finite element for the particle field.

Definition at line 204 of file particle_projector.h.

◆ ilu_preconditioner

template<int dim, int n_components, int property_start_index = -1>
std::shared_ptr<TrilinosWrappers::PreconditionILU> ParticleFieldQCM< dim, n_components, property_start_index >::ilu_preconditioner

Preconditioner used when solving the L2 projection. This preconditioner is stored within the class since there are situations where the matrix is kept for multiple iterations. Consequently, there is no point in reassembling the preconditioner for these iterations.

Definition at line 227 of file particle_projector.h.

◆ locally_owned_dofs

template<int dim, int n_components, int property_start_index = -1>
IndexSet ParticleFieldQCM< dim, n_components, property_start_index >::locally_owned_dofs

Index set for the locally owned degree of freedoms.

Definition at line 207 of file particle_projector.h.

◆ locally_relevant_dofs

template<int dim, int n_components, int property_start_index = -1>
IndexSet ParticleFieldQCM< dim, n_components, property_start_index >::locally_relevant_dofs

Index set for the locally relevant degree of freedoms.

Definition at line 210 of file particle_projector.h.

◆ matrix_requires_assembly

template<int dim, int n_components, int property_start_index = -1>
bool ParticleFieldQCM< dim, n_components, property_start_index >::matrix_requires_assembly

When a projection does not have neumann_boundaries, the matrix for the system is constant in time. Consequently, there is no point in assembling the matrix and initializing the preconditioner. This flag monitors if the matrix has already been assembled. It is reset every time setup_dofs() is called for the projector.

Definition at line 245 of file particle_projector.h.

◆ multigrid_level_dofs_required

template<int dim, int n_components, int property_start_index = -1>
bool ParticleFieldQCM< dim, n_components, property_start_index >::multigrid_level_dofs_required = false

When set to true, setup_dofs() will additionally call distribute_mg_dofs() on the underlying DoFHandler. This is required by local-smoothing multigrid (LSMG) so that the field can be interpolated to every triangulation level.

Definition at line 251 of file particle_projector.h.

◆ neumann_boundaries

template<int dim, int n_components, int property_start_index = -1>
const bool ParticleFieldQCM< dim, n_components, property_start_index >::neumann_boundaries

Boolean that indicates if Neumann boundary conditions are used during the projection In this case, instead of assuming a value of zero if there are no particles, the mass matrix is cancelled in region without particles which results in a no flux zone.

Definition at line 233 of file particle_projector.h.

◆ particle_field_constraints

template<int dim, int n_components, int property_start_index = -1>
AffineConstraints<double> ParticleFieldQCM< dim, n_components, property_start_index >::particle_field_constraints

Constraints used for the boundary conditions of the particle field.

Definition at line 221 of file particle_projector.h.

◆ particle_field_solution

template<int dim, int n_components, int property_start_index = -1>
LinearAlgebra::distributed::Vector<double> ParticleFieldQCM< dim, n_components, property_start_index >::particle_field_solution

deal.II vector for the particle field solution.

Definition at line 201 of file particle_projector.h.

◆ system_matrix

template<int dim, int n_components, int property_start_index = -1>
TrilinosWrappers::SparseMatrix ParticleFieldQCM< dim, n_components, property_start_index >::system_matrix

System matrix used to assemble the smoothed L2 projection of the void fraction

Definition at line 214 of file particle_projector.h.

◆ system_rhs

template<int dim, int n_components, int property_start_index = -1>
LinearAlgebra::distributed::Vector<double> ParticleFieldQCM< dim, n_components, property_start_index >::system_rhs

Right-hand side used to assemble the smoothed L2 projection of the void fraction

Definition at line 218 of file particle_projector.h.


The documentation for this class was generated from the following files: