|
DOLFINx 0.12.0.0
DOLFINx C++
|
Functions supporting assembly of a finite element fem::Form. More...
#include "FunctionSpace.h"#include "assemble_matrix_impl.h"#include "assemble_scalar_impl.h"#include "assemble_vector_impl.h"#include "pack.h"#include "traits.h"#include <algorithm>#include <array>#include <basix/mdspan.hpp>#include <cstddef>#include <cstdint>#include <dolfinx/common/IndexMap.h>#include <dolfinx/common/log.h>#include <dolfinx/common/sort.h>#include <dolfinx/common/types.h>#include <dolfinx/la/utils.h>#include <dolfinx/mesh/EntityMap.h>#include <format>#include <functional>#include <map>#include <memory>#include <optional>#include <ranges>#include <span>#include <stdexcept>#include <utility>#include <vector>

Go to the source code of this file.
Namespaces | |
| namespace | dolfinx |
| Top-level namespace. | |
| namespace | dolfinx::fem |
| Finite element method functionality. | |
Functions | |
| template<dolfinx::scalar T> | |
| std::map< std::pair< IntegralType, int >, std::pair< std::span< const T >, int > > | make_coefficients_span (const std::map< std::pair< IntegralType, int >, std::pair< std::vector< T >, int > > &coeffs) |
| Create a map of std::spans from a map of std::vectors. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| T | assemble_scalar (const Form< T, U > &M, std::span< const T > constants, const std::map< std::pair< IntegralType, int >, std::pair< std::span< const T >, int > > &coefficients) |
| Assemble functional into scalar. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| T | assemble_scalar (const Form< T, U > &M) |
| Assemble functional into scalar. | |
| template<typename V, std::floating_point U, dolfinx::scalar T = typename std::remove_cvref_t<V>::value_type> requires std::is_same_v<typename std::remove_cvref_t<V>::value_type, T> | |
| void | assemble_vector (V &&b, const Form< T, U > &L, std::span< const T > constants, const std::map< std::pair< IntegralType, int >, std::pair< std::span< const T >, int > > &coefficients) |
| Assemble linear form into a vector. | |
| template<typename V, std::floating_point U, dolfinx::scalar T = typename std::remove_cvref_t<V>::value_type> requires std::is_same_v<typename std::remove_cvref_t<V>::value_type, T> | |
| void | assemble_vector (V &&b, const Form< T, U > &L) |
| Assemble linear form into a vector. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| std::vector< std::int8_t > | bc_dof_markers (const FunctionSpace< U > &V, const std::vector< std::reference_wrapper< const DirichletBC< T, U > > > &bcs) |
| Mark the dofs of V (owned and ghost, unrolled) constrained by the boundary conditions in bcs that are defined on V or a subspace of it. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| std::array< std::span< const std::int8_t >, 2 > | bc_dof_markers_pair (const Form< T, U > &a, const std::vector< std::reference_wrapper< const DirichletBC< T, U > > > &bcs, std::array< std::vector< std::int8_t >, 2 > &storage) |
| Mark the dofs of the test and trial spaces of a that the boundary conditions in bcs constrain. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| std::pair< std::vector< std::vector< std::int8_t > >, std::vector< std::vector< T > > > | bc_lifting_data (const std::vector< std::optional< std::reference_wrapper< const Form< T, U > > > > &a, const std::vector< std::vector< std::reference_wrapper< const DirichletBC< T, U > > > > &bcs1) |
| Constrained dof markers and boundary condition values on the trial space of each form in a, as used by apply_lifting(). | |
| template<typename V, std::floating_point U = scalar_value_t<typename std::remove_cvref_t<V>::value_type>, dolfinx::scalar T = typename std::remove_cvref_t<V>::value_type> requires std::is_same_v<typename std::remove_cvref_t<V>::value_type, T> | |
| void | apply_lifting (V &&b, const std::vector< std::optional< std::reference_wrapper< const Form< T, U > > > > &a, const std::vector< std::span< const T > > &constants, const std::vector< std::map< std::pair< IntegralType, int >, std::pair< std::span< const T >, int > > > &coeffs, const std::vector< std::span< const std::int8_t > > &bc_markers1, const std::vector< std::span< const T > > &bc_values1, const std::vector< std::span< const T > > &x0, T alpha) |
| Modify the right-hand side vector to account for constraints (Dirichlet boundary condition constraints), with the constrained dofs and their values given as arrays. | |
| template<typename V, std::floating_point U = scalar_value_t<typename std::remove_cvref_t<V>::value_type>, dolfinx::scalar T = typename std::remove_cvref_t<V>::value_type> requires std::is_same_v<typename std::remove_cvref_t<V>::value_type, T> | |
| void | apply_lifting (V &&b, const std::vector< std::optional< std::reference_wrapper< const Form< T, U > > > > &a, const std::vector< std::span< const T > > &constants, const std::vector< std::map< std::pair< IntegralType, int >, std::pair< std::span< const T >, int > > > &coeffs, const std::vector< std::vector< std::reference_wrapper< const DirichletBC< T, U > > > > &bcs1, const std::vector< std::span< const T > > &x0, T alpha) |
| Modify the right-hand side vector to account for constraints (Dirichlet boundary condition constraints). This modification is known as 'lifting'. | |
| template<typename V, std::floating_point U = scalar_value_t<typename std::remove_cvref_t<V>::value_type>, dolfinx::scalar T = typename std::remove_cvref_t<V>::value_type> requires std::is_same_v<typename std::remove_cvref_t<V>::value_type, T> | |
| void | apply_lifting (V &&b, const std::vector< std::optional< std::reference_wrapper< const Form< T, U > > > > &a, const std::vector< std::vector< std::reference_wrapper< const DirichletBC< T, U > > > > &bcs1, const std::vector< std::span< const T > > &x0, T alpha) |
| Modify the right-hand side vector to account for constraints (Dirichlet boundary conditions constraints). This modification is known as 'lifting'. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| void | assemble_matrix (la::MatSet< T > auto mat_add, const Form< T, U > &a, std::span< const T > constants, const std::map< std::pair< IntegralType, int >, std::pair< std::span< const T >, int > > &coefficients, std::span< const std::int8_t > dof_marker0, std::span< const std::int8_t > dof_marker1) |
| Assemble bilinear form into a matrix. Matrix must already be initialised. Does not zero or finalise the matrix. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| void | assemble_matrix (auto mat_add, const Form< T, U > &a, const std::vector< std::reference_wrapper< const DirichletBC< T, U > > > &bcs) |
| Assemble bilinear form into a matrix. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| void | assemble_matrix (auto mat_add, const Form< T, U > &a, std::span< const std::int8_t > dof_marker0, std::span< const std::int8_t > dof_marker1) |
| Assemble bilinear form into a matrix. Matrix must already be initialised. Does not zero or finalise the matrix. | |
| template<dolfinx::scalar T, std::floating_point U> | |
| void | set_diagonal (auto set_fn, const FunctionSpace< U > &V, const std::vector< std::reference_wrapper< const DirichletBC< T, U > > > &bcs, T diagonal=T(1)) |
| Set a value on the diagonal of the locally owned rows that a Dirichlet boundary condition constrains. | |
Functions supporting assembly of a finite element fem::Form.
| std::vector< std::int8_t > bc_dof_markers | ( | const FunctionSpace< U > & | V, |
| const std::vector< std::reference_wrapper< const DirichletBC< T, U > > > & | bcs ) |
Mark the dofs of V (owned and ghost, unrolled) constrained by the boundary conditions in bcs that are defined on V or a subspace of it.
| std::array< std::span< const std::int8_t >, 2 > bc_dof_markers_pair | ( | const Form< T, U > & | a, |
| const std::vector< std::reference_wrapper< const DirichletBC< T, U > > > & | bcs, | ||
| std::array< std::vector< std::int8_t >, 2 > & | storage ) |
Mark the dofs of the test and trial spaces of a that the boundary conditions in bcs constrain.
Markers depend only on the space, so a form whose test and trial spaces are the same marks its dofs once and shares the array between its rows and its columns. The two returned spans are then the same array rather than equal copies.
| [in] | a | Bilinear form whose spaces are marked. |
| [in] | bcs | Boundary conditions. Only those defined on a space or a subspace of it mark that space. |
| [out] | storage | Backing storage for the returned spans, which are views into it and are valid for as long as it is. |
| std::pair< std::vector< std::vector< std::int8_t > >, std::vector< std::vector< T > > > bc_lifting_data | ( | const std::vector< std::optional< std::reference_wrapper< const Form< T, U > > > > & | a, |
| const std::vector< std::vector< std::reference_wrapper< const DirichletBC< T, U > > > > & | bcs1 ) |
Constrained dof markers and boundary condition values on the trial space of each form in a, as used by apply_lifting().