# Copyright (C) 2010 Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FFC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with FFC. If not, see <http://www.gnu.org/licenses/>.
#
# Test all algebra operators on Coefficients.
#
# Compile this form with FFC: ffc AlgebraOperators.ufl

element = FiniteElement("Lagrange", triangle, 1)

c0 = Coefficient(element)
c1 = Coefficient(element)

s0 = 3*c0 - c1
p0 = c0*c1
f0 = c0/c1

integrand = 5*c0 + 5*p0 + 5*f0\
          + s0*c0 + s0*p0 + s0*f0\
          + 5/c0 + 5/p0 + 5/f0\
          + s0/c0 + s0/p0 + s0/f0\
          + s0/5 + s0/5 + s0/5\
          + c0**2 + s0**2 + p0**2 + f0**2\
          + c1**2.2 + s0**2.2 + p0**2.2 + f0**2.2\
          + c0**c1 + s0**c0 + p0**c0 + f0**c0\
          + c0**s0 + s0**p0 + p0**f0 + f0**p0\
          + abs(c0) + abs(s0) + abs(p0) + abs(f0)

a = integrand*dx

