Version:

salvus.mesh.layered_meshing.meshing_protocol.refinement_policy.simple_post_refinement

salvus.mesh.layered_meshing.meshing_protocol.refinement_policy.simple_post_refinement salvus mesh layered_meshing meshing_protocol refinement_policy simple_post_refinement
Apply simple post-refinement to a layered model.

Functions

simple_post_refinement()

Get structures used to refinements to regions with shorter wavelengths.
Mesh refinement in Salvus is a global operation, and therefore can only take place once a "template" mesh is generated. If local refinements are desired, then it is helpful to clip, or filter, a material's wavelength oracle to a minimum value during mesh generation time. Subsequently, it is then desirable to apply local refinements to the regions that were clipped, in order to respect the true values of the minimum wavelength in that region.
This function returns a (List[OracleFilter], LocalRefinementPolicy) tuple that streamlines a common case for the application of local refinements. The length of the list of OracleFilters is the same length as the number of layers in the model. The OracleFilter returned can be used as an argument to a MeshingProtocol's oracle_filter parameters, which will clip the minimum value of each layer wavelength oracle as described above. The LocalRefinementPolicy will find mark all the points that were clipped for refinement, and can be passed as an argument to a MeshingProtocol's local_refinement_policy argument.
fac refers to the multiple of an oracle's minimum value below which refinements will be applied. The local refinements in Salvus effectively reduce the edge length in each dimension by a factor of 3, leading to 9 elements per unit volume in 2-D, and 27 elements per unit volume in 3-D. Therefore, the natural value, and default, for fac is 3.0, as after refinement the elements-per-wavelength criterion will be approximately met.
Kwargs is a list of keyword arguments to pass to get_enclosing_elements.
SIGNATURE
def simple_post_refinement(
    layered_model: LayeredModel,
    domain: _domain.Domain,
    fac: float | typing.Sequence[float] | None = None,
    restrict: int | list[int] | None = None,
    refinement_style: str | None = None,
    refinement_level: int | None = None,
    unique_points_tolerance: int = 8,
    enclosing_elements_method: str = "inverse_coordinate_transform",
) -> tuple[list[filters.OracleFilter], list[LocalRefinementPolicy]]: ...
ARGUMENTS
Required
layered_model
Type:LayeredModel
Description:
The layered model to generate refinement structures for.
Required
domain
Type:_domain.Domain
Description:
The domain as the model will potentially need to be realized.
Optional
fac
Type:float | typing.Sequence[float] | None
Default value:None
Description:
The factor above an oracle's minimum at which to clip. Defaults to 3.0.
Optional
restrict
Type:int | list[int] | None
Default value:None
Description:
Only generate policies for these layers, and use pass-through for the others. If None, generate policies for all layers. Defaults to None.
Optional
refinement_style
Type:str | None
Default value:None
Description:
Which refinement style to use. See documentation of salvus_mesh.refine_locally(...) for more information. If None, will be automatically determined based on the value of refinement_level.
Optional
refinement_level
Type:int | None
Default value:None
Description:
How many times to refine the mesh. See documentation of salvus_mesh.refine_locally(...) for more information. If None, will be automatically determined from fac.
Optional
unique_points_tolerance
Type:int
Default value:8
Description:
The number of decimal digits used to determine unique points in the refined mesh.
Optional
enclosing_elements_method
Type:str
Default value:'inverse_coordinate_transform'
Description:
The method to use for the enclosing elements search, can be either "inverse_coordinate_transform" or "bounding_box". "inverse_coordinate_transform" is more accurate but may be significantly more expensive than "bounding_box".
RETURNS
Return type: tuple[list[filters.OracleFilter], list[LocalRefinementPolicy]]
A tuple of the (List[OracleFilter], LocalRefinementPolicy).

Used in tutorials

Functionality from this module is used in the following tutorials.
PAGE CONTENTS