qugar.plot
Plot functionalities (using PyVista) for QUGaR
Functions
|
Generates quadrature data for an unfitted domain and exports it to a PyVista data structure. |
|
Converts a Cartesian grid to a PyVista RectilinearGrid. |
|
Converts the grid of an unfitted domain to a PyVista UnstructuredGrid. |
|
Converts the facets of the unfitted domain to a PyVista UnstructuredGrid. |
|
Converts a reparameterization mesh object to a PyVista MultiBlock. |
- qugar.plot.cart_grid_tp_to_PyVista(grid: Any) RectilinearGrid [source]
Converts a Cartesian grid to a PyVista RectilinearGrid.
- Parameters:
grid (CartGridTP_2D | CartGridTP_3D | CartesianMesh) – The input grid, which can be either a CartGridTP_2D, CartGridTP_3D, or CartesianMesh (if FEniCSx is available).
- Returns:
The converted PyVista RectilinearGrid.
- Return type:
pv.RectilinearGrid
- Raises:
AssertionError – If a CartesianMesh is passed as input and the number of global cells does not match the number of local cells in the grid. This is not implemented yet.
- qugar.plot.quadrature_to_PyVista(domain: Any, n_pts_dir: int = 4) MultiBlock [source]
Generates quadrature data for an unfitted domain and exports it to a PyVista data structure. It generates, and export, quadrature points for the interior of the cells, the unfitted boundaries, and the facets.
In addition to the lexicographical indices of cells and facets, this function also appends the DOLFINx associated indices.
@note: This function is only available when FEniCSx is installed.
- Parameters:
domain (UnfittedDomain) – The unfitted domain for which the quadratures are generated.
n_pts_dir (int) – Number of points per direction for quadrature.
- Returns:
- A PyVista multiblock dataset containing the quadratures
of the cut cells, cut facets, and unfitted boundaries.
- Return type:
pv.MultiBlock
- qugar.plot.reparam_mesh_to_PyVista(reparam: Any) MultiBlock [source]
Converts a reparameterization mesh object to a PyVista MultiBlock.
- Parameters:
reparam (ReparamMesh | UnfDomainReparamMesh) – The reparametrized mesh object to be converted.
- Returns:
- Reparameterization translated to PyVista data structures.
It is a multiblock containing two unstructured grids: one for the reparameterization itselt and one for the reparmeterization’s wirebasket. They can be accessed using
.get("reparam")
and.get("wirebasket")
, respectively.
- Return type:
pv.MultiBlock
- qugar.plot.unfitted_domain_facets_to_PyVista(domain: Any, cut: bool = True, full: bool = True, empty: bool = False) UnstructuredGrid [source]
Converts the facets of the unfitted domain to a PyVista UnstructuredGrid. Extra information regarding the status of the facets and parent cells is added as cell data.
- Parameters:
domain (Any) – The unfitted domain object whose facets are transformed. It can be an instance of UnfittedDomain_2D, UnfittedDomain_3D, or UnfittedDomain (if FEniCSx is available).
cut (bool, optional) – Whether to include cut facets. Defaults to True.
full (bool, optional) – Whether to include full facets. Defaults to True.
empty (bool, optional) – Whether to include empty facets. Defaults to False.
- Returns:
A PyVista UnstructuredGrid containing the facets of the domain.
- Return type:
pv.UnstructuredGrid
- Raises:
AssertionError – If the domain is an instance of UnfittedDomain and FEniCSx installation is not found.
- qugar.plot.unfitted_domain_to_PyVista(domain: Any, cut: bool = True, full: bool = True, empty: bool = False) UnstructuredGrid [source]
Converts the grid of an unfitted domain to a PyVista UnstructuredGrid. Extra information regarding the status of the cells is added as cell data.
- Parameters:
domain (Any) – The domain to be converted. It can be an instance of UnfittedDomain_2D, UnfittedDomain_3D, or UnfittedDomain (if FEniCSx is available).
cut (bool, optional) – Whether to include cut cells. Defaults to True.
full (bool, optional) – Whether to include full cells. Defaults to True.
empty (bool, optional) – Whether to include empty cells. Defaults to True.
- Returns:
- The resulting PyVista UnstructuredGrid with cell data
indicating the status of each cell (full, cut, or empty).
- Return type:
pv.UnstructuredGrid
- Raises:
AssertionError – If the domain is an instance of UnfittedDomain and FEniCSx installation is not found.