salvus.mesh.algorithms.optimize_dt
salvus.mesh.algorithms.optimize_dt salvus mesh algorithms optimize_dt A mesh smoother optimizing the miller estimate of the time step.
Functions
dgamma()
dgamma()def dgamma(
m: UnstructuredMesh, ij: npt.NDArray, rho: float = 1.0
) -> npt.NDArray: ...Compute the derivative of gamma.
Parameters
mUnstructuredMesh — The unstructured mesh object.ijnpt.NDArray — ijrhofloat — rho
Returns npt.NDArray
dgamma_h()
dgamma_h()def dgamma_h(
m: UnstructuredMesh,
h_ek_ref: float | npt.NDArray,
g_exponent: int = 3,
rho: float = 35.0,
) -> npt.NDArray: ...Compute d gamma h.
Parameters
mUnstructuredMesh — The mesh.h_ek_reffloat | npt.NDArray — h_ek_refg_exponentint — g_exponentrhofloat — rho
Returns npt.NDArray
gamma()
gamma()def gamma(
m: UnstructuredMesh,
ij: npt.NDArray,
rho: float = 1.0,
return_gamma_max: bool = False,
return_gamma_array: bool = False,
) -> npt.NDArray | float: ...Compute gamma.
Parameters
mUnstructuredMesh — The mesh.ijnpt.NDArray — ijrhofloat — rhoreturn_gamma_maxbool — Return the max gamma value.return_gamma_arraybool — Return the gamme array.
Returns npt.NDArray | float
gamma_h()
gamma_h()def gamma_h(
m: UnstructuredMesh,
h_ek_ref: float | npt.NDArray,
g_exponent: int = 3,
rho: float = 35.0,
return_gamma_h_max: bool = False,
) -> float | npt.NDArray: ...Compute gamma h.
Parameters
mUnstructuredMesh — The mesh.h_ek_reffloat | npt.NDArray — h_ek_refg_exponentint — g_exponentrhofloat — rhoreturn_gamma_h_maxbool — Return the max value of gamma_h.
Returns float | npt.NDArray
optimize_dt()
optimize_dt()def optimize_dt(
m: UnstructuredMesh,
fixed_side_sets: list[list[set[tuple[int, int]]]] | None = None,
maxiter: int = 50,
rho: float = 35.0,
rho_h: float = 35.0,
weight_h: float = 0.0,
h_ek_ref: npt.NDArray | float = 0.0,
g_exponent: int = 3,
scale_mesh: bool = True,
scale_factor: float = 10000.0,
verbose: bool = False,
) -> UnstructuredMesh: ...Optimize the time step for a mesh and return a better mesh.
Parameters
mUnstructuredMesh — The mesh to optimize.fixed_side_setslist[list[set[tuple[int, int]]]] | None — Element and side ids of the fixed side sets.maxiterint — Maximum number of iterations.rhofloat — rhorho_hfloat — rho_hweight_hfloat — weight_hh_ek_refnpt.NDArray | float — h_ek_refg_exponentint — g_exponentscale_meshbool — Scale the mesh.scale_factorfloat — Scaling factor.verbosebool — Verbosity.
Returns UnstructuredMesh
optimize_dt_locally()
optimize_dt_locally()def optimize_dt_locally(
m: 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: npt.NDArray[np.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,
) -> UnstructuredMesh: ...Locally optimize the time step of a mesh by finding the worst elements and only optimizing those.
Parameters
mUnstructuredMesh — The mesh to optimize.fixed_side_set_nameslist[str] — Names of the fixed side sets.maxiterint — Maximum number of iterations.rhofloat — rhorho_hfloat — rho_hweight_hfloat — weight_hh_ek_refnpt.NDArray[np.floating] | float — h_ek_refg_exponentint — g_exponentelement_count_optint — Number of elements to optimize.halo_widthint — Halo width around the problematic elements.scale_factorfloat — Scaling factor.verbosebool — Verbosity.
Returns UnstructuredMesh