Mondaic
This API reference is not for the latest stable Salvus version.

salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.interlayer_constant

Enforce a constant number of elements between layers.

Classes

InterlayerConstant

class 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()
def interlayer_connector(
    self,
    l0: Tuple[List[int], int],
    l1: Tuple[List[int], int],
    cs: salvus.geometry.coordinates.coordinates.CoordinateSystem,
    layer_bounds: Dict[str, Tuple[float, float]],
) -> Tuple[
    List[
        Tuple[
            int,
            Union[
                salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy._InterlayerConnectorProtocol2D,
                salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy._InterlayerConnectorProtocol3D,
            ],
        ]
    ],
    List[
        Tuple[
            int,
            Union[
                salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy._InterlayerConnectorProtocol2D,
                salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy._InterlayerConnectorProtocol3D,
            ],
        ]
    ],
]: ...

No connectors are required for a constant policy.

Parameters
  • l0 Tuple[List[int], int] — Number of elements in layer a.
  • l1 Tuple[List[int], int] — Number of elements in layer b.
  • cs salvus.geometry.coordinates.coordinates.CoordinateSystem — The coordinate system.
  • layer_bounds Dict[str, Tuple[float, float]] — The bounds of the associated layer.
Returns Tuple[List[Tuple[int, Union[salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy._InterlayerConnectorProtocol2D, salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy._InterlayerConnectorProtocol3D]]], List[Tuple[int, Union[salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy._InterlayerConnectorProtocol2D, salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy._InterlayerConnectorProtocol3D]]]] — A tuple of empty lists (no connectors).
interlayer_constraint()
def interlayer_constraint(
    self,
    a: List[ortools.sat.python.cp_model.IntVar],
    b: List[ortools.sat.python.cp_model.IntVar],
) -> List[List[ortools.sat.python.cp_model.BoundedLinearExpression]]: ...

Generate the interlayer constraints.

Parameters
  • a List[ortools.sat.python.cp_model.IntVar] — Number of horizontal elements in layer a.
  • b List[ortools.sat.python.cp_model.IntVar] — Number of horizontal elements in layer b.
Returns List[List[ortools.sat.python.cp_model.BoundedLinearExpression]] — An equality constant between a and b.