DOLFIN-X
DOLFIN-X C++ interface
|
Finite element method functionality. More...
Namespaces | |
DofMapBuilder | |
Builds a DofMap on a mesh::Mesh. | |
SparsityPatternBuilder | |
Functions to compute the sparsity pattern based on DOF maps. | |
Classes | |
class | CoordinateElement |
This class manages coordinate mappings for isoparametric cells. More... | |
class | DirichletBC |
Interface for setting (strong) Dirichlet boundary conditions. More... | |
class | DiscreteOperators |
Discrete gradient operators providing derivatives of functions. More... | |
class | DofMap |
Degree-of-freedom map. More... | |
class | ElementDofLayout |
The class represents the degree-of-freedom (dofs) for an element. Dofs are associated with a mesh entity. This class also handles sub-space dofs, which are views into the parent dofs. More... | |
class | FiniteElement |
Finite Element, containing the dof layout on a reference element, and various methods for evaluating and transforming the basis. More... | |
class | Form |
Class for variational forms. More... | |
class | ReferenceCellGeometry |
Tabulates the vertex positions for the reference cell. More... | |
Enumerations | |
enum | IntegralType : std::int8_t { cell = 0, exterior_facet = 1, interior_facet = 2, vertex = 3 } |
Type of integral. | |
Functions | |
template<typename T > | |
T | assemble_scalar (const Form< T > &M) |
Assemble functional into scalar. Caller is responsible for accumulation across processes. More... | |
template<typename T > | |
void | assemble_vector (Eigen::Ref< Eigen::Matrix< T, Eigen::Dynamic, 1 >> b, const Form< T > &L) |
Assemble linear form into an Eigen vector. More... | |
template<typename T > | |
void | apply_lifting (Eigen::Ref< Eigen::Matrix< T, Eigen::Dynamic, 1 >> b, const std::vector< std::shared_ptr< const Form< T >>> &a, const std::vector< std::vector< std::shared_ptr< const DirichletBC< T >>>> &bcs1, const std::vector< Eigen::Ref< const Eigen::Matrix< T, Eigen::Dynamic, 1 >>> &x0, double scale) |
Modify b such that: More... | |
template<typename T > | |
void | assemble_matrix (const std::function< int(std::int32_t, const std::int32_t *, std::int32_t, const std::int32_t *, const T *)> &mat_add, const Form< T > &a, const std::vector< std::shared_ptr< const DirichletBC< T >>> &bcs) |
Assemble bilinear form into a matrix. More... | |
template<typename T > | |
void | assemble_matrix (const std::function< int(std::int32_t, const std::int32_t *, std::int32_t, const std::int32_t *, const T *)> &mat_add, const Form< T > &a, const std::vector< bool > &dof_marker0, const std::vector< bool > &dof_marker1) |
Assemble bilinear form into a matrix. Matrix must already be initialised. Does not zero or finalise the matrix. More... | |
template<typename T > | |
void | add_diagonal (const std::function< int(std::int32_t, const std::int32_t *, std::int32_t, const std::int32_t *, const T *)> &mat_add, const Eigen::Ref< const Eigen::Array< std::int32_t, Eigen::Dynamic, 1 >> &rows, T diagonal=1.0) |
Adds a value to the diagonal of a matrix for specified rows. It is typically called after assembly. The assembly function zeroes Dirichlet rows and columns. For block matrices, this function should normally be called only on the diagonal blocks, i.e. blocks for which the test and trial spaces are the same. More... | |
template<typename T > | |
void | add_diagonal (const std::function< int(std::int32_t, const std::int32_t *, std::int32_t, const std::int32_t *, const T *)> &mat_add, const function::FunctionSpace &V, const std::vector< std::shared_ptr< const DirichletBC< T >>> &bcs, T diagonal=1.0) |
Adds a value to the diagonal of the matrix for rows with a Dirichlet boundary conditions applied. This function is typically called after assembly. The assembly function zeroes Dirichlet rows and columns. This function adds the value only to rows that are locally owned, and therefore does not create a need for parallel communication. For block matrices, this function should normally be called only on the diagonal blocks, i.e. blocks for which the test and trial spaces are the same. More... | |
template<typename T > | |
void | set_bc (Eigen::Ref< Eigen::Matrix< T, Eigen::Dynamic, 1 >> b, const std::vector< std::shared_ptr< const DirichletBC< T >>> &bcs, const Eigen::Ref< const Eigen::Matrix< T, Eigen::Dynamic, 1 >> &x0, double scale=1.0) |
Set bc values in owned (local) part of the PETScVector, multiplied by 'scale'. The vectors b and x0 must have the same local size. The bcs should be on (sub-)spaces of the form L that b represents. | |
template<typename T > | |
void | set_bc (Eigen::Ref< Eigen::Matrix< T, Eigen::Dynamic, 1 >> b, const std::vector< std::shared_ptr< const DirichletBC< T >>> &bcs, double scale=1.0) |
Set bc values in owned (local) part of the PETScVector, multiplied by 'scale'. The bcs should be on (sub-)spaces of the form L that b represents. | |
template<typename T > | |
std::vector< std::vector< std::shared_ptr< const fem::DirichletBC< T > > > > | bcs_rows (const std::vector< const Form< T > * > &L, const std::vector< std::shared_ptr< const fem::DirichletBC< T >>> &bcs) |
Arrange boundary conditions by block. More... | |
template<typename T > | |
std::vector< std::vector< std::vector< std::shared_ptr< const fem::DirichletBC< T > > > > > | bcs_cols (const std::vector< std::vector< std::shared_ptr< const Form< T >>>> &a, const std::vector< std::shared_ptr< const DirichletBC< T >>> &bcs) |
Arrange boundary conditions by block. More... | |
Eigen::Array< std::int32_t, Eigen::Dynamic, Eigen::Dynamic > | locate_dofs_topological (const std::vector< std::reference_wrapper< function::FunctionSpace >> &V, const int dim, const Eigen::Ref< const Eigen::ArrayXi > &entities, bool remote=true) |
Build an array of degree-of-freedom indices that are associated with give mesh entities (topological) More... | |
Eigen::Array< std::int32_t, Eigen::Dynamic, Eigen::Dynamic > | locate_dofs_geometrical (const std::vector< std::reference_wrapper< function::FunctionSpace >> &V, const std::function< Eigen::Array< bool, Eigen::Dynamic, 1 >(const Eigen::Ref< const Eigen::Array< double, 3, Eigen::Dynamic, Eigen::RowMajor >> &)> &marker) |
Build an array of degree-of-freedom indices based on coordinates of the degree-of-freedom (geometric). More... | |
graph::AdjacencyList< std::int32_t > | transpose_dofmap (graph::AdjacencyList< std::int32_t > &dofmap, std::int32_t num_cells) |
Create an adjacency list that maps a global index (process-wise) to the 'unassembled' cell-wise contributions. It is built from the usual (cell, local index) -> global index dof map. An 'unassembled' vector is the stacked cell contributions, ordered by cell index. More... | |
Eigen::Array< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | compute_dof_permutations (const mesh::Topology &topology, const fem::ElementDofLayout &dof_layout) |
Return the dof permutations for all cells. Each row contains the numbers from 0 to (number of dofs on reference - 1) permuted so that edges are oriented towards the higher global vertex index. More... | |
la::PETScMatrix | create_matrix (const Form< PetscScalar > &a) |
Create a matrix. More... | |
la::PETScMatrix | create_matrix_block (const Eigen::Ref< const Eigen::Array< const fem::Form< PetscScalar > *, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >> &a) |
Initialise monolithic matrix for an array for bilinear forms. Matrix is not zeroed. | |
la::PETScMatrix | create_matrix_nest (const Eigen::Ref< const Eigen::Array< const fem::Form< PetscScalar > *, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >> &a) |
Create nested (MatNest) matrix. Matrix is not zeroed. | |
la::PETScVector | create_vector_block (const std::vector< std::reference_wrapper< const common::IndexMap >> &maps) |
Initialise monolithic vector. Vector is not zeroed. | |
la::PETScVector | create_vector_nest (const std::vector< const common::IndexMap * > &maps) |
Create nested (VecNest) vector. Vector is not zeroed. | |
void | assemble_vector_petsc (Vec b, const Form< PetscScalar > &L) |
Assemble linear form into an already allocated PETSc vector. Ghost contributions are not accumulated (not sent to owner). Caller is responsible for calling VecGhostUpdateBegin/End. More... | |
void | apply_lifting_petsc (Vec b, const std::vector< std::shared_ptr< const Form< PetscScalar >>> &a, const std::vector< std::vector< std::shared_ptr< const DirichletBC< PetscScalar >>>> &bcs1, const std::vector< Vec > &x0, double scale) |
Modify b such that: More... | |
void | set_bc_petsc (Vec b, const std::vector< std::shared_ptr< const DirichletBC< PetscScalar >>> &bcs, const Vec x0, double scale=1.0) |
Set bc values in owned (local) part of the PETScVector, multiplied by 'scale'. The vectors b and x0 must have the same local size. The bcs should be on (sub-)spaces of the form L that b represents. | |
template<typename T > | |
std::vector< std::vector< std::array< std::shared_ptr< const function::FunctionSpace >, 2 > > > | extract_function_spaces (const Eigen::Ref< const Eigen::Array< const fem::Form< T > *, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >> &a) |
Extract test (0) and trial (1) function spaces pairs for each bilinear form for a rectangular array of forms. More... | |
template<typename T > | |
la::SparsityPattern | create_sparsity_pattern (const Form< T > &a) |
Create a sparsity pattern for a given form. The pattern is not finalised, i.e. the caller is responsible for calling SparsityPattern::assemble. More... | |
la::SparsityPattern | create_sparsity_pattern (const mesh::Topology &topology, const std::array< const DofMap *, 2 > &dofmaps, const std::set< IntegralType > &integrals) |
Create a sparsity pattern for a given form. The pattern is not finalised, i.e. the caller is responsible for calling SparsityPattern::assemble. | |
ElementDofLayout | create_element_dof_layout (const ufc_dofmap &dofmap, const mesh::CellType cell_type, const std::vector< int > &parent_map={}) |
Create an ElementDofLayout from a ufc_dofmap. | |
DofMap | create_dofmap (MPI_Comm comm, const ufc_dofmap &dofmap, mesh::Topology &topology) |
Create dof map on mesh from a ufc_dofmap. More... | |
std::vector< std::string > | get_coefficient_names (const ufc_form &ufc_form) |
Get the name of each coefficient in a UFC form. More... | |
std::vector< std::string > | get_constant_names (const ufc_form &ufc_form) |
Get the name of each constant in a UFC form. More... | |
template<typename T > | |
Form< T > | create_form (const ufc_form &ufc_form, const std::vector< std::shared_ptr< const function::FunctionSpace >> &spaces, const std::vector< std::shared_ptr< const function::Function< T >>> &coefficients, const std::vector< std::shared_ptr< const function::Constant< T >>> &constants, const std::map< IntegralType, const mesh::MeshTags< int > * > &subdomains, const std::shared_ptr< const mesh::Mesh > &mesh=nullptr) |
Create a Form from UFC input. More... | |
template<typename T > | |
Form< T > | create_form (const ufc_form &ufc_form, const std::vector< std::shared_ptr< const function::FunctionSpace >> &spaces, const std::map< std::string, std::shared_ptr< const function::Function< T >>> &coefficients, const std::map< std::string, std::shared_ptr< const function::Constant< T >>> &constants, const std::map< IntegralType, const mesh::MeshTags< int > * > &subdomains, const std::shared_ptr< const mesh::Mesh > &mesh=nullptr) |
Create a Form from UFC input. More... | |
template<typename T > | |
std::shared_ptr< Form< T > > | create_form (ufc_form *(*fptr)(), const std::vector< std::shared_ptr< const function::FunctionSpace >> &spaces, const std::map< std::string, std::shared_ptr< const function::Function< T >>> &coefficients, const std::map< std::string, std::shared_ptr< const function::Constant< T >>> &constants, const std::map< IntegralType, const mesh::MeshTags< int > * > &subdomains, const std::shared_ptr< const mesh::Mesh > &mesh=nullptr) |
Create a Form using a factory function that returns a pointer to a ufc_form. More... | |
fem::CoordinateElement | create_coordinate_map (const ufc_coordinate_mapping &ufc_cmap) |
Create a CoordinateElement from ufc. More... | |
fem::CoordinateElement | create_coordinate_map (ufc_coordinate_mapping *(*fptr)()) |
Create a CoordinateElement from ufc. More... | |
std::shared_ptr< function::FunctionSpace > | create_functionspace (ufc_function_space *(*fptr)(const char *), const std::string function_name, std::shared_ptr< mesh::Mesh > mesh) |
Create FunctionSpace from UFC. More... | |
template<typename U > | |
Eigen::Array< typename U::scalar_type, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | pack_coefficients (const U &u) |
Pack coefficients of u of generic type U ready for assembly. | |
template<typename U > | |
Eigen::Array< typename U::scalar_type, Eigen::Dynamic, 1 > | pack_constants (const U &u) |
Pack constants of u of generic type U ready for assembly. | |
Finite element method functionality.
Classes and algorithms for finite element method operations, e.g. assembly.
void dolfinx::fem::add_diagonal | ( | const std::function< int(std::int32_t, const std::int32_t *, std::int32_t, const std::int32_t *, const T *)> & | mat_add, |
const Eigen::Ref< const Eigen::Array< std::int32_t, Eigen::Dynamic, 1 >> & | rows, | ||
T | diagonal = 1.0 |
||
) |
Adds a value to the diagonal of a matrix for specified rows. It is typically called after assembly. The assembly function zeroes Dirichlet rows and columns. For block matrices, this function should normally be called only on the diagonal blocks, i.e. blocks for which the test and trial spaces are the same.
[in] | mat_add | The function for adding values to a matrix |
[in] | rows | The rows, in local indices, for which to add a value to the diagonal |
[in] | diagonal | The value to add to the diagonal for the specified rows |
void dolfinx::fem::add_diagonal | ( | const std::function< int(std::int32_t, const std::int32_t *, std::int32_t, const std::int32_t *, const T *)> & | mat_add, |
const function::FunctionSpace & | V, | ||
const std::vector< std::shared_ptr< const DirichletBC< T >>> & | bcs, | ||
T | diagonal = 1.0 |
||
) |
Adds a value to the diagonal of the matrix for rows with a Dirichlet boundary conditions applied. This function is typically called after assembly. The assembly function zeroes Dirichlet rows and columns. This function adds the value only to rows that are locally owned, and therefore does not create a need for parallel communication. For block matrices, this function should normally be called only on the diagonal blocks, i.e. blocks for which the test and trial spaces are the same.
[in] | mat_add | The function for adding values to a matrix |
[in] | V | The function space for the rows and columns of the matrix. It is used to extract only the Dirichlet boundary conditions that are define on V or subspaces of V. |
[in] | bcs | The Dirichlet boundary condtions |
[in] | diagonal | The value to add to the diagonal for rows with a boundary condition applied |
void dolfinx::fem::apply_lifting | ( | Eigen::Ref< Eigen::Matrix< T, Eigen::Dynamic, 1 >> | b, |
const std::vector< std::shared_ptr< const Form< T >>> & | a, | ||
const std::vector< std::vector< std::shared_ptr< const DirichletBC< T >>>> & | bcs1, | ||
const std::vector< Eigen::Ref< const Eigen::Matrix< T, Eigen::Dynamic, 1 >>> & | x0, | ||
double | scale | ||
) |
Modify b such that:
b <- b - scale * A_j (g_j - x0_j)
where j is a block (nest) index. For a non-blocked problem j = 0. The boundary conditions bcs1 are on the trial spaces V_j. The forms in [a] must have the same test space as L (from which b was built), but the trial space may differ. If x0 is not supplied, then it is treated as zero.
Ghost contributions are not accumulated (not sent to owner). Caller is responsible for calling VecGhostUpdateBegin/End.
void dolfinx::fem::apply_lifting_petsc | ( | Vec | b, |
const std::vector< std::shared_ptr< const Form< PetscScalar >>> & | a, | ||
const std::vector< std::vector< std::shared_ptr< const DirichletBC< PetscScalar >>>> & | bcs1, | ||
const std::vector< Vec > & | x0, | ||
double | scale | ||
) |
Modify b such that:
b <- b - scale * A_j (g_j - x0_j)
where j is a block (nest) index. For a non-blocked problem j = 0. The boundary conditions bcs1 are on the trial spaces V_j. The forms in [a] must have the same test space as L (from which b was built), but the trial space may differ. If x0 is not supplied, then it is treated as zero.
Ghost contributions are not accumulated (not sent to owner). Caller is responsible for calling VecGhostUpdateBegin/End.
void dolfinx::fem::assemble_matrix | ( | const std::function< int(std::int32_t, const std::int32_t *, std::int32_t, const std::int32_t *, const T *)> & | mat_add, |
const Form< T > & | a, | ||
const std::vector< bool > & | dof_marker0, | ||
const std::vector< bool > & | dof_marker1 | ||
) |
Assemble bilinear form into a matrix. Matrix must already be initialised. Does not zero or finalise the matrix.
[in] | mat_add | The function for adding values into the matrix |
[in] | a | The bilinear form to assemble |
[in] | dof_marker0 | Boundary condition markers for the rows. If bc[i] is true then rows i in A will be zeroed. The index i is a local index. |
[in] | dof_marker1 | Boundary condition markers for the columns. If bc[i] is true then rows i in A will be zeroed. The index i is a local index. |
void dolfinx::fem::assemble_matrix | ( | const std::function< int(std::int32_t, const std::int32_t *, std::int32_t, const std::int32_t *, const T *)> & | mat_add, |
const Form< T > & | a, | ||
const std::vector< std::shared_ptr< const DirichletBC< T >>> & | bcs | ||
) |
Assemble bilinear form into a matrix.
[in] | mat_add | The function for adding values into the matrix |
[in] | a | The bilinear from to assemble |
[in] | bcs | Boundary conditions to apply. For boundary condition dofs the row and column are zeroed. The diagonal entry is not set. |
T dolfinx::fem::assemble_scalar | ( | const Form< T > & | M | ) |
Assemble functional into scalar. Caller is responsible for accumulation across processes.
[in] | M | The form (functional) to assemble |
void dolfinx::fem::assemble_vector | ( | Eigen::Ref< Eigen::Matrix< T, Eigen::Dynamic, 1 >> | b, |
const Form< T > & | L | ||
) |
Assemble linear form into an Eigen vector.
[in,out] | b | The Eigen vector to be assembled. It will not be zeroed before assembly. |
[in] | L | The linear forms to assemble into b |
void dolfinx::fem::assemble_vector_petsc | ( | Vec | b, |
const Form< PetscScalar > & | L | ||
) |
Assemble linear form into an already allocated PETSc vector. Ghost contributions are not accumulated (not sent to owner). Caller is responsible for calling VecGhostUpdateBegin/End.
[in,out] | b | The PETsc vector to assemble the form into. The vector must already be initialised with the correct size. The process-local contribution of the form is assembled into this vector. It is not zeroed before assembly. |
[in] | L | The linear form to assemble |
std::vector< std::vector<std::vector<std::shared_ptr<const fem::DirichletBC<T> > > > > dolfinx::fem::bcs_cols | ( | const std::vector< std::vector< std::shared_ptr< const Form< T >>>> & | a, |
const std::vector< std::shared_ptr< const DirichletBC< T >>> & | bcs | ||
) |
Arrange boundary conditions by block.
[in] | a | Biinear forms for each block |
[in] | bcs | Boundary conditions |
std::vector<std::vector<std::shared_ptr<const fem::DirichletBC<T> > > > dolfinx::fem::bcs_rows | ( | const std::vector< const Form< T > * > & | L, |
const std::vector< std::shared_ptr< const fem::DirichletBC< T >>> & | bcs | ||
) |
Arrange boundary conditions by block.
[in] | L | Linear forms for each block |
[in] | bcs | Boundary conditions |
Eigen::Array< int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > dolfinx::fem::compute_dof_permutations | ( | const mesh::Topology & | topology, |
const fem::ElementDofLayout & | dof_layout | ||
) |
Return the dof permutations for all cells. Each row contains the numbers from 0 to (number of dofs on reference - 1) permuted so that edges are oriented towards the higher global vertex index.
[in] | topology | The mesh topology |
[in] | dof_layout | The layout of dofs on a each cell |
fem::CoordinateElement dolfinx::fem::create_coordinate_map | ( | const ufc_coordinate_mapping & | ufc_cmap | ) |
Create a CoordinateElement from ufc.
[in] | ufc_cmap | UFC coordinate mapping |
fem::CoordinateElement dolfinx::fem::create_coordinate_map | ( | ufc_coordinate_mapping *(*)() | fptr | ) |
Create a CoordinateElement from ufc.
[in] | fptr | Function Pointer to a ufc_function_coordinate_map function |
fem::DofMap dolfinx::fem::create_dofmap | ( | MPI_Comm | comm, |
const ufc_dofmap & | dofmap, | ||
mesh::Topology & | topology | ||
) |
Create dof map on mesh from a ufc_dofmap.
[in] | comm | MPI communicator |
[in] | dofmap | The ufc_dofmap |
[in] | topology | The mesh topology |
Form<T> dolfinx::fem::create_form | ( | const ufc_form & | ufc_form, |
const std::vector< std::shared_ptr< const function::FunctionSpace >> & | spaces, | ||
const std::map< std::string, std::shared_ptr< const function::Function< T >>> & | coefficients, | ||
const std::map< std::string, std::shared_ptr< const function::Constant< T >>> & | constants, | ||
const std::map< IntegralType, const mesh::MeshTags< int > * > & | subdomains, | ||
const std::shared_ptr< const mesh::Mesh > & | mesh = nullptr |
||
) |
Create a Form from UFC input.
[in] | ufc_form | The UFC form |
[in] | spaces | The function spaces for the Form arguments |
[in] | coefficients | Coefficient fields in the form (by name) |
[in] | constants | Spatial constants in the form (by name) |
[in] | subdomains | Subdomain makers |
[in] | mesh | The mesh of the domain. This is required if the form has no arguments, e.g. a functional. |
Form<T> dolfinx::fem::create_form | ( | const ufc_form & | ufc_form, |
const std::vector< std::shared_ptr< const function::FunctionSpace >> & | spaces, | ||
const std::vector< std::shared_ptr< const function::Function< T >>> & | coefficients, | ||
const std::vector< std::shared_ptr< const function::Constant< T >>> & | constants, | ||
const std::map< IntegralType, const mesh::MeshTags< int > * > & | subdomains, | ||
const std::shared_ptr< const mesh::Mesh > & | mesh = nullptr |
||
) |
Create a Form from UFC input.
[in] | ufc_form | The UFC form |
[in] | spaces | Vector of function spaces |
[in] | coefficients | Coefficient fields in the form |
[in] | constants | Spatial constants in the form |
[in] | subdomains | Subdomain markers |
[in] | mesh | The mesh of the domain |
std::shared_ptr<Form<T> > dolfinx::fem::create_form | ( | ufc_form *(*)() | fptr, |
const std::vector< std::shared_ptr< const function::FunctionSpace >> & | spaces, | ||
const std::map< std::string, std::shared_ptr< const function::Function< T >>> & | coefficients, | ||
const std::map< std::string, std::shared_ptr< const function::Constant< T >>> & | constants, | ||
const std::map< IntegralType, const mesh::MeshTags< int > * > & | subdomains, | ||
const std::shared_ptr< const mesh::Mesh > & | mesh = nullptr |
||
) |
Create a Form using a factory function that returns a pointer to a ufc_form.
[in] | fptr | pointer to a function returning a pointer to ufc_form |
[in] | spaces | The function spaces for the Form arguments |
[in] | coefficients | Coefficient fields in the form (by name) |
[in] | constants | Spatial constants in the form (by name) |
[in] | subdomains | Subdomain markers |
[in] | mesh | The mesh of the domain. This is required if the form has no arguments, e.g. a functional. |
std::shared_ptr< function::FunctionSpace > dolfinx::fem::create_functionspace | ( | ufc_function_space *(*)(const char *) | fptr, |
const std::string | function_name, | ||
std::shared_ptr< mesh::Mesh > | mesh | ||
) |
Create FunctionSpace from UFC.
[in] | fptr | Function Pointer to a ufc_function_space_create function |
[in] | function_name | Name of a function whose function space to create. Function name is the name of Python variable for ufl.Coefficient, ufl.TrialFunction or ufl.TestFunction as defined in the UFL file. |
[in] | mesh | Mesh |
la::PETScMatrix dolfinx::fem::create_matrix | ( | const Form< PetscScalar > & | a | ) |
Create a matrix.
[in] | a | A bilinear form |
la::SparsityPattern dolfinx::fem::create_sparsity_pattern | ( | const Form< T > & | a | ) |
Create a sparsity pattern for a given form. The pattern is not finalised, i.e. the caller is responsible for calling SparsityPattern::assemble.
[in] | a | A bilinear form |
std::vector< std::vector<std::array<std::shared_ptr<const function::FunctionSpace>, 2> > > dolfinx::fem::extract_function_spaces | ( | const Eigen::Ref< const Eigen::Array< const fem::Form< T > *, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >> & | a | ) |
Extract test (0) and trial (1) function spaces pairs for each bilinear form for a rectangular array of forms.
[in] | a | A rectangular block on bilinear forms |
a
with a pair of function spaces in each array entry. If a form is null, then the returned function space pair is (null, null). std::vector< std::string > dolfinx::fem::get_coefficient_names | ( | const ufc_form & | ufc_form | ) |
Get the name of each coefficient in a UFC form.
[in] | ufc_form | The UFC form return The name of each coefficient |
std::vector< std::string > dolfinx::fem::get_constant_names | ( | const ufc_form & | ufc_form | ) |
Get the name of each constant in a UFC form.
[in] | ufc_form | The UFC form return The name of each constant |
Eigen::Array< std::int32_t, Eigen::Dynamic, Eigen::Dynamic > dolfinx::fem::locate_dofs_geometrical | ( | const std::vector< std::reference_wrapper< function::FunctionSpace >> & | V, |
const std::function< Eigen::Array< bool, Eigen::Dynamic, 1 >(const Eigen::Ref< const Eigen::Array< double, 3, Eigen::Dynamic, Eigen::RowMajor >> &)> & | marker | ||
) |
Build an array of degree-of-freedom indices based on coordinates of the degree-of-freedom (geometric).
Finds degrees of freedom whose geometric coordinate is true for the provided marking function.
[in] | V | The function (sub)space(s) on which degrees of freedom will be located. The spaces must share the same mesh and element type. |
[in] | marker | Function marking tabulated degrees of freedom |
Eigen::Array< std::int32_t, Eigen::Dynamic, Eigen::Dynamic > dolfinx::fem::locate_dofs_topological | ( | const std::vector< std::reference_wrapper< function::FunctionSpace >> & | V, |
const int | dim, | ||
const Eigen::Ref< const Eigen::ArrayXi > & | entities, | ||
bool | remote = true |
||
) |
Build an array of degree-of-freedom indices that are associated with give mesh entities (topological)
Finds degrees-of-freedom which belong to provided mesh entities. Note that degrees-of-freedom for discontinuous elements are associated with the cell even if they may appear to be associated with a facet/edge/vertex.
[in] | V | The function (sub)space(s) on which degrees-of-freedom (DOFs) will be located. The spaces must share the same mesh and element type. |
[in] | dim | Topological dimension of mesh entities on which degrees-of-freedom will be located |
[in] | entities | Indices of mesh entities. All DOFs associated with the closure of these indices will be returned |
[in] | remote | True to return also "remotely located" degree-of-freedom indices. Remotely located degree-of-freedom indices are local/owned by the current process, but which the current process cannot identify because it does not recognize mesh entity as a marked. For example, a boundary condition dof at a vertex where this process does not have the associated boundary facet. This commonly occurs with partitioned meshes. |
graph::AdjacencyList< std::int32_t > dolfinx::fem::transpose_dofmap | ( | graph::AdjacencyList< std::int32_t > & | dofmap, |
std::int32_t | num_cells | ||
) |
Create an adjacency list that maps a global index (process-wise) to the 'unassembled' cell-wise contributions. It is built from the usual (cell, local index) -> global index dof map. An 'unassembled' vector is the stacked cell contributions, ordered by cell index.
If the usual dof map is:
Cell: 0 1 2 3 Global index: [ [0, 3, 5], [3, 2, 4], [4, 3, 2], [2, 1, 0]]
the 'transpose' dof map will be:
Global index: 0 1 2 3 4 5 Unassembled index: [ [0, 11], [10], [4, 8, 9], [1, 3, 7], [5, 6], [2] ]
[in] | dofmap | The standard dof map that for each cell (node) gives the global (process-wise) index of each local (cell-wise) index. |
[in] | num_cells | The number of cells (nodes) in dofmap to consider. The first num_cells are used. This is argument is typically used to exclude ghost cell contributions. |