ffcx.main

Command-line interface to FFCx.

Parse command-line arguments and generate code from input UFL form files.

Functions

main([args])

ffcx.main.get_parameters(priority_parameters: Optional[dict] = None) dict[source]

Return (a copy of) the merged parameter values for FFCX.

Parameters

priority_parameters – take priority over all other parameter values (see notes)

Returns

dict

Return type

merged parameter values

Notes

This function sets the log level from the merged parameter values prior to returning.

The ffcx_parameters.json files are cached on the first call. Subsequent calls to this function use this cache.

Priority ordering of parameters from highest to lowest is:

  • priority_parameters (API and command line parameters)

  • $PWD/ffcx_parameters.json (local parameters)

  • $XDG_CONFIG_HOME/ffcx/ffcx_parameters.json (user parameters)

  • FFCX_DEFAULT_PARAMETERS in ffcx.parameters

XDG_CONFIG_HOME is ~/.config/ if the environment variable is not set.

Example ffcx_parameters.json file:

{ “assume_aligned”: 32, “epsilon”: 1e-7 }

ffcx.main.main(args=None)[source]