Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
With the change, the function shouldn't get into trouble if it created a BSpline with a degree >3
  • Loading branch information
NiklasVin authored Nov 16, 2023
1 parent 1b9d9cb commit b149bcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions partitioned-heat-conduction/fenics/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def b_splines(precice, degree, dt):
'''
# use equidistant samples
# apparently you need 2k+2 samples for degree k
nodes = np.linspace(0,dt,2*3+3) # <-- But these are 2k+3 samples
nodes = np.linspace(0,dt,2*degree+3) # <-- But these are 2k+3 samples
weights = []
b_splines = {}

Expand All @@ -26,4 +26,4 @@ def b_splines(precice, degree, dt):
weights_k.append(weights[i][k])
b1,b2,b3 = interpol.splrep(nodes, weights_k,s=0, k=degree)
b_splines[k] = interpol.BSpline(b1, b2, b3, extrapolate=False)
return b_splines
return b_splines

0 comments on commit b149bcd

Please sign in to comment.