dolfinx.cpp.fem

FEM module

Functions

add_diagonal(arg0, arg1, arg2, arg3)

apply_lifting(arg0, 1], flags.writeable], …)

Modify vector for lifted boundary conditions

assemble_matrix(arg0, int, int, int, float], …)

assemble_matrix_petsc(*args, **kwargs)

Overloaded function.

assemble_matrix_petsc_unrolled(*args, **kwargs)

Overloaded function.

assemble_scalar(arg0)

Assemble functional over mesh

assemble_vector(b, 1], flags.writeable], L)

Assemble linear form into an existing Eigen vector

bcs_cols(arg0, arg1)

bcs_rows(arg0, arg1)

build_dofmap(arg0, arg1, arg2)

Build and dofmap on a mesh.

create_coordinate_map(arg0)

Create CoordinateElement from a pointer to ufc_coordinate_map.

create_dofmap(arg0, arg1, arg2)

Create DofMap object from a pointer to ufc_dofmap.

create_element_dof_layout(arg0, arg1, arg2)

Create ElementDofLayout object from a ufc dofmap.

create_form(arg0, arg1, arg2, arg3, arg4, …)

Create Form from a pointer to ufc_form.

create_matrix(a, type)

Create a PETSc Mat for bilinear form.

create_matrix_block(a, type)

Create monolithic sparse matrix for stacked bilinear forms.

create_matrix_nest(a, types)

Create nested sparse matrix for bilinear forms.

create_sparsity_pattern(arg0)

Create a sparsity pattern for bilinear form.

create_vector_block(arg0, int]])

Create a monolithic vector for multiple (stacked) linear forms.

create_vector_nest(arg0, int]])

Create nested vector for multiple (stacked) linear forms.

locate_dofs_geometrical(*args, **kwargs)

Overloaded function.

locate_dofs_topological(*args, **kwargs)

Overloaded function.

pack_coefficients(*args, **kwargs)

Overloaded function.

pack_constants(*args, **kwargs)

Overloaded function.

set_bc(b, 1], flags.writeable], bcs, x0, scale)

transpose_dofmap(arg0, arg1)

Build the index to (cell, local index) map from a dofmap ((cell, local index ) -> index).

Classes

CoordinateElement

Coordinate map element

DirichletBC(*args, **kwargs)

Object for representing Dirichlet (essential) boundary conditions

DofMap(self, element_dof_layout, index_map, …)

DofMap object

ElementDofLayout(self, arg0, arg1, arg2, …)

Object describing the layout of dofs on a cell

FiniteElement(self, arg0)

Finite element object

Form(self, spaces, integrals, …)

Variational form object

IntegralType(self, arg0)

Members:

class dolfinx.cpp.fem.CoordinateElement

Bases: pybind11_builtins.pybind11_object

Coordinate map element

property dof_layout
property non_affine_atol
property non_affine_max_its
push_forward(self: dolfinx.cpp.fem.CoordinateElement, arg0: numpy.ndarray[numpy.float64[m, n], flags.writeable, flags.c_contiguous], arg1: numpy.ndarray[numpy.float64[m, n], flags.c_contiguous], arg2: numpy.ndarray[numpy.float64[m, n], flags.c_contiguous]) → None
class dolfinx.cpp.fem.DirichletBC(*args, **kwargs)

Bases: pybind11_builtins.pybind11_object

Object for representing Dirichlet (essential) boundary conditions

Overloaded function.

  1. __init__(self: dolfinx.cpp.fem.DirichletBC, V: dolfinx.cpp.function.Function, g: List[numpy.ndarray[numpy.int32[m, 1]][2]], V_g_dofs: dolfinx.cpp.function.FunctionSpace) -> None

  2. __init__(self: dolfinx.cpp.fem.DirichletBC, g: dolfinx.cpp.function.Function, dofs: numpy.ndarray[numpy.int32[m, 1]]) -> None

