salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.compute_coarsening_policies
salvus.mesh.layered_meshing.meshing_protocol.coarsening_policy.compute_coarsening_policies salvus mesh layered_meshing meshing_protocol coarsening_policy compute_coarsening_policies Utility function to compute coarsening policies.
Functions
compute_coarsening_policies()
compute_coarsening_policies()def compute_coarsening_policies(
domain: _domain.Domain,
layered_model: _layered_model.LayeredModel,
mesh_resolution: types.MeshResolution,
coarsening_policy: InterlayerCoarseningPolicy = InterlayerDoubling(
n_layers="auto"
),
) -> list[InterlayerCoarseningPolicy]: ...Compute coarsening policies for meshing a layered model.
This function determines the coarsening policies for a given layered model based on the domain, mesh resolution, and an optional interlayer coarsening policy. It evaluates the minimum layer thickness and the maximum element size reduction across layers to decide the appropriate coarsening strategy.
Parameters
domain_domain.Domain — The domain object representing the spatial domain of the mesh.layered_model_layered_model.LayeredModel — The layered model object containing the mesh layers and their properties.mesh_resolutiontypes.MeshResolution — The resolution of the mesh, which influences the element size and coarsening decisions.coarsening_policyInterlayerCoarseningPolicy — The default interlayer coarsening policy to use. Defaults toInterlayerDoubling().
Returns list[InterlayerCoarseningPolicy] — A list of coarsening policies for the layers, determined based on the computed thickness-to-element size ratio.