From b46213546a33e8697ea814d2a3cbd4bb3b3f7c6f Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 1 Oct 2024 16:20:28 +0200 Subject: [PATCH] Set imat = np.ones((1, 1), dtype=float) if self.greville.size == 1 --- psydac/fem/splines.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/psydac/fem/splines.py b/psydac/fem/splines.py index 11ebbc1f2..8f2737d45 100644 --- a/psydac/fem/splines.py +++ b/psydac/fem/splines.py @@ -171,14 +171,17 @@ def init_interpolation( self, dtype=float ): Greville points. """ - imat = collocation_matrix( - knots = self.knots, - degree = self.degree, - periodic = self.periodic, - normalization = self.basis, - xgrid = self.greville, - multiplicity = self.multiplicity - ) + if self.greville.size == 1: + imat = np.ones((1, 1), dtype=float) + else: + imat = collocation_matrix( + knots = self.knots, + degree = self.degree, + periodic = self.periodic, + normalization = self.basis, + xgrid = self.greville, + multiplicity = self.multiplicity + ) if self.periodic: # Convert to CSC format and compute sparse LU decomposition