dof_indices(self: dolfinx.cpp.fem.DirichletBC) → numpy.ndarray[numpy.int32[m, 1]]
property function_space
property value
class dolfinx.cpp.fem.DofMap(self: dolfinx.cpp.fem.DofMap, element_dof_layout: dolfinx.cpp.fem.ElementDofLayout, index_map: dolfinx.cpp.common.IndexMap, index_map_bs: int, dofmap: dolfinx.cpp.graph.AdjacencyList_int32, bs: int) → None

Bases: pybind11_builtins.pybind11_object

DofMap object

property bs
cell_dofs(self: dolfinx.cpp.fem.DofMap, arg0: int) → numpy.ndarray[numpy.int32[m, 1]]
property dof_layout
property index_map
property index_map_bs
list(self: dolfinx.cpp.fem.DofMap)dolfinx.cpp.graph.AdjacencyList_int32
class dolfinx.cpp.fem.ElementDofLayout(self: dolfinx.cpp.fem.ElementDofLayout, arg0: int, arg1: List[List[Set[int]]], arg2: List[int], arg3: List[dolfinx.cpp.fem.ElementDofLayout], arg4: dolfinx.cpp.mesh.CellType, arg5: numpy.ndarray[numpy.int32[m, n]]) → None

Bases: pybind11_builtins.pybind11_object

Object describing the layout of dofs on a cell

block_size(self: dolfinx.cpp.fem.ElementDofLayout) → int
entity_closure_dofs(self: dolfinx.cpp.fem.ElementDofLayout, arg0: int, arg1: int) → numpy.ndarray[numpy.int32[m, 1]]
entity_dofs(self: dolfinx.cpp.fem.ElementDofLayout, arg0: int, arg1: int) → numpy.ndarray[numpy.int32[m, 1]]
property num_dofs
num_entity_closure_dofs(self: dolfinx.cpp.fem.ElementDofLayout, arg0: int) → int
num_entity_dofs(self: dolfinx.cpp.fem.ElementDofLayout, arg0: int) → int
class dolfinx.cpp.fem.FiniteElement(self: dolfinx.cpp.fem.FiniteElement, arg0: int) → None

Bases: pybind11_builtins.pybind11_object

Finite element object

dof_reference_coordinates(self: dolfinx.cpp.fem.FiniteElement) → numpy.ndarray[numpy.float64[m, n]]
num_sub_elements(self: dolfinx.cpp.fem.FiniteElement) → int
signature(self: dolfinx.cpp.fem.FiniteElement) → str
space_dimension(self: dolfinx.cpp.fem.FiniteElement) → int
value_dimension(self: dolfinx.cpp.fem.FiniteElement, arg0: int) → int
property value_rank
class dolfinx.cpp.fem.Form(self: dolfinx.cpp.fem.Form, spaces: List[dolfinx.cpp.function.FunctionSpace], integrals: Dict[dolfinx.cpp.fem.IntegralType, Tuple[List[Tuple[int, object]], dolfinx.cpp.mesh.MeshTags_int32]], coefficients: List[dolfinx.cpp.function.Function], constants: List[dolfinx.cpp.function.Constant], need_permutation_data: bool, mesh: dolfinx.cpp.mesh.Mesh = None) → None

Bases: pybind11_builtins.pybind11_object

Variational form object

property coefficients
domains(self: dolfinx.cpp.fem.Form, arg0: dolfinx.cpp.fem.IntegralType, arg1: int) → List[int]
property function_spaces
integral_ids(self: dolfinx.cpp.fem.Form, arg0: dolfinx.cpp.fem.IntegralType) → List[int]
property mesh
property rank
class dolfinx.cpp.fem.IntegralType(self: dolfinx.cpp.fem.IntegralType, arg0: int) → None

Bases: pybind11_builtins.pybind11_object

Members:

cell

exterior_facet

interior_facet

vertex

cell = <IntegralType.cell: 0>
exterior_facet = <IntegralType.exterior_facet: 1>
interior_facet = <IntegralType.interior_facet: 2>
property name
vertex = <IntegralType.vertex: 3>
dolfinx.cpp.fem.add_diagonal(arg0: mat, arg1: dolfinx.cpp.function.FunctionSpace, arg2: List[dolfinx.cpp.fem.DirichletBC], arg3: float) → None
dolfinx.cpp.fem.apply_lifting(arg0: numpy.ndarray[numpy.float64[m, 1], flags.writeable], arg1: List[dolfinx::fem::Form<double>], arg2: List[List[dolfinx.cpp.fem.DirichletBC]], arg3: List[numpy.ndarray[numpy.float64[m, 1]]], arg4: float) → None

Modify vector for lifted boundary conditions

dolfinx.cpp.fem.assemble_matrix(arg0: Callable[[int, int, int, int, float], int], arg1: dolfinx::fem::Form<double>, arg2: List[dolfinx.cpp.fem.DirichletBC]) → None
dolfinx.cpp.fem.assemble_matrix_petsc(*args, **kwargs)

Overloaded function.

  1. assemble_matrix_petsc(arg0: mat, arg1: dolfinx::fem::Form<double>, arg2: List[dolfinx.cpp.fem.DirichletBC]) -> None

  2. assemble_matrix_petsc(arg0: mat, arg1: dolfinx::fem::Form<double>, arg2: List[bool], arg3: List[bool]) -> None

dolfinx.cpp.fem.assemble_matrix_petsc_unrolled(*args, **kwargs)

Overloaded function.

  1. assemble_matrix_petsc_unrolled(arg0: mat, arg1: dolfinx::fem::Form<double>, arg2: List[dolfinx.cpp.fem.DirichletBC]) -> None

  2. assemble_matrix_petsc_unrolled(arg0: mat, arg1: dolfinx::fem::Form<double>, arg2: List[bool], arg3: List[bool]) -> None

dolfinx.cpp.fem.assemble_scalar(arg0: dolfinx::fem::Form<double>) → float

Assemble functional over mesh

dolfinx.cpp.fem.assemble_vector(b: numpy.ndarray[numpy.float64[m, 1], flags.writeable], L: dolfinx::fem::Form<double>) → None

Assemble linear form into an existing Eigen vector

dolfinx.cpp.fem.bcs_cols(arg0: List[List[dolfinx::fem::Form<double>]], arg1: List[dolfinx.cpp.fem.DirichletBC]) → List[List[List[dolfinx.cpp.fem.DirichletBC]]]
dolfinx.cpp.fem.bcs_rows(arg0: List[dolfinx::fem::Form<double>], arg1: List[dolfinx.cpp.fem.DirichletBC]) → List[List[dolfinx.cpp.fem.DirichletBC]]
dolfinx.cpp.fem.build_dofmap(arg0: MPICommWrapper, arg1: dolfinx.cpp.mesh.Topology, arg2: dolfinx::fem::ElementDofLayout) → Tuple[dolfinx.cpp.common.IndexMap, int, dolfinx.cpp.graph.AdjacencyList_int32]

Build and dofmap on a mesh.

dolfinx.cpp.fem.create_coordinate_map(arg0: int) → dolfinx::fem::CoordinateElement

Create CoordinateElement from a pointer to ufc_coordinate_map.

dolfinx.cpp.fem.create_dofmap(arg0: MPICommWrapper, arg1: int, arg2: dolfinx.cpp.mesh.Topology) → dolfinx::fem::DofMap

Create DofMap object from a pointer to ufc_dofmap.

dolfinx.cpp.fem.create_element_dof_layout(arg0: int, arg1: dolfinx.cpp.mesh.CellType, arg2: List[int]) → dolfinx::fem::ElementDofLayout

Create ElementDofLayout object from a ufc dofmap.

dolfinx.cpp.fem.create_form(arg0: int, arg1: List[dolfinx.cpp.function.FunctionSpace], arg2: List[dolfinx.cpp.function.Function], arg3: List[dolfinx.cpp.function.Constant], arg4: Dict[dolfinx::fem::IntegralType, dolfinx.cpp.mesh.MeshTags_int32], arg5: dolfinx.cpp.mesh.Mesh) → dolfinx::fem::Form<double>

