dolfin.fem.assembling

Form assembly

The C++ assemble function (renamed to cpp_assemble) is wrapped with an additional preprocessing step where code is generated using the FFC JIT compiler.

The C++ PDE classes are reimplemented in Python since the C++ classes rely on the dolfin::Form class which is not used on the Python side.

Functions

assemble_local(form, cell[, …]) JIT assemble_local
assemble_system(A_form, b_form[, bcs, x0, …]) Assemble form(s) and apply any given boundary conditions in a symmetric fashion and return tensor(s).
dolfin.fem.assembling.assemble_local(form, cell, form_compiler_parameters=None)[source]

JIT assemble_local

dolfin.fem.assembling.assemble_system(A_form, b_form, bcs=None, x0=None, form_compiler_parameters=None, A_tensor=None, b_tensor=None, backend=None)[source]

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.