# assemble_system¶

dolfin.fem.assembling.assemble_system(A_form, b_form, bcs=None, x0=None, A_coefficients=None, b_coefficients=None, A_function_spaces=None, b_function_spaces=None, cell_domains=None, exterior_facet_domains=None, interior_facet_domains=None, reset_sparsity=True, add_values=False, finalize_tensor=True, keep_diagonal=False, A_tensor=None, b_tensor=None, backend=None, form_compiler_parameters=None)

Assemble form(s) and apply any given boundary conditions in a symmetric fashion and return tensor(s).

The standard application of boundary conditions does not necessarily preserve the symmetry of the assembled matrix. In order to perserve symmetry in a system of equations with boundary conditions, one may use the alternative assemble_system instead of multiple calls to assemble.

Examples of usage

For instance, the statements

A = assemble(a)
b = assemble(L)
bc.apply(A, b)


can alternatively be carried out by

A, b = assemble_system(a, L, bc)


The statement above is valid even if bc is a list of DirichletBC instances. For more info and options, see assemble.