Contents
On this page
Mesh refinement tools.
triellipt.amr.getunit(mesh)
Creates an AMR unit.
Parameters
mesh : TriMesh
Returns
AMRUnit
class triellipt.amr.AMRUnit(mesh)
Mesh refinement unit.
Attributes
mesh : TriMesh
data : dict
Properties
| Name | Description |
|---|---|
refiner |
Data-refiner after refinement. |
collector |
Data-collector after coarsening. |
AMRUnit.refine(self, trinums=None)
Performs a static mesh refinement.
Parameters
trinums : Iterable = None
Returns
AMRUnit
Notes
data-refiner is included in the mesh metadata.AMRUnit.coarsen(self, trinums_cores)
Performs a static mesh coarsening.
Parameters
trinums_cores : Iterable
Returns
AMRUnit
Notes
data-collector is included in the mesh metadata.AMRUnit.find_node(self, anchor)
Finds the neighborhood of an anchor point.
Parameters
anchor : (float, float)
Returns
flat-int-array
AMRUnit.find_subset(self, count, anchor, remove_heads=False)
Finds a convex subset of a mesh.
Parameters
count : int
anchor : (float, float)
remove_heads : bool = False
Returns
flat-int-array
AMRUnit.find_masked(self, mask)
Finds triangles by a mask-function.
Parameters
mask : function
(x, y) on the triangles centroids.
Returns
flat-int-array
AMRUnit.front_coarse(self)
Finds a front of coarse triangles.
AMRUnit.front_fine(self)
Finds a front of fine triangles.
AMRUnit.from_func(self, func)
Creates data from a function.
Parameters
func : Callable
Returns
flat-float-array
AMRUnit.constrain(self, data)
Constrains data on hanging nodes.
Parameters
data : float-flat-array
Returns
float-flat-array
AMRUnit.getinterp(self, xnodes, ynodes)
Creates an interpolator on a mesh.
Parameters
xnodes : flat-float-array
ynodes : flat-float-array
Returns
TriInterp
Notes
TriInterp object has the following attributes:
xnodes contains interpolation x-nodesxnodes contains interpolation y-nodesTriInterp() takes nodes-data and returns interpolated one.
class triellipt.amr.TriFront(unit=None, data=None)
Front of triangles.
Properties
| Name | Description |
|---|---|
trinums |
Indices of the front-facing triangles. |
voidnums |
Indices of void triangles in the front. |
TriFront.atrank(self, rank)
Selects the front with the specified rank.
TriFront.angles(self)
Computes the orientation angles of the front.
Returns
flat-float-array
TriFront.scales(self)
Computes the normalized front scales.
Returns
flat-float-array
TriFront.filter_by_mask(self, mask)
Filters the front by the mask.
Parameters
mask : function
(x, y) on the triangles centroids.
Returns
TriFront
TriFront.filter_by_angle(self, angmin, angmax)
Filters the front by the orientation angles.
TriFront.filter_by_scale(self, minval, maxval)
Filters the front by the scales.
triellipt.amr.join_meshes(mesh1, mesh2, tol=None)
Join the meshes along a shared boundary, if available.
Parameters
mesh1 : TriMesh
mesh2 : TriMesh
tol : int = None
Returns
TriMesh | None
Copyright © 2023, Igor Semenov.