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

Using normalised identity matrix instead of the mass matrix. More...

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

Public Member Functions

 __init__ (self, dimensions, poly_degree, unknowns_per_node)
 
 get_cell_identity_matrix (self)
 Return identity matrix and a 0 as the identity matrix has no intrinsic scaling, i.e.
 
 get_lumped_mass_matrix (self)
 Get this working for 2d.
 
 get_cell_mass_matrix (self)
 Here we use a normalised identity matrix instead of the mass matrix.
 
 get_cell_system_matrix_for_laplacian (self)
 Create a cell-cell mass matrix.
 
- Public Member Functions inherited from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator
 get_polynomial1d (self)
 Method to create a list of 1D polynomials.
 
 get_points1d (self)
 Method to set the quadrature points, used for integration.
 
 get_weights1d (self)
 Method to set the quadrature weights, used for integration.
 
 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
 
 eval_integral (self, functions, dim=-1, factor=1)
 

Data Fields

 unknowns_per_node
 
 block_matrix
 
 dimensions
 
- Data Fields inherited from mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator
 dimensions
 
 poly_degree
 
 unknowns_per_node
 
 polynomials1d
 
 derivatives1d
 
 points1d
 
 weights1d
 

Protected Member Functions

 _cell_dofs (self)
 

Detailed Description

Using normalised identity matrix instead of the mass matrix.

This is necessary when the residual is computed as b-A*u instead of M*b-A*u, for example, when using CG solver for the coarse-grid correction in multigrid.


Simple matrix generator for continuous d-linear finite elements

This factory method is there for convenience, i.e. users can take it to pre-assemble local matrices and then to pipe it into the Peano 4 multigrid classes. Most of the stuff in here in hard-coded, so only well-suited for relatively primitive solvers. You might want to specialise these routines, switch to a more sophisticated matrix generator, or abandon the idea of a matrix generator altogether.

Definition at line 10 of file DLinearMassIdentity.py.

Constructor & Destructor Documentation

◆ __init__()

mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.__init__ ( self,
dimensions,
poly_degree,
unknowns_per_node )

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

Definition at line 29 of file DLinearMassIdentity.py.

References mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.__init__().

Referenced by mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.__init__().

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

Member Function Documentation

◆ _cell_dofs()

mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity._cell_dofs ( self)
protected
Todo
should this be 2**D or (p+1)**D? suppose it's not relevant, given this is a linear solver

Definition at line 44 of file DLinearMassIdentity.py.

Referenced by mghype.api.matrixgenerators.DLinear.DLinear.get_cell_identity_matrix(), and mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.get_cell_identity_matrix().

Here is the caller graph for this function:

◆ get_cell_identity_matrix()

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

Return identity matrix and a 0 as the identity matrix has no intrinsic scaling, i.e.

its scaling is \( h^0 \).

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

Definition at line 51 of file DLinearMassIdentity.py.

References mghype.api.matrixgenerators.DLinear.DLinear._cell_dofs(), mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity._cell_dofs(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.dimensions, exahype2.symhype.PDE.PDE.dimensions, peano4.visualisation.input.PatchFileParser.UnknownAttributes.dimensions, peano4.visualisation.input.PatchFileParser.PatchFileParser.dimensions, convert::data::PatchData.dimensions, convert::data::Variable.dimensions, mghype.api.matrixgenerators.DLinear.DLinear.dimensions, mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.dimensions, mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.dimensions, mghype.api.matrixgenerators.GaussLobatto.GLMatrixFree.dimensions, mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.dimensions, equations.acoustic.Acoustic.dimensions, equations.advection.Advection.dimensions, equations.elastic.Elastic.dimensions, equations.equation.Equation.dimensions, equations.euler.Euler.dimensions, equations.swe.SWE_W_Bathymetry.dimensions, equations.swe.SWE_WO_Bathymetry.dimensions, mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.unknowns_per_node, and mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.unknowns_per_node.

Referenced by mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.get_cell_mass_matrix().

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

◆ get_cell_mass_matrix()

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

Here we use a normalised identity matrix instead of the mass matrix.

To achieve the result (Id_global * b_global), the local matrix should be divided by 2^dimensions, see get_cell_identity_matrix(). For example, in 2D, it is 0.25*Id, which, when summed for 4 cells sharing each interior vertex, will result in the global identity. Note that this does not differentiate between interior and boundary vertices.


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 \).

Use the mass matrix generated for DG Interior Penalty for Poisson equation.

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

Definition at line 82 of file DLinearMassIdentity.py.

References mghype.api.matrixgenerators.DLinear.DLinear.get_cell_identity_matrix(), mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.get_cell_identity_matrix(), mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_cell_identity_matrix(), mghype.api.matrixgenerators.GaussLobatto.GLMatrixFree.get_cell_identity_matrix(), and mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.get_cell_identity_matrix().

