Subject: [FFC-dev] [Bug 423398] Re: fractions inside exponential don't work with -O

From: Garth Wells <[email-masked]>
Date: Thu, 24 Sep 2009 07:37:01 -0000

** Changed in: ffc
       Status: Fix Released => Fix Committed

-- 
fractions inside exponential don't work with -O
https://bugs.launchpad.net/bugs/423398
You received this bug notification because you are subscribed to FFC.

Status in FEniCS Form Compiler: Fix Committed

Bug description:
More woes with optimisation and fractions. Inside a .ufl file, the code

  M = M0*exp(1.0/(T1))

where T1 is a function works fine and 
 
 M = M0*exp(1.0/(T1-T0))

where T1 and T0 are functions seems to work without optimisation. With optimisation, compiling against DOLFIN leads to the error message 

 ThermoChemicalMechanical.cpp: In member function ‘virtual void thermochemicalmechanical_0_cell_integral_0_quadrature::tabulate_tensor(double*, const double* const*, const ufc::cell&) const’:
ThermoChemicalMechanical.cpp:34645: error: ‘F0’ was not declared in this scope
ThermoChemicalMechanical.cpp:34645: error: ‘F1’ was not declared in this scope

The following works fine:

Expression.ufl:
element = FiniteElement("CG", triangle, 1)
M0 = Function(element)
f0 = Function(element)
f1 = Function(element)
#M = M0*exp(1.0/f0)*dx
M = M0*exp(1.0/(f0 - f1))*dx

$ ffc -O Expression.ufl

main.cpp:
#include <ufc.h>
#include "Expression.h"
int main()
{
  return 0;
}

$ c++ -I/home/oelgaard/local/include/ main.cpp

---

From: logg <[email-masked]>
Date: Thu, 24 Sep 2009 19:49:15 -0000

** Changed in: ffc
       Status: Fix Committed => Fix Released

Status in FEniCS Form Compiler: Fix Released

Bug description:

  M = M0*exp(1.0/(T1))

 M = M0*exp(1.0/(T1-T0))

Expression.ufl:

$ ffc -O Expression.ufl

main.cpp:
#include <ufc.h>
#include "Expression.h"
int main()
{
  return 0;
}