qugar.reparam
Reparameterization module for QUGaR
Functions
|
Creates a reparameterized mesh for a given unfitted domain. |
|
Generate data needed to interpolate discrete functions across different meshes. |
Classes
|
A class to represent the unfitted domain raparameterization mesh. |
- class qugar.reparam.UnfDomainReparamMesh(unf_domain: UnfittedDomain, cpp_object: ReparamMesh_1_2 | ReparamMesh_2_2 | ReparamMesh_2_3 | ReparamMesh_3_3)[source]
Bases:
object
A class to represent the unfitted domain raparameterization mesh.
Initializes the Reparam object with a given C++ ReparamMesh object.
- Parameters:
unf_domain (UnfittedDomain) – An instance of the UnfittedDomain class.
cpp_object (ReparamMesh) – An instance of a C++ ReparamMesh object, either 2D or 3D.
- ReparamMesh: TypeAlias = qugar.cpp.ReparamMesh_1_2 | qugar.cpp.ReparamMesh_2_2 | qugar.cpp.ReparamMesh_2_3 | qugar.cpp.ReparamMesh_3_3
- property cpp_object: ReparamMesh_1_2 | ReparamMesh_2_2 | ReparamMesh_2_3 | ReparamMesh_3_3
Returns the C++ object associated with this instance.
- Returns:
The C++ object underlying this instance.
- Return type:
ReparamMesh
- create_mesh(wirebasket: bool = False) Mesh [source]
Creates a DOLFINx mesh from the reparameterization data.
This method generates a dlf_mesh.Mesh object representing either the reparameterized cells or the wirebasket of the reparameterization, based on the wirebasket flag.
- Parameters:
wirebasket (bool, optional) – If True, creates the mesh for the wirebasket connectivity. If False, creates the mesh for the cell connectivity. Defaults to False.
- Returns:
The generated DOLFINx mesh object.
- Return type:
dlf_mesh.Mesh
- property unf_domain: UnfittedDomain
Returns the unfitted domain associated with this instance.
- Returns:
The unfitted domain associated with this instance.
- Return type:
- qugar.reparam.create_interpolation_data(V_to: FunctionSpace, V_from: FunctionSpace, padding: float = 1e-14) tuple[ndarray[Any, dtype[int32]], PointOwnershipData] [source]
Generate data needed to interpolate discrete functions across different meshes.
Note
Note that the function spaces V_to and V_from must be defined on meshes with different dimensions. E.g., V_from (2D or 3D) can be the function space of a computed solution and V_to the function space for interpolating the solution in the
reparameterization wirebasket (1D).
- Parameters:
V_to (FunctionSpace) – Function space to interpolate into.
V_from (FunctionSpace) – Function space to interpolate from.
padding (float) – Absolute padding of bounding boxes of all entities on the mesh associated to V_to.
- Returns:
Cell indices of the mesh associated to V_to on which to interpolate into. PointOwnershipData: Data needed to interpolation functions defined on function spaces on the meshes.
- Return type:
npt.NDArray[np.int32]
- qugar.reparam.create_reparam_mesh(unf_domain: UnfittedDomain, degree: int = 3, levelset: bool = False) UnfDomainReparamMesh [source]
Creates a reparameterized mesh for a given unfitted domain.
- Parameters:
unf_domain (UnfittedDomain) – The unfitted domain to be reparameterized.
degree (int, optional) – The reparameterization degree along each direction. It must be a positive value. Defaults to 3.
levelset (bool, optional) – Whether to create a levelset reparameterization (True) or a solid one (False). Defaults to False.
- Returns:
The reparameterized domain.
- Return type:
UnfDomainReparam