File: plot_nedelec.py

package info (click to toggle)
basix 0.0.1~git20210122.4f10ef2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 696 kB
  • sloc: cpp: 3,987; python: 1,918; makefile: 33
file content (14 lines) | stat: -rw-r--r-- 452 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import matplotlib.pyplot as plt
from basix import Nedelec, CellType, LatticeType, create_lattice

N = Nedelec("triangle", 2)
pts = create_lattice(CellType.triangle, 20, LatticeType.equispaced, True)
w = N.tabulate(0, pts)[0]
nc = w.shape[1]//2
fig, ax = plt.subplots(2, 4)
for j, a in enumerate(ax.flatten()):
    ned_shape_fn_x = w[:, j]
    ned_shape_fn_y = w[:, j + nc]
    a.quiver(pts[:, 0], pts[:, 1], ned_shape_fn_x, ned_shape_fn_y)

plt.show()