FEM

flatiron_tk.fem.boundary_conditions.build_dirichlet_bc(mesh, bnd_id, bc_val, function_space)[source]

Builds a Dirichlet boundary condition for a given boundary and value. :param mesh: The mesh object containing the boundary information. :type mesh: flatironx.mesh :param bnd_id: The boundary ID to apply the Dirichlet condition on. :type bnd_id: int :param bc_val: The value of the Dirichlet condition, which can be a function or a constant. :type bc_val: dolfinx.fem.Function or dolfinx.fem.Constant :param function_space: The function space to which the Dirichlet condition applies. :type function_space: dolfinx.fem.FunctionSpace

Returns:

dolfinx.fem.dirichletbc

Return type:

The Dirichlet boundary condition object.

:raises TypeError : If bc_val is not a dolfinx.fem.Function or dolfinx.fem.Constant.:

Returns the function space to search for dofs in case V is a subspace. If V is not a subspace, returns V itself. :param V: The function space to check. :type V: dolfinx.fem.FunctionSpace

Returns:

  • if V is a subspace – tuple(dolfinx.fem.FunctionSpace, list mapping of the subspace to original space)

  • else – dolfinx.fem.FunctionSpace The function space to search for dofs.

flatiron_tk.fem.boundary_conditions.is_subspace(V)[source]

Returns True if V is a subspace of a function space, False otherwise.

Parameters:

V (dolfinx.fem.FunctionSpace) – The function space to check.

Returns:

True if V is a subspace, False otherwise.

Return type:

bool