We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 622db03 commit bcf403bCopy full SHA for bcf403b
python/demo/demo_lagrange_variants.py
@@ -29,6 +29,7 @@
29
30
import basix
31
import basix.ufl
32
+import numpy as np
33
import ufl
34
from dolfinx import default_real_type, fem, mesh
35
@@ -142,11 +143,11 @@ def saw_tooth(x):
142
143
uh.interpolate(lambda x: saw_tooth(x[0]))
144
if MPI.COMM_WORLD.size == 1: # Skip this plotting in parallel
145
pts: list[list[float]] = []
- cells: list[int] = []
146
+ cells = np.empty((0,), dtype=np.int32)
147
for cell in range(N):
148
for i in range(51):
149
pts.append([cell / N + i / 50 / N, 0, 0])
- cells.append(cell)
150
+ cells = np.append(cells, [cell])
151
values = uh.eval(pts, cells)
152
plt.plot(pts, [saw_tooth(i[0]) for i in pts], "k--")
153
plt.plot(pts, values, "r-")
0 commit comments