Assembler

Module for assembling and integrating functionals, residuals and tangents, supporting both ‘sparse’ and ‘dense’ modes and ‘user potentials’, ‘user residuals’ and ‘user elements’.

The assembly modes ‘dense’ and ‘sparse’ use JAX’s automatic differentiation capabilities to determine the global residual and the tangent for the given values of the degrees of freedom and the models and variational schemes specified in static_settings. In the ‘dense’ mode, the tangent matrix is returned as a jnp.ndarray, while in the ‘sparse’ mode, it is returned as a jax.experimental.BCOO matrix with duplicates. In the ‘user potential’, ‘user residual’ and ‘user element’ modes, the global residual and tangent can be assembled based on user-defined element-wise contributions. Depending on the execution location, the entries are calculated on CPU or GPU. For an efficient calculation, JAX’s automatic vectorization transformation (vmap) is used. The summation of duplicates is then carried out within the solver module. Currently, SciPy is used for this on the CPU.

General assembling functions

integrate_functional(dofs, settings, ...)

Integrate functional as sum over set of domains.

assemble_residual(dofs, settings, ...)

Assemble residuals over set of domains.

assemble_tangent_diagonal(dofs, settings, ...)

Assemble the diagonal of the tangent matrix.

assemble_tangent(dofs, settings, static_settings)

Assemble the full (possibly sparse) tangent matrix.

Dense assembling

dense_integrate_functional(dofs, settings, ...)

Dense integration of functional of specified domain.

dense_assemble_residual(dofs, settings, ...)

Dense assembly of residual of specified domain.

dense_assemble_tangent(dofs, settings, ...)

Dense assembly of tangent of specified domain.

Sparse assembling

sparse_integrate_functional(dofs, settings, ...)

Sparse integration of functional of specified domain.

sparse_assemble_residual(dofs, settings, ...)

Sparse assembly of residual of specified domain.

sparse_assemble_tangent_diagonal(dofs, ...)

Sparse assembly of the diagonal of the tangent matrix for specified set.

sparse_assemble_tangent(dofs, settings, ...)

Sparse assembly of the full tangent matrix of specified domain.

Assembling for user potentials

user_potential_integrate_functional(dofs, ...)

Assembly of potential for custom user definition of specified domain.

user_potential_assemble_residual(dofs, ...)

Assembly of residual for custom user potential of specified domain.

user_potential_assemble_tangent_diagonal(...)

Assembly of the diagonal of the tangent matrix for custom user potential of specified domain.

user_potential_assemble_tangent(dofs, ...)

Assembly of the full (sparse) tangent matrix for custom user potential of specified domain.

Assembling for user residuals

user_residual_assemble_residual(dofs, ...)

Assembly of residual for custom user residual of specified domain.

user_residual_assemble_tangent_diagonal(...)

Assembly of the diagonal of the tangent matrix for custom user residual of specified domain.

user_residual_assemble_tangent(dofs, ...)

Assembly of the full (sparse) tangent matrix for custom user residual of specified domain.

Assembling for user elements

user_element_assemble_residual(dofs, ...)

Assembly of residual for custom user element of specified domain.

user_element_assemble_tangent_diagonal(dofs, ...)

Assembly of the diagonal of the tangent matrix for custom user element of specified domain.

user_element_assemble_tangent(dofs, ...)

Assembly of the full (sparse) tangent matrix for custom user element of specified domain.