cashocs.geometry.compute_boundary_distance#
- cashocs.geometry.compute_boundary_distance(mesh: fenics.Mesh, boundaries: fenics.MeshFunction | None = None, boundary_idcs: list[int | str] | None = None, tol: float = 0.1, max_iter: int = 10, minimum_distance: float = 0.0, method: str = 'eikonal') fenics.Function [source]#
Computes (an approximation of) the distance to the boundary.
The user can specify which boundaries are considered for the distance computation by specifying the parameters boundaries and boundary_idcs. Default is to consider all boundaries.
- Parameters:
mesh (fenics.Mesh) – The dolfin mesh object, representing the computational domain.
boundaries (fenics.MeshFunction | None) – A meshfunction for the boundaries, which is needed in case specific boundaries are targeted for the distance computation (while others are ignored), default is None (all boundaries are used).
boundary_idcs (list[int | str] | None) – A list of indices which indicate, which parts of the boundaries should be used for the distance computation, default is None (all boundaries are used).
tol (float) – A tolerance for the iterative solution of the eikonal equation. Default is 1e-1.
max_iter (int) – Number of iterations for the iterative solution of the eikonal equation. Default is 10.
minimum_distance (float) – The distance of the mesh boundary to the (physical) wall. This should be set to 0.0 for most applications, which is also the default. One exception is for turbulence modeling and wall functions.
method (str) – Which method should be used to compute the boundary distance. Can either be ‘poisson’ or ‘eikonal’. The default is ‘eikonal’, which is more accurate. The poisson approach is less accurate, but more robust and gives a very good approximation close to the wall.
- Returns:
A fenics function representing an approximation of the distance to the boundary.
- Return type:
fenics.Function