| 1 |
# Copyright (C) 2010 Kristian B. Oelgaard |
| 2 |
# |
| 3 |
# This file is part of FFC. |
| 4 |
# |
| 5 |
# FFC is free software: you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU Lesser General Public License as published by |
| 7 |
# the Free Software Foundation, either version 3 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# FFC is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU Lesser General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU Lesser General Public License |
| 16 |
# along with FFC. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
# |
| 18 |
# Test all algebra operators on Coefficients. |
| 19 |
# |
| 20 |
# Compile this form with FFC: ffc MathFunctions.ufl |
| 21 |
|
| 22 |
element = FiniteElement("Lagrange", triangle, 1) |
| 23 |
|
| 24 |
c0 = Coefficient(element) |
| 25 |
c1 = Coefficient(element) |
| 26 |
|
| 27 |
s0 = 3*c0 - c1 |
| 28 |
p0 = c0*c1 |
| 29 |
f0 = c0/c1 |
| 30 |
|
| 31 |
integrand = sqrt(c0) + sqrt(s0) + sqrt(p0) + sqrt(f0)\ |
| 32 |
+ exp(c0) + exp(s0) + exp(p0) + exp(f0)\ |
| 33 |
+ ln(c0) + ln(s0) + ln(p0) + ln(f0)\ |
| 34 |
+ cos(c0) + cos(s0) + cos(p0) + cos(f0)\ |
| 35 |
+ sin(c0) + sin(s0) + sin(p0) + sin(f0)\ |
| 36 |
+ tan(c0) + tan(s0) + tan(p0) + tan(f0)\ |
| 37 |
+ acos(c0) + acos(s0) + acos(p0) + acos(f0)\ |
| 38 |
+ asin(c0) + asin(s0) + asin(p0) + asin(f0)\ |
| 39 |
+ atan(c0) + atan(s0) + atan(p0) + atan(f0)\ |
| 40 |
+ erf(c0) + erf(s0) + erf(p0) + erf(f0)\ |
| 41 |
+ bessel_I(1, c0) + bessel_I(1, s0) + bessel_I(0, p0) + bessel_I(0, f0)\ |
| 42 |
+ bessel_J(1, c0) + bessel_J(1, s0) + bessel_J(0, p0) + bessel_J(0, f0)\ |
| 43 |
+ bessel_K(1, c0) + bessel_K(1, s0) + bessel_K(0, p0) + bessel_K(0, f0)\ |
| 44 |
+ bessel_Y(1, c0) + bessel_Y(1, s0) + bessel_Y(0, p0) + bessel_Y(0, f0) |
| 45 |
|
| 46 |
a = integrand*dx |
| 47 |
|