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

salvus.mesh.algorithms.optimize_dt

A mesh smoother optimizing the miller estimate of the time step.

Functions

dgamma()

def dgamma(
    m: salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
    ij: numpy.ndarray,
    rho: float = 1.0,
) -> numpy.ndarray: ...

Compute the derivative of gamma.

Parameters
  • m salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The unstructured mesh object.
  • ij numpy.ndarray — ij
  • rho float — rho
Returns numpy.ndarray

dgamma_h()

def dgamma_h(
    m: salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
    h_ek_ref: Union[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]],
    g_exponent: int = 3,
    rho: float = 35.0,
) -> numpy.ndarray: ...

Compute d gamma h.

Parameters
  • m salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh.
  • h_ek_ref Union[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]] — h_ek_ref
  • g_exponent int — g_exponent
  • rho float — rho
Returns numpy.ndarray

gamma()

def gamma(
    m: salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
    ij: numpy.ndarray,
    rho: float = 1.0,
    return_gamma_max: bool = False,
    return_gamma_array: bool = False,
) -> Union[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], float]: ...

Compute gamma.

Parameters
  • m salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh.
  • ij numpy.ndarray — ij
  • rho float — rho
  • return_gamma_max bool — Return the max gamma value.
  • return_gamma_array bool — Return the gamme array.
Returns Union[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], float]

gamma_h()

def gamma_h(
    m: salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
    h_ek_ref: Union[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]],
    g_exponent: int = 3,
    rho: float = 35.0,
    return_gamma_h_max: bool = False,
) -> Union[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]]: ...

Compute gamma h.

Parameters
  • m salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh.
  • h_ek_ref Union[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]] — h_ek_ref
  • g_exponent int — g_exponent
  • rho float — rho
  • return_gamma_h_max bool — Return the max value of gamma_h.
Returns Union[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]]

optimize_dt()

def optimize_dt(
    m: salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
    fixed_side_sets: Optional[List[List[Set[Tuple[int, int]]]]] = None,
    maxiter: int = 50,
    rho: float = 35.0,
    rho_h: float = 35.0,
    weight_h: float = 0.0,
    h_ek_ref: Union[
        numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], float
    ] = 0.0,
    g_exponent: int = 3,
    scale_mesh: bool = True,
    scale_factor: float = 10000.0,
    verbose: bool = False,
) -> (
    salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
): ...

Optimize the time step for a mesh and return a better mesh.

Parameters
  • m salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh to optimize.
  • fixed_side_sets Optional[List[List[Set[Tuple[int, int]]]]] — Element and side ids of the fixed side sets.
  • maxiter int — Maximum number of iterations.
  • rho float — rho
  • rho_h float — rho_h
  • weight_h float — weight_h
  • h_ek_ref Union[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], float] — h_ek_ref
  • g_exponent int — g_exponent
  • scale_mesh bool — Scale the mesh.
  • scale_factor float — Scaling factor.
  • verbose bool — Verbosity.
Returns salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh

optimize_dt_locally()

def optimize_dt_locally(
    m: salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
    fixed_side_set_names: List[str],
    maxiter: int = 50,
    rho: float = 35.0,
    rho_h: float = 35.0,
    weight_h: float = 0.0,
    h_ek_ref: Union[
        numpy.ndarray[Any, numpy.dtype[numpy.floating]], float
    ] = 0.0,
    g_exponent: int = 3,
    element_count_opt: int = 100,
    halo_width: int = 3,
    scale_factor: float = 10000.0,
    verbose: bool = False,
) -> (
    salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
): ...

Locally optimize the time step of a mesh by finding the worst elements and only optimizing those.

Parameters
  • m salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh to optimize.
  • fixed_side_set_names List[str] — Names of the fixed side sets.
  • maxiter int — Maximum number of iterations.
  • rho float — rho
  • rho_h float — rho_h
  • weight_h float — weight_h
  • h_ek_ref Union[numpy.ndarray[Any, numpy.dtype[numpy.floating]], float] — h_ek_ref
  • g_exponent int — g_exponent
  • element_count_opt int — Number of elements to optimize.
  • halo_width int — Halo width around the problematic elements.
  • scale_factor float — Scaling factor.
  • verbose bool — Verbosity.
Returns salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh