salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.interlayer_constant
Enforce a constant number of elements between layers.
Classes
InterlayerConstant
InterlayerConstantclass InterlayerConstant(
salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.InterlayerCoarseningPolicy
):
def __init__(self) -> None: ...Ensure an equal number of elements across adjacent layers.
Methods
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]],
]: ...No connectors are required for a constant policy.
Parameters
l0tuple[list[int], int] — Number of elements in layer a.l1tuple[list[int], int] — Number of elements in layer b.csCoordinateSystem — The coordinate system.layer_boundsdict[str, tuple[float, float]] — The bounds of the associated layer.
Returns tuple[list[tuple[int, _InterlayerConnectorProtocol]], list[tuple[int, _InterlayerConnectorProtocol]]] — A tuple of empty lists (no connectors).
interlayer_constraint()
interlayer_constraint()def interlayer_constraint(
self, a: list[cp_model.IntVar], b: list[cp_model.IntVar]
) -> list[list[cp_model.BoundedLinearExpression]]: ...Generate the interlayer constraints.
Parameters
alist[cp_model.IntVar] — Number of horizontal elements in layer a.blist[cp_model.IntVar] — Number of horizontal elements in layer b.
Returns list[list[cp_model.BoundedLinearExpression]] — An equality constant between a and b.