Setting form_compiler_parameters for fenics 2017


1.0k
views
1
13 months ago by
kreitz  
Hi, In the 2016.2 version of fenics I was able to set the form_compiler_parameters for a NonlinearVariationalProblem. This does not work in 2017 and I am not sure how to set the parameters as they are no longer in the dictionary parameters['form_compiler_parameters']? They drastically sped up the program. The parameters I would like to set, and their values, are:

form_compiler_parameters = {"optimize": True,
                                            "eliminate_zeros": True,
                                            "precompute_basis_const": True
                                            "precompute_ip_const": True}

In the 2017 version, I get a KeyError: "'eliminate_zeros' is not a parameter" for "eliminate_zeros", "precompute_basis_const", and "precompute_ip_const". (When I print the possible keys for the form_compiler_parameters they are not listed).

For reference the global parameters I set are:
parameters['form_compiler']['cpp_optimize'] = True
parameters['form_compiler']['representation'] = 'quadrature'
parameters['allow_extrapolation'] = True

And the solver (nls) parameters are:
nls.parameters['nonlinear_solver'] = 'snes'
nls.parameters['snes_solver']['method'] = 'vinewtonrsls'
nls.parameters['snes_solver']['relative_tolerance'] = 1e-6
nls.parameters['snes_solver']['absolute_tolerance'] = 1e-6
nls.parameters['snes_solver']["preconditioner"]="hypre-amg"
nls.parameters['snes_solver']['error_on_nonconvergence'] = True
nls.parameters['snes_solver']['linear_solver'] = 'mumps'
nls.parameters['snes_solver']['maximum_iterations'] = 100
nls.parameters['snes_solver']['report'] = True

Thank you
Community: FEniCS Project

2 Answers


4
13 months ago by
Some of those parameter are specific to quadrature representation. Since the last release uflacs representation is default. It also offers a possibility to tweak somewhat similar parameters, some might have missing interface. But in general uflacs is known to outperform legacy quadrature and tensor representations in all the practical situations. So there should not be a need to tweak related setting unless there's a bottleneck in assembly of your problem.

So I recommend strongly to stop using legacy quadrature representation which might be removed soon. cpp_optimize is not be needed as it is turned on by default.

Using parameters['allow_extrapolation'] = True permanently turned on is quite dangerous, especially in parallel. But as this is off-topic here I won't comment on this anymore.
Hello,
Can you explain why parameters['allow_extrapolation'] = True is dangerous in parallel?
I have a code, that runs well on parallel in my machine, but when i use it on an anoher computer (HPC) i get error when i evaluate some function u(x)
Thanks.
written 12 months ago by Francois Usseglio Viretta  
0
13 months ago by
kreitz  
Thanks. 

The default representation is much faster that quadrature was in 2016.2 fenics! 
Please login to add an answer/comment or follow this question.

Similar posts:
Search »