Skip to content

Instantly share code, notes, and snippets.

@TheBB
Created October 3, 2017 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheBB/62ce0707c266adbcd6674e4c54284270 to your computer and use it in GitHub Desktop.
Save TheBB/62ce0707c266adbcd6674e4c54284270 to your computer and use it in GitHub Desktop.
from nutils import mesh, function as fn, plot
import numpy as np
xpts = np.linspace(0, 4, 5)
domain, geom = mesh.rectilinear([xpts])
basis = domain.basis('spline', 3, knotmultiplicities=[[4, 1, 3, 1, 4]])
dofs = [0, 0, 0, .5, 1, .5, 0, 0, 0]
func = basis.dot(dofs)
x, y = domain.elem_eval([geom, func], separate=True, ischeme='bezier40')
with plot.PyPlot('test', index=0) as plt:
plt.mesh(x, y)
plt.xlim(0, 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment