Peano
Loading...
Searching...
No Matches
mghype.api.matrixgenerators.GaussLobatto.GaussLobatto Class Reference

Simple matrix generator assuming that we use a Gauss Lobatto unknown layout. More...

Inheritance diagram for mghype.api.matrixgenerators.GaussLobatto.GaussLobatto:
Collaboration diagram for mghype.api.matrixgenerators.GaussLobatto.GaussLobatto:

Public Member Functions

 __init__ (self, dimensions, poly_degree, unknowns_per_cell_node, unknowns_per_face_node, use_unit_interval=False)
 get_nodal_points_1d (self)
 Get the nodal points in the interval [-1,1].
 get_points1d (self)
 Get spacing of integration points over unit interval.
 get_weights1d (self)
 Overwrites the method in the base class.
 get_weights1d_legendre (self)
 get_points1d_legendre (self)
 get_points_unit_interval (self)
 eval_integral (self, functions, dim=-1, factor=1)
 get_cell_identity_matrix (self)
 Construct identity for this particular equation system.
 get_cell_mass_matrix (self)
 Create a cell-cell mass matrix.
 get_cell_system_matrix_for_laplacian (self)
 Create a cell-cell mass matrix for \( \nabla p \cdot \nabla v \).
 get_face_to_cell_matrix (self)
 Return the cel-to-face matrix A_p^qf.
 get_cell_to_face_matrix (self)
 Return the projection operator.
 get_averaging_riemann_solver (self)
 Simple averaging Riemann solver.
 get_face_face_riemann_problem_matrix (self)
 Averaging matrix.
Public Member Functions inherited from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator
 __init__ (self, dimensions, poly_degree, unknowns_per_node=1)
 get_polynomial1d (self)
 Method to create a list of 1D polynomials.
 get_integration_points_over_unit_interval (self)
 Most schemes define the integration point over the interval [-1,1] whereas MGHyPE often needs it on the unit interval.
 get_points_for_dimension (self, dim=-1)
 We promote the 1D quadrature points in into the dimensions of our problem by taking cartesian product.
 get_weights_for_dimension (self, dim=-1)
 We promote the 1D quadrature weights in into the dimensions of our problem by taking cartesian product.
 convert_index_to_dim (self, index, dim=-1)
 This method helps with indexing.
 get_polynomial (self, index, dim=-1)
 Promote 1d polynomials to many dimensions by taking products.
 get_deriv (self, index, dimForDeriv, dim=-1)
 dimForDeriv is the singular dimension that we wanna take a polyderiv in

Data Fields

 unknowns_per_cell_node = unknowns_per_cell_node
 unknowns_per_face_node = unknowns_per_face_node
tuple cell_nodes = ( self.poly_degree + 1 ) ** (self.dimensions)
tuple face_nodes = ( self.poly_degree + 1 ) ** (self.dimensions - 1)
 use_unit_interval = use_unit_interval
 block_matrix = mghype.api.matrixgenerators.blockmatrix.DGPoisson2dPenaltyBlockMatrix(r_press)
Data Fields inherited from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator
 dimensions = dimensions
 poly_degree = poly_degree
 unknowns_per_node = unknowns_per_node
 polynomials1d = self.get_polynomial1d()
list derivatives1d = [ p.deriv() for p in self.polynomials1d ]
 points1d = self.get_points1d()
 weights1d = self.get_weights1d()

Detailed Description

Simple matrix generator assuming that we use a Gauss Lobatto unknown layout.

If you use this class, you assuem that a cell hosts \( (p+1)^d \) nodes carrying Legendre polynomials. As you use a Gauss Lobatto layout, the "outer" nodes will end up on the cell faces. Each node can hold a fixed number of unknowns. If you multiply the number of nodes per cell with the corresponding number of unknowns, you get the degrees of freedom within a global assembly matrix which correspond to volumetric data.

Definition at line 14 of file GaussLobatto.py.

Constructor & Destructor Documentation

◆ __init__()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.__init__ ( self,
dimensions,
poly_degree,
unknowns_per_cell_node,
unknowns_per_face_node,
use_unit_interval = False )

Definition at line 27 of file GaussLobatto.py.

References __init__().

Referenced by __init__().

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

Member Function Documentation

◆ eval_integral()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.eval_integral ( self,
functions,
dim = -1,
factor = 1 )

Reimplemented from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.

Definition at line 127 of file GaussLobatto.py.

References eval_integral(), and use_unit_interval.

Referenced by eval_integral().

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

◆ get_averaging_riemann_solver()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_averaging_riemann_solver ( self)

Simple averaging Riemann solver.

