2 import iam_sympy_example
5 Go to the sympy root directory and execute:
7 $ python examples/fem_test.py
8 [ 1/60, 0, -1/360, 0, -1/90, -1/360]
9 [ 0, 4/45, 0, 2/45, 2/45, -1/90]
10 [-1/360, 0, 1/60, -1/90, 0, -1/360]
11 [ 0, 2/45, -1/90, 4/45, 2/45, 0]
12 [ -1/90, 2/45, 0, 2/45, 4/45, 0]
13 [-1/360, -1/90, -1/360, 0, 0, 1/60]
18 t
= ReferenceSimplex(2)
22 #compute u = sum_i u_i N_i
24 for i
in range(0, fe
.nbf()):
25 ui
= Symbol("u_%d" % i
)
31 for i
in range(0, fe
.nbf()):
33 for j
in range(0, fe
.nbf()):
35 integrands
= diff(Fi
, uj
)
36 J
[j
,i
] = t
.integrate(integrands
)