deal.II version 9.7.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
TensorProductMatrixCreator Namespace Reference

Namespaces

namespace  internal

Enumerations

enum  LaplaceBoundaryType { dirichlet , neumann , internal_boundary }

Functions

template<int dim, typename Number>
std::pair< std::array< FullMatrix< Number >, dim >, std::array< FullMatrix< Number >, dim > > create_laplace_tensor_product_matrix (const FiniteElement< 1 > &fe, const Quadrature< 1 > &quadrature, const ::ndarray< LaplaceBoundaryType, dim, 2 > &boundary_ids, const ::ndarray< double, dim, 3 > &cell_extent, const unsigned int n_overlap=1)
template<int dim, typename Number>
std::pair< std::array< FullMatrix< Number >, dim >, std::array< FullMatrix< Number >, dim > > create_laplace_tensor_product_matrix (const typename Triangulation< dim >::cell_iterator &cell, const std::set< types::boundary_id > &dirichlet_boundaries, const std::set< types::boundary_id > &neumann_boundaries, const FiniteElement< 1 > &fe, const Quadrature< 1 > &quadrature, const ::ndarray< double, dim, 3 > &cell_extent, const unsigned int n_overlap=1)
template<typename Number = double>
FullMatrix< Number > create_1d_cell_mass_matrix (const FiniteElement< 1 > &fe, const Number &h, const std::pair< bool, bool > include_endpoints={true, true}, std::vector< unsigned int > numbering=std::vector< unsigned int >())
template<typename Number = double>
FullMatrix< Number > create_1d_cell_laplace_matrix (const FiniteElement< 1 > &fe, const Number &h, const std::pair< bool, bool > include_endpoints={true, true}, std::vector< unsigned int > numbering=std::vector< unsigned int >())
template<typename Number = double>
FullMatrix< Number > create_1D_discretization_matrix (FullMatrix< Number > &cell_matrix, const unsigned int &n_cells, const unsigned int &overlap, const std::pair< bool, bool > include_endpoints={true, true})
template<typename Number = double>
FullMatrix< Number > create_1d_ghost_penalty_matrix (const FiniteElement< 1 > &fe, const Number h, std::vector< Number > coefficients=std::vector< Number >())
 Create a 1D ghost penalty matrix for a given finite element. Ghost penalty is used for stabilization in cutFEM, see step-85. Implemented only for FE_Q.
template<typename Number = double>
FullMatrix< Number > create_1d_ghost_penalty_matrix (const std::vector< Polynomials::Polynomial< double > > &polynomial_basis_derivative, const unsigned int overlap=1)
 Create a 1D ghost penalty matrix.

Detailed Description

A namespace with functions that create input for certain standard matrices for the classes TensorProductMatrixSymmetricSum and TensorProductMatrixSymmetricSumCollection.

Enumeration Type Documentation

◆ LaplaceBoundaryType

Boundary type that can be used in create_laplace_tensor_product_matrix();

Enumerator
dirichlet 
neumann 
internal_boundary 

Definition at line 50 of file tensor_product_matrix_creator.h.

Function Documentation

◆ create_laplace_tensor_product_matrix() [1/2]

template<int dim, typename Number>
std::pair< std::array< FullMatrix< Number >, dim >, std::array< FullMatrix< Number >, dim > > TensorProductMatrixCreator::create_laplace_tensor_product_matrix ( const FiniteElement< 1 > & fe,
const Quadrature< 1 > & quadrature,
const ::ndarray< LaplaceBoundaryType, dim, 2 > & boundary_ids,
const ::ndarray< double, dim, 3 > & cell_extent,
const unsigned int n_overlap = 1 )

Create 1d mass matrix and 1d derivative matrix for a scalar constant-coefficient Laplacian for a dim dimensional Cartesian cell. Its boundary types can be specified with boundary_ids. The cell extent (including the cell extent of each neighbor) can be specified via cell_extent. With n_overlap, an overlap with neighboring cells can be specified. The default value is one, which correspond to all matrix entries restricted to the cell-local DoFs.

Definition at line 327 of file tensor_product_matrix_creator.h.

◆ create_laplace_tensor_product_matrix() [2/2]

template<int dim, typename Number>
std::pair< std::array< FullMatrix< Number >, dim >, std::array< FullMatrix< Number >, dim > > TensorProductMatrixCreator::create_laplace_tensor_product_matrix ( const typename Triangulation< dim >::cell_iterator & cell,
const std::set< types::boundary_id > & dirichlet_boundaries,
const std::set< types::boundary_id > & neumann_boundaries,
const FiniteElement< 1 > & fe,
const Quadrature< 1 > & quadrature,
const ::ndarray< double, dim, 3 > & cell_extent,
const unsigned int n_overlap = 1 )

Same as above but the boundary IDs are extracted from the given cell and are mapped to the boundary type via the sets dirichlet_boundaries and neumann_boundaries.

Definition at line 457 of file tensor_product_matrix_creator.h.

◆ create_1d_cell_mass_matrix()

template<typename Number = double>
FullMatrix< Number > TensorProductMatrixCreator::create_1d_cell_mass_matrix ( const FiniteElement< 1 > & fe,
const Number & h,
const std::pair< bool, bool > include_endpoints = {true, true},
std::vector< unsigned int > numbering = std::vector<unsigned int>() )

