sympy_test.py
Go to the documentation of this file.00001
00002 from fem_sympy import *
00003
00004 t = ReferenceSimplex(2)
00005 fe = Lagrange(2,5)
00006
00007 u = 0
00008
00009 us = []
00010 for i in range(0, fe.nbf()):
00011 ui = Symbol("u_%d" % i)
00012 us.append(ui)
00013 u += ui*fe.N[i]
00014
00015
00016 J = zeronm(fe.nbf(), fe.nbf())
00017 for i in range(0, fe.nbf()):
00018 Fi = u*fe.N[i]
00019 for j in range(0, fe.nbf()):
00020 uj = us[j]
00021 integrands = diff(Fi, uj)
00022 J[j,i] = t.integrate(integrands)
00023
00024
00025
00026
00027
00028