Skip to content

Formspecific options handling

Dominic Kempf requested to merge feature/formspecific-options-handling into master

This turned into a larger thing than originally expected.

Main changes for you @rhess @marcel.koch:

  • There is get_option and get_form_option. Check options.py to see which ones are form-specific. Also, think about that in the future when adding options.
  • You can write the following in your ini file (not claiming this is a super use case though)
[formcompiler]
operators = op1, op2

[formcompiler.op1]
form = r
classname = MyOperator
filename = myfile.hh
numerical_jacobian = 1

[formcompiler.op2]
form = mass
classname = MyMassOperator

Note, however that you do not have to specify this. The defaults are:

  • formcompiler.operators -> r
  • formcompiler.<op>.form -> <op>
  • formcompiler.<op>.classname -> <formcompiler.<op>.form>Operator
  • formcompiler.<op>.filename -> <cmake-targetname>_<formcompiler.<op>.classname>.hh

So, if you want to do nothing fancy, but specify one form specific option you do

  • name the form r in the UFL file
  • Write formcompiler.r.<option> = <value> in your inifile (or with section syntax of course)

This fixes #106 (closed)

Edited by Dominic Kempf

Merge request reports

Loading