MatrixFree Namespace Reference

Developer Documentation: MeltPoolDG::Utilities::MatrixFree Namespace Reference
Developer Documentation
MeltPoolDG::Utilities::MatrixFree Namespace Reference

Typedefs

template<typename number = double>
using VectorType = dealii::LinearAlgebra::distributed::Vector< number >
 
template<typename number = double>
using BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector< number >
 

Functions

template<int dim, typename number = double, typename DoFVectorType = VectorType<number>, typename SrcRhsVectorType = VectorType<number>, typename std::enable_if_t< std::is_same_v< DoFVectorType, VectorType< number > >, int > = 0>
void create_rhs_and_apply_dirichlet_matrixfree (OperatorMatrixFree< dim, number > &operator_base, DoFVectorType &rhs, const SrcRhsVectorType &src, const ScratchData< dim, dim, number > &scratch_data, const unsigned int dof_idx, const unsigned int dof_no_bc_idx, const bool zero_out, const std::optional< std::pair< std::vector< unsigned int >, std::vector< number > > > &additional_inhomogeneous_constraints=std::nullopt)
 
template<int dim, typename number = double, typename DoFVectorType = BlockVectorType<number>, typename SrcRhsVectorType = VectorType<number>, typename std::enable_if_t< std::is_same_v< DoFVectorType, BlockVectorType< number > >, int > = 0>
void create_rhs_and_apply_dirichlet_matrixfree (OperatorMatrixFree< dim, number > &operator_base, DoFVectorType &rhs, const SrcRhsVectorType &src, const ScratchData< dim, dim, number > &scratch_data, const std::array< unsigned int, dim > &dof_indices_per_block, const unsigned int &dof_no_bc_idx, const bool zero_out, const std::optional< std::pair< std::vector< unsigned int >, std::vector< std::vector< number > > > > &additional_inhomogeneous_constraints=std::nullopt)
 Compute the modified right-hand side for (inhomogeneous) dirichlet boundary conditions \( x_d \), as above, but for BlockVector solutions with component-wise DoF indices.
 
template<int dim, int n_components, typename number >
void local_apply_inverse_mass_matrix (const dealii::MatrixFree< dim, number > &matrix_free, VectorType< number > &dst, const VectorType< number > &src, const std::pair< unsigned int, unsigned int > &cell_range, const unsigned int dof_idx, const unsigned int quad_idx)
 

Typedef Documentation

◆ BlockVectorType

template<typename number = double>
using MeltPoolDG::Utilities::MatrixFree::BlockVectorType = typedef dealii::LinearAlgebra::distributed::BlockVector<number>

◆ VectorType

template<typename number = double>
using MeltPoolDG::Utilities::MatrixFree::VectorType = typedef dealii::LinearAlgebra::distributed::Vector<number>

Function Documentation

◆ create_rhs_and_apply_dirichlet_matrixfree() [1/2]

template<int dim, typename number = double, typename DoFVectorType = BlockVectorType<number>, typename SrcRhsVectorType = VectorType<number>, typename std::enable_if_t< std::is_same_v< DoFVectorType, BlockVectorType< number > >, int > = 0>
void MeltPoolDG::Utilities::MatrixFree::create_rhs_and_apply_dirichlet_matrixfree ( OperatorMatrixFree< dim, number > &  operator_base,
DoFVectorType &  rhs,
const SrcRhsVectorType &  src,
const ScratchData< dim, dim, number > &  scratch_data,
const std::array< unsigned int, dim > &  dof_indices_per_block,
const unsigned int &  dof_no_bc_idx,
const bool  zero_out,
const std::optional< std::pair< std::vector< unsigned int >, std::vector< std::vector< number > > > > &  additional_inhomogeneous_constraints = std::nullopt 
)
inline

Compute the modified right-hand side for (inhomogeneous) dirichlet boundary conditions \( x_d \), as above, but for BlockVector solutions with component-wise DoF indices.

Template Parameters
dimNumber of spatial dimensions of the simulation
numberNumeric type used for computations (e.g., float, double)
DoFVectorTypeVector-type of the solution
SrcRhsVectorTypeVector-type of the right-hand side
Parameters
operator_baseOperator associated to the equation solved
rhsRight-hand side vector
srcInput solution for the solved equation
scratch_dataScratch data associated with the operation
dof_indices_per_blockArray of DoF indices per block
dof_no_bc_idxDoF index associated with the AffineConstraint object without boundary conditions
zero_outIf set to true, it zeroes out constrained values in the right-hand side.
additional_inhomogeneous_constraintsPair containing local DoF indices and values imposed at the DoFs.

◆ create_rhs_and_apply_dirichlet_matrixfree() [2/2]

template<int dim, typename number = double, typename DoFVectorType = VectorType<number>, typename SrcRhsVectorType = VectorType<number>, typename std::enable_if_t< std::is_same_v< DoFVectorType, VectorType< number > >, int > = 0>
void MeltPoolDG::Utilities::MatrixFree::create_rhs_and_apply_dirichlet_matrixfree ( OperatorMatrixFree< dim, number > &  operator_base,
DoFVectorType &  rhs,
const SrcRhsVectorType &  src,
const ScratchData< dim, dim, number > &  scratch_data,
const unsigned int  dof_idx,
const unsigned int  dof_no_bc_idx,
const bool  zero_out,
const std::optional< std::pair< std::vector< unsigned int >, std::vector< number > > > &  additional_inhomogeneous_constraints = std::nullopt 
)
inline

Compute the modified right-hand side for (inhomogeneous) dirichlet boundary conditions x_d

A * x = B

We actually solve

A * x_0 = b - A * x_d

with zero Dirichlet boundary conditions.

Note
When using this function, it must be ensured that this->dof_idx is used for reading the source vector "x".

◆ local_apply_inverse_mass_matrix()

template<int dim, int n_components, typename number >
void MeltPoolDG::Utilities::MatrixFree::local_apply_inverse_mass_matrix ( const dealii::MatrixFree< dim, number > &  matrix_free,
VectorType< number > &  dst,
const VectorType< number > &  src,
const std::pair< unsigned int, unsigned int > &  cell_range,
const unsigned int  dof_idx,
const unsigned int  quad_idx 
)

Apply the inverse of the mass matrix to the given dof vector.

Parameters
matrix_freeMatrix free object on which the applier works on.
dstDestination vector where the solution is stored.
srcCurrent solution of the primary variables.
cell_rangeCell range on which the inverse mass matrix is applied.
dof_idxRelevant dof index in the matrix free object.
quad_idxRelevant quadrature index in the matrix free object.