← Back to team overview

ffc team mailing list archive

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

 

** 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