This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

optimize parameter in FFC

+3 votes

I find that certain problems do not converge when I use

parameters["form_compiler"]["optimize"] = True

However they converge when I use

parameters["form_compiler"]["optimize"] = False

Is there a way to test the optimization features like 'eliminate zeros' individually to see why some of my problems break?

asked Jul 1, 2013 by chaffra FEniCS User (1,830 points)

Johan and Martin proposed two contradictory answers here. You can try if Johan's suggestion works.

1 Answer

+2 votes
 
Best answer

Both this approach

parameters['form_compiler']['representation'] = 'quadrature'
parameters['form_compiler']['optimize'] = True
parameters['form_compiler'].add('eliminate_zeros', False)

or this approach

assemble(foo, form_compiler_parameters={
                        'representation': 'quadrature',
                        'optimize': True,
                        'eliminate_zeros': False
                                        })

seem to work - just check the generated code. But maybe FFC-specific flags are not taken into account when generating a hash of the form (in fact I don't know from what the hash is generated) because I changed something and got a response Reusing form from cache. - but I din't investigate this.

answered Jul 1, 2013 by Jan Blechta FEniCS Expert (51,420 points)
selected Jul 5, 2013 by Jan Blechta

All parameters should be included in the hash. If not, there is a bug, but I think this has been tested extensively so I'd be surprised.

...