salvus.mesh.algorithms.optimize_dt
A mesh smoother optimizing the miller estimate of the time step.
Functions
dgamma()
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
msalvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The unstructured mesh object.ijnumpy.ndarray — ijrhofloat — rho
Returns numpy.ndarray
dgamma_h()
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
msalvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh.h_ek_refUnion[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]] — h_ek_refg_exponentint — g_exponentrhofloat — rho
Returns numpy.ndarray
gamma()
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
msalvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh.ijnumpy.ndarray — ijrhofloat — rhoreturn_gamma_maxbool — Return the max gamma value.return_gamma_arraybool — Return the gamme array.
Returns Union[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], float]
gamma_h()
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
msalvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh.h_ek_refUnion[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]] — h_ek_refg_exponentint — g_exponentrhofloat — rhoreturn_gamma_h_maxbool — Return the max value of gamma_h.
Returns Union[float, numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]]
optimize_dt()
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
msalvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh to optimize.fixed_side_setsOptional[List[List[Set[Tuple[int, int]]]]] — Element and side ids of the fixed side sets.maxiterint — Maximum number of iterations.rhofloat — rhorho_hfloat — rho_hweight_hfloat — weight_hh_ek_refUnion[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], float] — h_ek_refg_exponentint — g_exponentscale_meshbool — Scale the mesh.scale_factorfloat — Scaling factor.verbosebool — Verbosity.
Returns salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
optimize_dt_locally()
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
msalvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — 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_refUnion[numpy.ndarray[Any, numpy.dtype[numpy.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 salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh