Skip to content
Snippets Groups Projects
Commit 79d4d953 authored by Laura Christine Kühle's avatar Laura Christine Kühle
Browse files

Vectorized '_build_inverse_mass_matrix()' in OrthonormalLegendre basis.

parent a11fbe94
No related branches found
No related tags found
No related merge requests found
...@@ -356,17 +356,14 @@ class OrthonormalLegendre(Legendre): ...@@ -356,17 +356,14 @@ class OrthonormalLegendre(Legendre):
ndarray ndarray
Inverse mass matrix. Inverse mass matrix.
Notes
-----
To increase speed, this function uses that for the orthonormal Legendre
polynomial basis the inverse mass matrix is equal to the identity
matrix.
""" """
mass_matrix = [] return np.identity(self._polynomial_degree+1)
for i in range(self._polynomial_degree+1):
new_row = []
for j in range(self._polynomial_degree+1):
new_entry = 0.0
if i == j:
new_entry = 1.0
new_row.append(new_entry)
mass_matrix.append(new_row)
return np.array(mass_matrix)
@property @property
@cache @cache
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment