FFC

fractions inside exponential don't work with -O

Bug #423398 reported by Garth Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FFC
Fix Released
Medium
Kristian B. Ølgaard

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

Changed in ffc:
assignee: nobody → oelgaard (k-b-oelgaard)
importance: Undecided → Medium
description: updated
Changed in ffc:
status: New → Fix Committed
status: Fix Committed → Fix Released
Changed in ffc:
status: Fix Released → Fix Committed
Anders Logg (logg)
Changed in ffc:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.