salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.interlayer_doubling
salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.interlayer_doubling salvus mesh layered_meshing meshing_protocol coarsening_policy interlayer_doubling Interlayer doubling.
Classes
InterlayerDoubling
InterlayerDoublingclass InterlayerDoubling(
salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.InterlayerCoarseningPolicy
):
def __init__(
self, n_layers: typing.Literal[1, 2, "auto"] = "auto"
) -> None: ...Ensure the # of elements across adjacent layers differs by a factor of 2.
n_layerstyping.Literal[1, 2, 'auto'] — The number of elements to use for each doubling layer, or “auto” to let Salvus choose. Ideally,n_layersshould be set to 1 if the doubling layer is detected to be less than 2 elements thick, otherwise it should be set to 2. Such behavior is implemented automatically if “auto” is passed here.
coarsening_factor int
coarsening_factor intThe factor relating the element counts of two adjacent layers.
Returns: 2, requiring the element counts to differ by a power of 2.
max_coarsening int
max_coarsening intThe largest number of successive coarsenings allowed at a boundary.
Returns: The maximum number of coarsenings. Can be parameterized if required.
interlayer_connector()
interlayer_connector()def interlayer_connector(
self,
l0: tuple[list[int], int],
l1: tuple[list[int], int],
cs: CoordinateSystem,
layer_bounds: dict[str, tuple[float, float]],
) -> tuple[
list[tuple[int, _InterlayerConnectorProtocol]],
list[tuple[int, _InterlayerConnectorProtocol]],
]: ...Callable which returns a MeshBlock that connects two layers.
A tuple is returned, the first element of which is the number of
connecting mesh blocks that need to be constructed. For instance, if
the interlayer policy is “doubling”, and the number of elements between
two layers different by a factor 4, the first element of the returned
tuple should be 2. The second element is a partial function with the
n_elem_ arguments already applied, and which can then subsequently be
called with extents.
A tuple is returned, the first element specifying the connectors required for the layer’s top, and the second for the layer’s bottom.
l0tuple[list[int], int] — Tuple of: (list of number of elements in each horizontal direction, number of vertical elements) in the top layer.l1tuple[list[int], int] — Tuple of: (list of number of elements in each horizontal direction, number of vertical elements) in the bottom layer.csCoordinateSystem — The coordinate system.layer_boundsdict[str, tuple[float, float]] — The bounds of the associated layer.