Skip to content

Commit

Permalink
revert to numpy.solve(Vandermonde)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Nov 9, 2023
1 parent f628a01 commit 56ce030
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions FIAT/finite_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# Modified by Thomas H. Gibson ([email protected]), 2016

import numpy
import scipy
import warnings

from FIAT.dual_set import DualSet
from FIAT.polynomial_set import PolynomialSet
Expand Down Expand Up @@ -131,14 +129,7 @@ def __init__(self, poly_set, dual, order, formdegree=None, mapping="affine", ref
V = numpy.dot(A, numpy.transpose(B))
self.V = V

# new_coeffs_flat = numpy.linalg.solve(V.T, B)
warnings.filterwarnings("error")
try:
LU, piv = scipy.linalg.lu_factor(V)
new_coeffs_flat = scipy.linalg.lu_solve((LU, piv), B, trans=1)
except scipy.linalg.LinAlgWarning:
raise numpy.linalg.LinAlgError("Singular Vandermonde matrix")
warnings.resetwarnings()
new_coeffs_flat = numpy.linalg.solve(numpy.transpose(V), B)

new_shp = new_coeffs_flat.shape[:1] + shp[1:]
new_coeffs = new_coeffs_flat.reshape(new_shp)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
download_url=tarball,
license="LGPL v3 or later",
packages=["FIAT"],
install_requires=["numpy", "recursivenodes", "scipy", "sympy"])
install_requires=["numpy", "recursivenodes", "sympy"])

0 comments on commit 56ce030

Please sign in to comment.