# mass_matrices.py¶

Given a CoordinateTransformation instance which stands for a mapping , we compute the mass matrices, , , and , of spaces , , and .

⭕ To access the source code, click on the [source] button at the right side or click on [mass_matrices.py]. Dependence may exist. In case of error, check import and install required packages or download required scripts. © mathischeap.com

The mass matrices.

Parameters:
• bf (MimeticBasisPolynomials) –

• ct (CoordinateTransformation) – A CoordinateTransformation instance that represents the mapping .

• quad_degree (list, tuple) – (default: None) The degree used for the numerical integral. It should be a list or tuple of three positive integers. If it is None, a suitable degree will be obtained from bf.

Example:

>>> from coordinate_transformation import CoordinateTransformation
>>> from coordinate_transformation import Phi, d_Phi
>>> from mimetic_basis_polynomials import MimeticBasisPolynomials
>>> ct = CoordinateTransformation(Phi, d_Phi)
>>> bf = MimeticBasisPolynomials('Lobatto-2', 'Lobatto-2', 'Lobatto-2')
>>> mm = MassMatrices(bf, ct)
[4, 4, 4]
>>> MN = mm.NP
>>> np.shape(MN)
(27, 27)
>>> ME = mm.EP
>>> np.shape(ME)
(54, 54)
>>> MF = mm.FP
>>> np.shape(MF)
(36, 36)
>>> MV = mm.VP
>>> np.shape(MV)
(8, 8)
>>> MN[13, :].toarray()
array([[0.00069202, 0.00092145, 0.00016439, 0.00092145, 0.01896296,
0.00381929, 0.00016439, 0.00381929, 0.00016439, ...
>>> ME[25, :].toarray()
array([[ 2.84993722e-04,  2.18286425e-02,  2.31867356e-02,
8.84765301e-03,  7.36065685e-04, -6.34982123e-03,...
>>> MF[30,:].toarray()
array([[ 9.57306626e-03,  1.40151619e-02, -3.83134271e-03,
-1.56689038e-01,  5.83237762e-02,  7.05662159e-02,...
>>> MV.toarray()
array([[12.32813585, -0.99033139, -0.99033139,  0.29781084, -0.99033139,
0.29781084,  0.29781084, -0.04159915],
[-0.99033139, 16.33440736,  0.29781084, -3.27422609,  0.29781084,
-3.27422609, -0.04159915,  0.29781084],...

property EP

The mass matrix .

Returns:

Return a csc_matrix representing the mass matrix.

property FP

The mass matrix .

Returns:

Return a csc_matrix representing the mass matrix.

property NP

The mass matrix .

Returns:

Return a csc_matrix representing the mass matrix.

property VP

The mass matrix .

Returns:

Return a csc_matrix representing the mass matrix.

↩️ Back to Ph.D. thesis complements (ptc).