# ffcx.main

Command-line interface to FFCx.

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

Functions

`main`([args]) | Run ffcx on a UFL file.

class ffcx.main.Sequence

  Bases: `Reversible`, `Collection`

  All the operations on a read-only sequence.

  Concrete subclasses must override __new__ or __init__, __getitem__, and __len__.

  count(value) → integer -- return number of occurrences of value
  index(value[, start[, stop]]) → integer -- return first index of value.

    Raises ValueError if the value is not present.

    Supporting start and stop arguments is optional, but recommended.

ffcx.main.arg_type

  alias of `str`

ffcx.main.get_options(priority_options: dict[str, type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None | int | float] | None = None) → dict[str, int | float | type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None]

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

  Parameters:

    priority_options – take priority over all other option values (see notes)

  Returns:

    merged option values

  Note

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

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

  Priority ordering of options from highest to lowest is:

  - priority_options (API and command line options)

  - $PWD/ffcx_options.json (local options)

  - $XDG_CONFIG_HOME/ffcx/ffcx_options.json (user options)

  - FFCX_DEFAULT_OPTIONS in ffcx.options

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

  Example ffcx_options.json file:

  > { “epsilon”: 1e-7 }

ffcx.main.main(args: Sequence[str] | None = None) → int

  Run ffcx on a UFL file.