Mondaic

salvus.fem.error_estimations

salvus.fem.error_estimations salvus fem error_estimations

Estimate numerical errors when using Salvus.

Spatial dispersion errors are estimated using references from:

W.A. Mulder, 1999 Spurious modes in finite-element discretizations of the wave equation may not be all that bad Applied Numerical Mathematics, Volume 30, Issue 4 https://doi.org/10.1016/S0168-9274(98)00078-6.

Functions

estimate_epw_for_new_p()

def estimate_epw_for_new_p(
    original_p: int_, original_epw: float_, new_p: int_
) -> float_: ...

Estimate the required elements per wavelength for a new simulation.

Given an existing polynomial order and elements per wavelength settings, estimate the required elements per wavelength for a new polynomial order so that the spatial dispersion error per cycle remains approximately the same.

Parameters
  • original_p int_ — The original polynomial order.
  • original_epw float_ — The original elements per wavelength.
  • new_p int_ — The new polynomial order.
Returns float_

estimate_epw_for_simulation()

def estimate_epw_for_simulation(
    p: int_, number_of_cycles: float_, acceptable_error: float_
) -> float_: ...

Estimate the required elements per wavelength for a given accuracy.

Given a polynomial order, number of cycles, and acceptable error, estimate the required elements per wavelength so that the spatial dispersion error stays below the acceptable error.

Parameters
  • p int_ — The polynomial order.
  • number_of_cycles float_ — The number of cycles/propagated wavelengths.
  • acceptable_error float_ — The acceptable error.
Returns float_

estimate_spatial_dispersion_error_per_cycle()

def estimate_spatial_dispersion_error_per_cycle(
    p: int_, elements_per_wavelength: T
) -> T: ...

Estimate the spatial dispersion error per cycle.

This is an estimate of the spatial dispersion error per cycle/propagated wavelength of the spectral element method employed by Salvus, assuming perfect time integration.

Parameters
  • p int_ — The polynomial order of the elements.
  • elements_per_wavelength T — The number of elements per wavelength.
Returns T