I've presented solution of my PDE in form of series. So I want to calculate an error of FEM-solution.
Let uh be FEM-solution, u - exact solution (series).
I want to run this:
errornorm(u, uh, norm_type='l2')
How can I get Expression
for finite sum (that approximates series)?
My ideas:
- to make
Expression
s for all summands and sum them. But sum of Expression
s returns ufl.algebra.Sum
that is unsuitable for errornorm
. Maybe there is some way to transform it into Expression
?
- to make
str
for my sum and put it in Expression
init. This approach is very wasteful for sums with large amount of summands.
Or maybe there is some function for getting sum?