Boundary#
Finite Element Boundary Conditions and Mesh Tagging Utilities#
This module provides functions for creating boundary conditions and handling mesh tagging.
Notes#
These functions are useful for defining boundary conditions and subdomains in finite element simulations.
Examples#
See individual function documentation for usage examples.
- phasefieldx.Boundary.boundary_conditions.bc_phi(facet, V_phi, fdim, value=0.0)[source]#
Create a Dirichlet boundary condition for the scalar field phi on a specified facet.
- Parameters:
- facetint
The topological index of the facet on which the boundary condition is applied.
- V_phidolfinx.FunctionSpace
The function space associated with the scalar field phi.
- fdimint
The topological dimension of the facets (e.g., 2 for triangles).
- Returns:
- dolfinx.fem.dirichletbc
A Dirichlet boundary condition for the scalar field phi.
Notes
This function is useful for defining Dirichlet boundary conditions for scalar fields in finite element simulations. The boundary condition enforces phi to have a constant value (phi_D) on the specified facet.
- phasefieldx.Boundary.boundary_conditions.bc_x(facet, V_u, fdim, value=0.0)[source]#
Create a Dirichlet boundary condition for the x-component of a vector field u on a specified facet.
- Parameters:
- facetint
The topological index of the facet on which the boundary condition is applied.
- V_udolfinx.FunctionSpace
The function space associated with the vector field u.
- fdimint
The topological dimension of the facets (e.g., 2 for triangles).
- Returns:
- dolfinx.fem.dirichletbc
A Dirichlet boundary condition for the x-component of the vector field u.
Notes
This function is useful for defining Dirichlet boundary conditions for the x-component of vector fields in finite element simulations. The boundary condition enforces the x-component of u to have a constant value (u_x_D) on the specified facet.
- phasefieldx.Boundary.boundary_conditions.bc_xy(facet, V_u, fdim, value_x=0.0, value_y=0.0)[source]#
Create Dirichlet boundary conditions for both x and y components of a vector field u on a specified facet.
- Parameters:
- facetint
The topological index of the facet on which the boundary conditions are applied.
- V_udolfinx.FunctionSpace
The function space associated with the vector field u.
- fdimint
The topological dimension of the facets (e.g., 2 for triangles).
- Returns:
- dolfinx.fem.dirichletbc
Dirichlet boundary conditions for both the x and y components of the vector field u.
Notes
This function is useful for defining Dirichlet boundary conditions for both the x and y components of vector fields in finite element simulations. The boundary conditions enforce constant values (u_xy_D) for both the x and y components on the specified facet.
- phasefieldx.Boundary.boundary_conditions.bc_xyz(facet, V_u, fdim, value_x=0.0, value_y=0.0, value_z=0.0)[source]#
Create Dirichlet boundary conditions for all three components (x, y, and z) of a vector field u on a specified facet.
- Parameters:
- facetint
The topological index of the facet on which the boundary conditions are applied.
- V_udolfinx.FunctionSpace
The function space associated with the vector field u.
- fdimint
The topological dimension of the facets (e.g., 2 for triangles).
- Returns:
- dolfinx.fem.dirichletbc
Dirichlet boundary conditions for all three components (x, y, and z) of the vector field u.
Notes
This function is useful for defining Dirichlet boundary conditions for all three components (x, y, and z) of vector fields in finite element simulations. The boundary conditions enforce constant values (u_xyz_D) for all three components on the specified facet.
- phasefieldx.Boundary.boundary_conditions.bc_y(facet, V_u, fdim, value=0.0)[source]#
Create a Dirichlet boundary condition for the y-component of a vector field u on a specified facet.
- Parameters:
- facetint
The topological index of the facet on which the boundary condition is applied.
- V_udolfinx.FunctionSpace
The function space associated with the vector field u.
- fdimint
The topological dimension of the facets (e.g., 2 for triangles).
- Returns:
- dolfinx.fem.DirichletBC
A Dirichlet boundary condition for the y-component of the vector field u.
Notes
This function is useful for defining Dirichlet boundary conditions for the y-component of vector fields in finite element simulations. The boundary condition enforces the y-component of u to have a constant value (u_y_D) on the specified facet.
- phasefieldx.Boundary.boundary_conditions.bc_z(facet, V_u, fdim, value=0.0)[source]#
Create a Dirichlet boundary condition for the z-component of a vector field u on a specified facet.
- Parameters:
- facetint
The topological index of the facet on which the boundary condition is applied.
- V_udolfinx.FunctionSpace
The function space associated with the vector field u.
- fdimint
The topological dimension of the facets (e.g., 2 for triangles).
- Returns:
- dolfinx.fem.dirichletbc
A Dirichlet boundary condition for the z-component of the vector field u.
Notes
This function is useful for defining Dirichlet boundary conditions for the z-component of vector fields in finite element simulations. The boundary condition enforces the z-component of u to have a constant value (u_z_D) on the specified facet.
- phasefieldx.Boundary.boundary_conditions.get_ds_bound_from_marker(facet_marker, msh, fdim)[source]#
Create a ufl.Measure representing the boundary of a specific subdomain based on facet markers.
- Parameters:
- facet_markernumpy.ndarray
An array of facet markers indicating the desired subdomain.
- mshdolfinx.Mesh
The mesh on which to define the boundary measure.
- fdimint
The topological dimension of the facets (e.g., 2 for triangles).
- Returns:
- ufl.Measure
A UFL Measure object representing the boundary of the specified subdomain.
Notes
This function is useful for defining a UFL Measure representing the boundary of a specific subdomain based on facet markers. It allows you to create a boundary measure for a subdomain with a specific facet marker value.
Parameters: - facet_marker is an array that specifies which facets belong to the desired subdomain. Facets with marker value 1 are considered part of the subdomain. - msh is the mesh on which the boundary measure is defined. - fdim is the topological dimension of the facets (e.g., 2 for triangles).