Referenced by mghype.api.matrixgenerators.DLinear.DLinear.get_lumped_mass_matrix(), and mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.get_lumped_mass_matrix().

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

◆ get_cell_system_matrix_for_laplacian()

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

Create a cell-cell mass matrix.

In a finite element context, this matrix has to be scaled with \( h^{d-2} \). Therefore, we retturn d-2 as second argument.

Use the cell-cell matrix generated for DG Interior Penalty for Poisson equation.

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

Definition at line 106 of file DLinearMassIdentity.py.

References mghype.api.matrixgenerators.DLinear.DLinear.block_matrix, mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.block_matrix, mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.block_matrix, exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.dimensions, exahype2.symhype.PDE.PDE.dimensions, peano4.visualisation.input.PatchFileParser.UnknownAttributes.dimensions, peano4.visualisation.input.PatchFileParser.PatchFileParser.dimensions, convert::data::PatchData.dimensions, convert::data::Variable.dimensions, mghype.api.matrixgenerators.DLinear.DLinear.dimensions, mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.dimensions, mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.dimensions, mghype.api.matrixgenerators.GaussLobatto.GLMatrixFree.dimensions, mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.dimensions, equations.acoustic.Acoustic.dimensions, equations.advection.Advection.dimensions, equations.elastic.Elastic.dimensions, equations.equation.Equation.dimensions, equations.euler.Euler.dimensions, equations.swe.SWE_W_Bathymetry.dimensions, and equations.swe.SWE_WO_Bathymetry.dimensions.

Referenced by mghype.api.matrixgenerators.GaussLobatto.GLMatrixFree.get_A_tilde().

Here is the caller graph for this function:

◆ get_lumped_mass_matrix()

mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.get_lumped_mass_matrix ( self)

Get this working for 2d.

What about 3d? If we select an index for the first dimension and then sum over the other two (ie call np.sum( massMatrix[i,] )) it will just add up all elements along the 2 other dimensions, as if we flattened it. Is this what we want?

Definition at line 64 of file DLinearMassIdentity.py.

References mghype.api.matrixgenerators.DLinear.DLinear.get_cell_mass_matrix(), mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.get_cell_mass_matrix(), mghype.api.matrixgenerators.GaussLobatto.GaussLobatto.get_cell_mass_matrix(), mghype.api.matrixgenerators.GaussLobatto.GLMatrixFree.get_cell_mass_matrix(), and mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.get_cell_mass_matrix().

Here is the call graph for this function:

Field Documentation

◆ block_matrix

◆ dimensions

mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.dimensions

Definition at line 48 of file DLinearMassIdentity.py.

Referenced by peano4.visualisation.input.PatchFileParser.PatchFileParser.__parse_meta_data_region(), peano4.visualisation.input.PatchFileParser.PatchFileParser.__parse_patch_region(), exahype2.symhype.PDE.PDE._implementation_of_mapping_onto_named_quantities(), peano4.visualisation.input.PatchFileParser.UnknownAttributes._initialise_default_mapping_if_no_mapping_specified(), mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.convert_index_to_dim(), equations.euler.Euler.eigenvalues(), mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.eval_integral(), equations.elastic.Elastic.flux(), equations.euler.Euler.flux(), mghype.api.matrixgenerators.GaussLobatto.GLMatrixFree.get_boundary_matrix(), mghype.api.matrixgenerators.GaussLobatto.GLMatrixFree.get_cell_from_face_matrix(), mghype.api.matrixgenerators.DLinear.DLinear.get_cell_identity_matrix(), mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.get_cell_identity_matrix(), mghype.api.matrixgenerators.DLinear.DLinear.get_cell_mass_matrix(), mghype.api.matrixgenerators.DLinear.DLinear.get_cell_system_matrix_for_laplacian(), mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.get_cell_system_matrix_for_laplacian(), api.solvers.DiscontinuousGalerkinDiscretisation.AssemblePetscMatrix.get_constructor_body(), mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.get_deriv(), mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.get_points_for_dimension(), mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.get_polynomial(), mghype.api.matrixgenerators.GaussLobatto.GLMatrixFree.get_projection_matrices(), mghype.api.matrixgenerators.MatrixGenerator.MatrixGenerator.get_weights_for_dimension(), matrices.DgGenerator.getCellToFaceMatrix(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_eigenvalues(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_flux(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_max_eigenvalue(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_ncp(), and peano4.visualisation.input.PatchFileParser.PatchFileParser.parse_file().

◆ unknowns_per_node

mghype.api.matrixgenerators.DLinearMassIdentity.DLinearMassIdentity.unknowns_per_node

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