Create Form from a pointer to ufc_form.

dolfinx.cpp.fem.create_matrix(a: dolfinx::fem::Form<double>, type: str = '') → mat

Create a PETSc Mat for bilinear form.

dolfinx.cpp.fem.create_matrix_block(a: List[List[dolfinx::fem::Form<double>]], type: str = '') → mat

Create monolithic sparse matrix for stacked bilinear forms.

dolfinx.cpp.fem.create_matrix_nest(a: List[List[dolfinx::fem::Form<double>]], types: List[List[str]] = []) → mat

Create nested sparse matrix for bilinear forms.

dolfinx.cpp.fem.create_sparsity_pattern(arg0: dolfinx::fem::Form<double>) → dolfinx::la::SparsityPattern

Create a sparsity pattern for bilinear form.

dolfinx.cpp.fem.create_vector_block(arg0: List[Tuple[dolfinx.cpp.common.IndexMap, int]]) → vec

Create a monolithic vector for multiple (stacked) linear forms.

dolfinx.cpp.fem.create_vector_nest(arg0: List[Tuple[dolfinx.cpp.common.IndexMap, int]]) → vec

Create nested vector for multiple (stacked) linear forms.

dolfinx.cpp.fem.locate_dofs_geometrical(*args, **kwargs)

Overloaded function.

  1. locate_dofs_geometrical(V: List[dolfinx.cpp.function.FunctionSpace], marker: Callable[[numpy.ndarray[numpy.float64[3, n], flags.c_contiguous]], numpy.ndarray[bool[m, 1]]]) -> List[numpy.ndarray[numpy.int32[m, 1]][2]]

  2. locate_dofs_geometrical(V: dolfinx.cpp.function.FunctionSpace, marker: Callable[[numpy.ndarray[numpy.float64[3, n], flags.c_contiguous]], numpy.ndarray[bool[m, 1]]]) -> numpy.ndarray[numpy.int32[m, 1]]

dolfinx.cpp.fem.locate_dofs_topological(*args, **kwargs)

Overloaded function.

  1. locate_dofs_topological(V: List[dolfinx.cpp.function.FunctionSpace], dim: int, entities: numpy.ndarray[numpy.int32[m, 1]], remote: bool = True) -> List[numpy.ndarray[numpy.int32[m, 1]][2]]

  2. locate_dofs_topological(V: dolfinx.cpp.function.FunctionSpace, dim: int, entities: numpy.ndarray[numpy.int32[m, 1]], remote: bool = True) -> numpy.ndarray[numpy.int32[m, 1]]

dolfinx.cpp.fem.pack_coefficients(*args, **kwargs)

Overloaded function.

  1. pack_coefficients(arg0: dolfinx::fem::Form<double>) -> numpy.ndarray[numpy.float64[m, n]]

Pack coefficients for a UFL form.

  1. pack_coefficients(arg0: dolfinx::fem::Form<double>) -> numpy.ndarray[numpy.float64[m, n]]

Pack coefficients for a UFL expression.

dolfinx.cpp.fem.pack_constants(*args, **kwargs)

Overloaded function.

  1. pack_constants(arg0: dolfinx::fem::Form<double>) -> numpy.ndarray[numpy.float64[m, 1]]

Pack constants for a UFL form.

  1. pack_constants(arg0: dolfinx.cpp.function.Expression) -> numpy.ndarray[numpy.float64[m, 1]]

Pack constants for a UFL expression.

dolfinx.cpp.fem.set_bc(b: numpy.ndarray[numpy.float64[m, 1], flags.writeable], bcs: List[dolfinx.cpp.fem.DirichletBC], x0: numpy.ndarray[numpy.float64] = None, scale: float = 1.0) → None
dolfinx.cpp.fem.transpose_dofmap(arg0: dolfinx.cpp.graph.AdjacencyList_int32, arg1: int)dolfinx.cpp.graph.AdjacencyList_int32

Build the index to (cell, local index) map from a dofmap ((cell, local index ) -> index).