Peano
Loading...
Searching...
No Matches
exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix Class Reference

Lagrange Basis with a diagonal mass matrix. More...

Inheritance diagram for exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix:
Collaboration diagram for exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix:

Public Member Functions

 __init__ (self, polynomial_order)
 
 __str__ (self)
 
 init_dictionary_with_default_parameters (self, dictionary, use_multidimensional_arrays)
 To be implemented by subclass.
 
 quadrature_points (self)
 
 quadrature_weights (self)
 
 value1d (self, x, number)
 Return the numberth shape function's value at x.
 
 derivative1d (self, x, number)
 Return the numberth shape function's derivative at x.
 
- Public Member Functions inherited from exahype2.solvers.LagrangeBasis.LagrangeBasis
 order (self)
 
 dofs_per_axis (self)
 

Data Fields

 dofs_per_axis
 

Static Public Attributes

str QuadraturePoints1dDocumentation
 
str QuadratureWeights1dDocumentation
 
str MassMatrix1dDocumentation
 
str StiffnessOperator1dDocumentation
 
str BasisFunctionValuesLeft1dDocumentation
 
str DerivativeOperator1dDocumentation
 
str InterpolationMatrix1dDocumentation
 
str RestrictionMatrix1dDocumentation
 

Protected Attributes

 _polynomial_order
 
- Protected Attributes inherited from exahype2.solvers.LagrangeBasis.LagrangeBasis
 _polynomial_order
 
 _render_digits
 

Private Member Functions

 __compute_barycentric_weights (self)
 See Eq.
 
 __compute_mass_matrix_diagonal (self)
 Reference mass matrix.
 
 __compute_stiffness_operator (self)
 Computes the (reference) element stiffness matrix for an approximation of order self.__max_poly_order.
 
 __compute_interpolation_matrix (self)
 compute the interpolation matrix, which used to prepare halo layer data for fine grid points at the refinement boundary.
 
 __compute_restriction_matrix (self)
 compute the restriction matrix, which used to prepare halo layer data for coarse cells at the refinement boundary.
 
 __compute_K1 (self)
 
 __compute_derivative_operator (self)
 
 __compute_fine_grid_projector (self, j)
 
 __compute_basis_function_values_left (self)
 Compute per basis function what the very left value of the polynomial would be.
 
 __compute_equidistant_grid_projector (self)
 

Private Attributes

 __quadrature_points
 
 __num_points
 

Static Private Attributes

 __repr__ = __str__
 

Detailed Description

Lagrange Basis with a diagonal mass matrix.

Class representing an abstract Lagrange basis which is used as a factory mechanism to produce vectors and matrices that we need within DG solvers. Never use this class directly, but always a subclass. As with all basis classes, the most relevant routine for a user is init_dictionary_with_default_parameters() which is a routine to befill a map with replacement rules, i.e. with the precomputed matrices and vectors. The class assumes that the mass matrix is a diagonal matrix. This is not true in general, i.e. holds only for Gauss-Legendre sampling points, but you might want to work with lumped matrices, and then this class is the right starting point.

Further to the initialisation, some using classes use quadrature_points_and_weights(). The exahype2.solvers.rkdg.RungeKuttaDG solver for example uses it to initialise the mapping of the plotter properly.

Generated vectors and matrices

I decided to "outsource" the documentation of the individual fields to class attributes of their own. This way, they are visible both in the doxygen documentation and I can pipe them into the generated C++ code.

  • QuadraturePoints1d
  • MassMatrixDiagonal1d
  • StiffnessOperator
  • RestrictionMatrix1d
  • InterpolationMatrix1d

Realisation

The first version of this utility class has been written by Dominic E. Charrier. It relied on NumPy and SymPy in several places. The current version is stripped down and solely uses SciPy.

Definition at line 25 of file LagrangeBasisWithDiagonalMassMatrix.py.

Constructor & Destructor Documentation

◆ __init__()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__init__ ( self,
polynomial_order )