Compute a 1D cell mass matrix for a given finite element. This function is intended to provide a mass matrix for tensor product operators.

Parameters
feThe finite element object defining the shape functions.
hThe cell size used to scale the integration (typically the element size).
include_endpointsA pair of booleans indicating whether to include the first and last dof in the matrix. By excluding those DoFs, one can set a Dirichlet BC on either side. Setting either one to false only makes sense if the indexing of DoFs in the matrix is lexicographic, i.e., for FE_Q numbering is required, while FE_DGQ can be processed as it is.
numberingA vector of unsigned integers representing the numbering of the degrees of freedom. If empty, the numbering of the finite element is used.
Returns
A FullMatrix<double> representing the assembled mass matrix.

Definition at line 536 of file tensor_product_matrix_creator.h.

◆ create_1d_cell_laplace_matrix()

template<typename Number = double>
FullMatrix< Number > TensorProductMatrixCreator::create_1d_cell_laplace_matrix ( const FiniteElement< 1 > & fe,
const Number & h,
const std::pair< bool, bool > include_endpoints = {true, true},
std::vector< unsigned int > numbering = std::vector<unsigned int>() )

Compute a 1D cell laplace matrix for a given finite element.

Parameters
feThe finite element object defining the shape functions.
hThe cell size used to scale the integration (typically the element size).
include_endpointsA pair of booleans indicating whether to include the first and last dof in the matrix. By excluding those DoFs, one can set a Dirichlet BC on either side. Setting either one to false only makes sense if the indexing of DoFs in the matrix is lexicographic, i.e., for FE_Q numbering is required, while FE_DGQ can be processed as it is.
numberingA vector of unsigned integers representing the numbering of the degrees of freedom. If empty, the numbering of the finite element is used.

Definition at line 582 of file tensor_product_matrix_creator.h.

◆ create_1D_discretization_matrix()

template<typename Number = double>
FullMatrix< Number > TensorProductMatrixCreator::create_1D_discretization_matrix ( FullMatrix< Number > & cell_matrix,
const unsigned int & n_cells,
const unsigned int & overlap,
const std::pair< bool, bool > include_endpoints = {true, true} )

This function assembles a global matrix from a given cell matrix, assuming a 1D discretization with a specified number of cells and overlap between them.

Parameters
cell_matrixThe local cell matrix to be assembled into the global matrix. It is assumed that the cell matrix has a size corresponding to the number of degrees of freedom per cell. The cell matrix should be ordered lexicographically, meaning that FE_Q should be renumbered
n_cellsThe number of cells in the 1D discretization.
overlapThe number of degrees of freedom that overlap between adjacent cells. For discretization with FE_Q elements, the overlap should be set to 1, while for FE_DGQ elements, it should be set to 0.
include_endpointsA pair of booleans indicating whether to include the left and right most dofs of the domain in the constructed matrix. The default value is {true, true}, which includes both endpoints.
Returns
The assembled global matrix. The size of the matrix is determined by the number of cells, the overlap, and whether the endpoints are included.
Note
The size of the cell matrix must be consistent with the overlap parameter. Specifically, if the cell matrix is \(n \times n\), then the overlap should be less than \(n\).
Warning
This function returns a full matrix, if the number of cells is above 10 an exception will be thrown.

Definition at line 629 of file tensor_product_matrix_creator.h.

◆ create_1d_ghost_penalty_matrix() [1/2]

template<typename Number = double>
FullMatrix< Number > TensorProductMatrixCreator::create_1d_ghost_penalty_matrix ( const FiniteElement< 1 > & fe,
const Number h,
std::vector< Number > coefficients = std::vector<Number>() )

Create a 1D ghost penalty matrix for a given finite element. Ghost penalty is used for stabilization in cutFEM, see step-85. Implemented only for FE_Q.

Parameters
feThe finite element space used for discretization.
hThe mesh size, representing the length of the element.
coefficientsA vector of coefficients for the ghost penalty terms. If the vector is empty, default coefficients are used. The size of the coefficient vector should match the polynomial degree of the finite element space.
Returns
A full matrix representing the 1D ghost penalty matrix.

Definition at line 687 of file tensor_product_matrix_creator.h.

◆ create_1d_ghost_penalty_matrix() [2/2]

template<typename Number = double>
FullMatrix< Number > TensorProductMatrixCreator::create_1d_ghost_penalty_matrix ( const std::vector< Polynomials::Polynomial< double > > & polynomial_basis_derivative,
const unsigned int overlap = 1 )

Create a 1D ghost penalty matrix.

This function creates a single component of the sum over all derivatives in the 1D ghost penalty matrix. The matrix is created using the derivatives of the polynomial basis functions.

Parameters
polynomial_basis_derivativeA vector of polynomial basis functions. These should be the derivatives of the basis functions used to represent the solution.
overlapThe number of overlapping dof to consider when computing the ghost penalty. For continuous element it is 1, for DG pick 0.
Returns
A full matrix representing the 1D ghost penalty.

Definition at line 758 of file tensor_product_matrix_creator.h.