fem.assemble

dolfinx_graph_ad.fem.assemble.assemble_scalar(*args, **kwargs)

OVERLOADS: dolfinx.fem.assemble_scalar(). Assemble functional. The returned value is local and not accumulated across processes.

The overloaded function adds the functionality to keep track of the dependencies in the computational graph. The original functionality is kept.

Parameters:
  • args – Arguments to dolfinx.fem.assemble_scalar().

  • kwargs – Keyword arguments to dolfinx.fem.assemble_scalar().

  • graph (graph, optional) – An additional keyword argument to specifier whether the assemble operation should be added to the graph. If not present, the original functionality of dolfinx is used without any additional functionalities.

Returns:

The computed scalar on the calling rank

Return type:

float

Note

When a form is assembled into a scalar value, the information about its dependencies is lost, and the resulting scalar does not support automatic differentiation. To this end the graph is used to keep track of the dependencies between the resulting scalar value and the used form to obtain the scalar value.