Member Function Documentation

◆ __compute_barycentric_weights()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_barycentric_weights ( self)
private

◆ __compute_basis_function_values_left()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_basis_function_values_left ( self)
private

Compute per basis function what the very left value of the polynomial would be.

See also
BasisFunctionValuesLeft1dDocumentation which defines what this routine does and is also used to inject documentation into the generated C++ code.

Definition at line 404 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.LagrangeBasis.LagrangeBasis.dofs_per_axis(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.dofs_per_axis, peano4.toolbox.blockstructured.ReconstructPatchAndApplyFunctor.ReconstructPatchAndApplyFunctor.dofs_per_axis, and exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.value1d().

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __compute_derivative_operator()

◆ __compute_equidistant_grid_projector()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_equidistant_grid_projector ( self)
private
Todo
Not used atm, but definitely useful

Transforms the degrees of freedom located at non-equidistant Lagrange support points quadrature_points to degrees of freedoms located at quadrature_points of an equidistant grid over (0,1).

Let us denote by P the projection operator (= equidistantGridProjector). The equidistant DoF are computed according to:

u^eq_i = sum_{m} P_im u^DG_m

Returns: equidistantGridProjector: The corresponding degrees of freedom located at quadrature_points of an equidistant grid over (0,1).

Definition at line 416 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__evaluate(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__num_points, and exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__num_points.

Here is the call graph for this function:

◆ __compute_fine_grid_projector()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_fine_grid_projector ( self,
j )
private
Todo
Definitely useful, but not used atm

Transforms the degrees of freedom located on a coarse grid edge quadrature_points to degrees of freedoms located on quadrature_points of a fine grid edge. The difference in levels is 1.

Let us denote by P the fine grid projector (= equidistantGridProjector). The fine grid DoF are computed according to:

u^{fine;j}_i = sum_{m} P^{j}_im u^{coarse}_m

Args: j: subinterval index

Returns: fineGridProjector: Operator to express polynomial function associated with original interval with basis functions associated with subinterval j

Definition at line 373 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__evaluate(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__num_points, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__num_points, exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__quadrature_points, and exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__quadrature_points.

Here is the call graph for this function:

◆ __compute_interpolation_matrix()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_interpolation_matrix ( self)
private

compute the interpolation matrix, which used to prepare halo layer data for fine grid points at the refinement boundary.

The matrix is only 1d mapping, i.e. used for "surface" of a 2D domain and have a size of 3Dof \times Dof. Its elements are \phi_j(x^f_i), i.e. the value of basis functions for coarse grid on fine grid point. In practive we multiply this matrix to vector of weight in coarse grid (u^c_i):

\phi_j(x^f_i)*u^c_i=u^c(x^f_i)

u^c(x) is the original solution on coarse grid. Thus the result is actually the evaluation of coarse solution on fine grid position

We can also use the same matrix to interpolate along the normal direction.

Definition at line 265 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

Here is the caller graph for this function:

◆ __compute_K1()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_K1 ( self)
private
Todo
Not yet updated atm but seems also not to be used anywhere

Computes the difference between the reference element mass operator evaluated at point xi=1.0 and the element stiffness matrix.

:return: delta between the reference element mass operator at point xi=1.0 and the element stiffness matrix

Definition at line 328 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__evaluate(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__num_points, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__num_points, and exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__stiffness_operator.

Here is the call graph for this function:

◆ __compute_mass_matrix_diagonal()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_mass_matrix_diagonal ( self)
private

Reference mass matrix.

See class documentation. I moved the docu there, as doxygen does not extract documentation from private routines in Python.

Definition at line 229 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.LagrangeBasis.LagrangeBasis.dofs_per_axis(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.dofs_per_axis, and peano4.toolbox.blockstructured.ReconstructPatchAndApplyFunctor.ReconstructPatchAndApplyFunctor.dofs_per_axis.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __compute_restriction_matrix()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_restriction_matrix ( self)
private

compute the restriction matrix, which used to prepare halo layer data for coarse cells at the refinement boundary.

the matrix formulation depends on the interpolation scheme.

The matrix is only 1d mapping, i.e. used for "surface" of a 2D domain and have a size of Dof \times 3Dof.

We can also use the same matrix to interpolate along the normal direction.

Definition at line 299 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.LagrangeBasis.LagrangeBasis._polynomial_order, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix._polynomial_order, exahype2.solvers.LagrangeBasis.LagrangeBasis.dofs_per_axis(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.dofs_per_axis, peano4.toolbox.blockstructured.ReconstructPatchAndApplyFunctor.ReconstructPatchAndApplyFunctor.dofs_per_axis, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLegendreBasis.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLobattoBasisWithLumpedDiagonalBasis.quadrature_points(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.quadrature_points(), and exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.value1d().

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __compute_stiffness_operator()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_stiffness_operator ( self)
private

◆ __str__()

◆ derivative1d()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.derivative1d ( self,
x,
number )

Return the numberth shape function's derivative at x.

u = sum_i u_i phi_i

=> d/dx u = sum_j (d/dx phi_j) u_j

To construct the gradient field, we make the ansatz:

grad u = sum_i g_i phi_i

=>

g_i = ( d/dx u, phi_i )_[0,1] / (phi_i,phi_i)_[0,1] = sum_j (d/dx phi_j, phi_i)_[0,1] / w_i

= w_i (d/dx phi_j) (x_i) / w_i = (d/dx phi_j) (x_i)

= DUDX^T

where DUDX is the operator computed by this function:

DUDX_ij = (d/dx phi_i) (x_j)

It can be further written as

DUDX_ij = 1/w_i * K^T_ij

where the stiffness matrix K is defined as

K_ij = <d/dx phi_i, phi_j>_[0,1] = w_j (d/dx phi_j) (x_i)

:return: transposed derivative operator

:note: If you want to use this operator to compute the gradient of the solution, you need to use the transpose.

Definition at line 553 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.LagrangeBasis.LagrangeBasis.dofs_per_axis(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.dofs_per_axis, peano4.toolbox.blockstructured.ReconstructPatchAndApplyFunctor.ReconstructPatchAndApplyFunctor.dofs_per_axis, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLegendreBasis.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLobattoBasisWithLumpedDiagonalBasis.quadrature_points(), and exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.quadrature_points().

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_derivative_operator(), and exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_stiffness_operator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_dictionary_with_default_parameters()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters ( self,
dictionary,
use_multidimensional_arrays )

To be implemented by subclass.

multidimensional_arrays: Boolean If it is to False, all the matrices should be flattened into one array (C enumeration). If it is set, the matrices should be written down as proper two-dimensional arrays. Analogously, all inter-grid transfer operators either are represented as array or as d-dimensional construct.

Reimplemented from exahype2.solvers.LagrangeBasis.LagrangeBasis.

Definition at line 443 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_basis_function_values_left(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__compute_derivative_operator(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_derivative_operator(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_interpolation_matrix(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_mass_matrix_diagonal(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_restriction_matrix(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.__compute_stiffness_operator(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_stiffness_operator(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.BasisFunctionValuesLeft1dDocumentation, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.DerivativeOperator1dDocumentation, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.InterpolationMatrix1dDocumentation, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.MassMatrix1dDocumentation, exahype2.solvers.aderdg.ADERDG.ADERDG.order(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.order, exahype2.solvers.LagrangeBasis.LagrangeBasis.order(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLegendreBasis.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLobattoBasisWithLumpedDiagonalBasis.quadrature_points(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.quadrature_weights(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLegendreBasis.quadrature_weights(), exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.quadrature_weights(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.QuadraturePoints1dDocumentation, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.QuadratureWeights1dDocumentation, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.RestrictionMatrix1dDocumentation, and exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.StiffnessOperator1dDocumentation.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__str__().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quadrature_points()

◆ quadrature_weights()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.quadrature_weights ( self)

◆ value1d()

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.value1d ( self,
x,
number )

Return the numberth shape function's value at x.

This equals Dominic's old evaluate function, but that one evaluated all the polynomials in one rush, whereas this one only looks at shape function number number. Also, Dominic's version did both the value and the derivative. I split this one up into two version.

Definition at line 529 of file LagrangeBasisWithDiagonalMassMatrix.py.

References exahype2.solvers.LagrangeBasis.LagrangeBasis.dofs_per_axis(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.dofs_per_axis, peano4.toolbox.blockstructured.ReconstructPatchAndApplyFunctor.ReconstructPatchAndApplyFunctor.dofs_per_axis, exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLegendreBasis.quadrature_points(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.GaussLobattoBasisWithLumpedDiagonalBasis.quadrature_points(), and exahype2.solvers.aderdg.LagrangeBasis.LagrangeBasis.quadrature_points().

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_basis_function_values_left(), exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_restriction_matrix(), and exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__compute_stiffness_operator().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ __num_points

◆ __quadrature_points

◆ __repr__

exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.__repr__ = __str__
staticprivate

Definition at line 80 of file LagrangeBasisWithDiagonalMassMatrix.py.

◆ _polynomial_order

◆ BasisFunctionValuesLeft1dDocumentation

str exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.BasisFunctionValuesLeft1dDocumentation
static
Initial value:
= """
This is a vector of p+1 entries which tells you for a 1d interval
what the function on the left side is. Assume all Lagrange polynomials
are defined over the unit interval. The first entry in this matrix
tells you what the leftmost polynomial's value is at x=0. The second
entry discusses the impact of the second polynomial. If you have a
vector of p+1 shape function weights, you can compute the scalar
product of this vector and this weight vector, and you'll know what
the solution at the point x=0 is.
If the rightmost value, i.e. the value at x=1 is of interest, the order
within this vector has to be inverted.
This is a nodal 1d operation, i.e. there are no integrals or similar
involved. We take the real 1d polyomial from the shape function.
"""

Definition at line 170 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

◆ DerivativeOperator1dDocumentation

str exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.DerivativeOperator1dDocumentation
static
Initial value:
= """
Matrix which is given the p+1 weights of the shape function
along a 1d line. It then returns the p+1 gradients at the integration
points.
This is a point-wise operator, i.e. it works directly with the weights
of the shape function in the function space. It does not involve any
integral et al. Furthermore, it is exact given a certain Lagrange
polynomial.
"""

Definition at line 187 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

◆ dofs_per_axis

◆ InterpolationMatrix1dDocumentation

str exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.InterpolationMatrix1dDocumentation
static
Initial value:
= """
This is essentially a @f$ 3 \cdot (order+1)^d-1 @f$ matrix split up
into a three-dimensional tensor. The documentation/content of this
tensor can be found on the page about DG AMR which is held in exahype
within the file exahype2/dg/Riemann.h.
"""

Definition at line 198 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

◆ MassMatrix1dDocumentation

str exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.MassMatrix1dDocumentation
static
Initial value:
= """
Computes the (reference) element mass matrix' diagonal. The mass matrix is defined
via
@f$ \int _{(0,1)}(\phi _i, \phi _j) dx, i,j = 1 ... N > 0 @f$
where @f$ \phi _i,\phi _j @f$ are Lagrange basis functions associated with
the quadrature within the unit-interval. They are polynomials of maximum order N-1.
Our implementation is quite some overkill, as I assemble the whole mass matrix
and then extract only the diagonal. If we use Legendre nodes as support points,
this diagonal is an exact evaluation, i.e. the mass matrix is diagonal. If
we use Lobatto nodes, it is an approximation.
Please note that this is a 1d mass matrix: If we have a polynomial of order p,
we have @f$ (p+1)^d @f$ dofs in total per cell. My matrix has only the dimensions
@f$ (p+1) \times (p+1) @f$ so it effectively only models how the dofs along one
horizontal or vertical line within the cell do interact. This is totally sufficient
if we know that we have a tensor product approach of the shape functions and a
diagonal mass matrix.
@todo I don't know if we need renormalisation for Lobatto nodes, i.e. if we
should ensure that the row sum is preserved
This is an operation which maps nodal data into a weak space, i.e. the outcome has
to be scaled with h to be correct. It stems from a 1d integral. If you want to
compute the real mass matrix output, you have to multiply the outcome along each
coordinate axis.
"""

Definition at line 109 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

◆ QuadraturePoints1dDocumentation

str exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.QuadraturePoints1dDocumentation
static
Initial value:
= """
The quadrature points are an array of size [p+1] if p is the order of the
chosen polyomial. The double array defines the spacing of the quadrature points
over the unit interval. See the helper routine exahype2::dg::getQuadraturePoint()
for an example how the points are used to identify the actual location in
space of the quadrature points.
As we work in a tensor product world, the 2d and 3d quadrature points can be
simply constructed by multiplying the respective coordinate system indices.
"""

Definition at line 83 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

◆ QuadratureWeights1dDocumentation

str exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.QuadratureWeights1dDocumentation
static
Initial value:
= """
The quadrature weights are an array of size [p+1] if p is the order of the
chosen polyomial. The double array defines the integral over the polynomial
over the unit interval. We use Lagrangian bases here, i.e. only one polynomial
of the basis is 1 in a quadrature point, while all the others are 0. However,
the fact that it is 1 in the point, does not tell us anything about the
integral over this particular polynomial. That's the weight associated with
it.
As we work in a tensor product world, the 2d and 3d weights can be
simply constructed by multiplying the respective coordinate system indices.
"""

Definition at line 95 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

◆ RestrictionMatrix1dDocumentation

str exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.RestrictionMatrix1dDocumentation
static
Initial value:
= """
This is essentially a @f$ 3 \cdot (order+1)^d-1 @f$ matrix split up
into a three-dimensional tensor. The documentation/content of this
tensor can be found on the page about DG AMR which is held in exahype
within the file exahype2/dg/Riemann.h.
"""

Definition at line 205 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().

◆ StiffnessOperator1dDocumentation

str exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.StiffnessOperator1dDocumentation
static
Initial value:
= """
The stiffness operator is a [p+1]x[p+1] matrix which is constructed in
__compute_stiffness_operator().
The matrix holds
@f$ K_{ij} = <\partial _x \phi _i, \phi _j> = w_j (\partial _x \phi _j) (x_i) @f$
where @f$ \phi _i, \phi _j @f$ are Lagrange basis functions associated with
the support (quadrature) points @f$ x_i @f$ and @f$ x_j @f$ within the unit
interval.
If you have a vector of p+1 entries, it defines a polynomial (aka function f) over the unit
interval. If you multiply this vector if @f$ K @f$, you get the outcome of
@f$ \int _{[0.1]} \Big( \partial _x f, \phi _j \Big) dx @f$
for the different tests @f$ \phi _j @f$. If your interval is not the unit
one but has side length $h$, you have to multiply the outcome with $h$ as
you integrate. At the same time, the derivative however has to be rescaled
with @f$ h^{-1} @f$ and the two h-recalibrations thus cancel out.
If you have a 2d or 3d function space, you still have to multiple with these
shape functions (see discussion around mass matrix), and you will get an
additional @f$ h^{d-1} @f$ scaling of the outcome.
We note that the outcome is exact for both Lobatto and Legendre nodes due to
the reduced degree in one scalar product operand.
"""

Definition at line 140 of file LagrangeBasisWithDiagonalMassMatrix.py.

Referenced by exahype2.solvers.LagrangeBasisWithDiagonalMassMatrix.LagrangeBasisWithDiagonalMassMatrix.init_dictionary_with_default_parameters().


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