ffcx.formatting#

Compiler stage 5: Code formatting.

This module implements the formatting of UFCx code from a given dictionary of generated C++ code for the body of each UFCx function.

It relies on templates for UFCx code available as part of the module ufcx_utils.

Functions

format_code(code_blocks)

Format given code in UFCx format.

write_code(code, prefix, suffixes, output_dir)

Write code to files.

ffcx.formatting.format_code(code_blocks: CodeBlocks) list[str][source]#

Format given code in UFCx format.

Returns two strings with header and source file contents.

ffcx.formatting.write_code(code: list[str], prefix: str, suffixes: tuple[str, ...], output_dir: str) None[source]#

Write code to files.