We know that this solver is extremely diffusive, but it makes sense to provide this one as a simple debugging mechanism. In line with our DG description, it is clear that the dimension of the result matrix is \( dof \times 2dof \) where dof is the number of degrees of freedom projected onto a face.

Please note that unknowns_per_face_node= \( 3 \cdot dof \) in the equation above.

Definition at line 261 of file GaussLobatto.py.

References face_nodes, and unknowns_per_face_node.

◆ get_cell_identity_matrix()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_cell_identity_matrix ( self)

Construct identity for this particular equation system.

Not that this is identity construction has to take the number of unknowns into account as well as the number of degrees of freedom hosted within a cell.

Reimplemented from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.

Reimplemented in mghype.api.matrixgenerators.GaussLobatto.GaussLobattoMatrixFree.

Definition at line 136 of file GaussLobatto.py.

References cell_nodes, and unknowns_per_cell_node.

◆ get_cell_mass_matrix()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_cell_mass_matrix ( self)

Create a cell-cell mass matrix.

This matrix does not couple the individual unknowns per degree of freedom. The resulting matrix has to be scaled by \( h^d \).

Reimplemented from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.

Reimplemented in mghype.api.matrixgenerators.GaussLobatto.GaussLobattoMatrixFree.

Definition at line 141 of file GaussLobatto.py.

References mghype.api.matrixgenerators.DLinear.DLinear.block_matrix, mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.block_matrix, and block_matrix.

◆ get_cell_system_matrix_for_laplacian()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_cell_system_matrix_for_laplacian ( self)

◆ get_cell_to_face_matrix()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_cell_to_face_matrix ( self)

◆ get_face_face_riemann_problem_matrix()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_face_face_riemann_problem_matrix ( self)

Averaging matrix.

Implement separately for GaussLobattoMatrixFree class, taking into account solutions_per_face_node and projections_per_face_node. Now assume there are 2 "solutions" (i.e. f-variables: q^f and u^f) and two sets of projections: q^pm an.

Definition at line 279 of file GaussLobatto.py.

◆ get_face_to_cell_matrix()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_face_to_cell_matrix ( self)

◆ get_nodal_points_1d()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_nodal_points_1d ( self)

Get the nodal points in the interval [-1,1].

These are the nodes used for constructing the Lagrangian basis functions. Note, that they might be different from the quadrature points used for integration.

Definition at line 51 of file GaussLobatto.py.

◆ get_points1d()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_points1d ( self)

Get spacing of integration points over unit interval.

Overwriting the method in base class. Let's produce Gauss-Lobatto points. Standard behaviour is Legendre points using built-in stuff from scipy.

We borrow the method from the wikipedia page.

This routine returns the points in the interval [-1,1]. If you have to rescale them, use get_points_unit_interval() instead.

Reimplemented from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.

Definition at line 59 of file GaussLobatto.py.

References poly_degree.

Referenced by mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.get_integration_points_over_unit_interval(), get_points1d_legendre(), and get_weights1d().

Here is the caller graph for this function:

◆ get_points1d_legendre()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_points1d_legendre ( self)

Definition at line 119 of file GaussLobatto.py.

References get_points1d().

Here is the call graph for this function:

◆ get_points_unit_interval()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_points_unit_interval ( self)

Definition at line 123 of file GaussLobatto.py.

References points1d.

◆ get_weights1d()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_weights1d ( self)

Overwrites the method in the base class.

Method is borrowed from wikipedia

Reimplemented from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.

Definition at line 94 of file GaussLobatto.py.

References get_points1d(), and poly_degree.

Referenced by get_weights1d_legendre().

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

◆ get_weights1d_legendre()

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_weights1d_legendre ( self)

Definition at line 116 of file GaussLobatto.py.

References get_weights1d().

Here is the call graph for this function:

Field Documentation

◆ block_matrix

◆ cell_nodes

tuple mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.cell_nodes = ( self.poly_degree + 1 ) ** (self.dimensions)

Definition at line 40 of file GaussLobatto.py.

Referenced by get_cell_identity_matrix().

◆ face_nodes

tuple mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.face_nodes = ( self.poly_degree + 1 ) ** (self.dimensions - 1)

Definition at line 41 of file GaussLobatto.py.

Referenced by get_averaging_riemann_solver().

◆ unknowns_per_cell_node

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.unknowns_per_cell_node = unknowns_per_cell_node

◆ unknowns_per_face_node

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.unknowns_per_face_node = unknowns_per_face_node

Definition at line 38 of file GaussLobatto.py.

Referenced by get_averaging_riemann_solver().

◆ use_unit_interval

mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.use_unit_interval = use_unit_interval

Definition at line 43 of file GaussLobatto.py.

Referenced by eval_integral().


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