Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
solid_constraints.h File Reference
#include <deal.II/base/types.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/lac/affine_constraints.h>
#include <vector>
Include dependency graph for solid_constraints.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<int dim>
void constrain_solid_cell_velocity_dofs (const dealii::FiniteElement< dim > &fe, const std::vector< dealii::types::global_dof_index > &local_dof_indices, const bool &non_zero_constraints, dealii::AffineConstraints< double > &constraints)
template<int dim, typename DofsType>
void establish_solid_domain (const dealii::DoFHandler< dim > &dof_handler, const DofsType &locally_owned_dofs, const bool non_zero_constraints, dealii::AffineConstraints< double > &constraints)
template<int dim>
void establish_solid_domain_lsmg (const dealii::DoFHandler< dim > &dof_handler, const unsigned int level, const dealii::IndexSet &locally_owned_mg_dofs, const bool non_zero_constraints, dealii::AffineConstraints< double > &constraints)

Function Documentation

◆ constrain_solid_cell_velocity_dofs()

template<int dim>
void constrain_solid_cell_velocity_dofs ( const dealii::FiniteElement< dim > & fe,
const std::vector< dealii::types::global_dof_index > & local_dof_indices,
const bool & non_zero_constraints,
dealii::AffineConstraints< double > & constraints )

Constrain velocity DOFs of a solid cell.

Parameters
[in]feFinite element used to extract the different components. Inherently, we assume that this fe has dim+1 component and corresponds to a Navier-Stokes problem.
[in]local_dof_indicesVector of a cell's local DOF indices.
[in]non_zero_constraintsIf this parameter is true, it indicates that the constraints used are non-zero constraints. If this is set to false, the constraints are zero constraints.
[out]constraintsHomogeneous constraints holding object.

◆ establish_solid_domain()

template<int dim, typename DofsType>
void establish_solid_domain ( const dealii::DoFHandler< dim > & dof_handler,
const DofsType & locally_owned_dofs,
const bool non_zero_constraints,
dealii::AffineConstraints< double > & constraints )

Turn regions of the mesh where the material_id>0 into a solid block by injecting velocity and pressure DOFs into the constraints.

It is achieved by imposing \(\mathbf{u}=0\) within the cells which have a material_id>0. In addition, solid cells which are not connected to the fluid by any means also get a pressure Dirichlet boundary condition which fixes the pressure to 0. It ensures that the linear system is well-posed. Right now, this routine only supports the usage of 1 solid domain, but eventually it could be extended to more than one. By default, the fluid domain is assumed to have a material_id=0 and the rest of the domains have a material_id>0.

Parameters
[in]dof_handlerDoFHandler for which the solid region is established. In the majority of cases this is the DoFHandler that is a member of this class, but if a multigrid preconditioner, constraints must be built at every level. In this case, this DoFHandler can be the DoFHandler at any of the multigrid level.
[in]locally_owned_dofsThe locally owned DoFs for the dof_handler. Used to filter pressure DoFs that should receive a Dirichlet constraint when their cell is fully disconnected from the fluid.
[in]non_zero_constraintsIf this parameter is true, it indicates that the constraints used for the solid domain are the non-zero constraints. If this is set to false, the constraints being used are zero constraints.
[in]constraintsSet of constraints on which the solid domain constraint is applied.

◆ establish_solid_domain_lsmg()

template<int dim>
void establish_solid_domain_lsmg ( const dealii::DoFHandler< dim > & dof_handler,
const unsigned int level,
const dealii::IndexSet & locally_owned_mg_dofs,
const bool non_zero_constraints,
dealii::AffineConstraints< double > & constraints )

Multigrid-level variant of establish_solid_domain for the local smoothing multigrid (LSMG) preconditioner.

Unlike the active-cell version above, this overload walks the cells of a specific multigrid level using mg_cell_iterators_on_level and uses get_mg_dof_indices, so the DOF indices it adds to the constraint object match the multigrid-level IndexSet with which constraints was reinit'd (i.e. locally_owned_mg_dofs(level) and the corresponding locally relevant level DoFs). Using the active-cell version on an LSMG level constraint object triggers the local_lines.is_element(line_n) assertion inside AffineConstraints::add_line because active and MG DoF numberings are unrelated.

The material_id is inherited from active cells by their parents on coarser levels, so the solid/fluid classification is well defined on MG levels.

Parameters
[in]dof_handlerDoFHandler distributed with distribute_mg_dofs.
[in]levelMultigrid level on which constraints are built.
[in]locally_owned_mg_dofsThe locally owned MG DoFs on level (i.e. dof_handler.locally_owned_mg_dofs(level)). Used to filter pressure DoFs that should receive a Dirichlet constraint when their cell is fully disconnected from the fluid.
[in]non_zero_constraintsIf true, set inhomogeneous (zero-valued) constraints; otherwise add homogeneous constraints.
[in,out]constraintsLevel constraint object to populate.