5.4. Spectral filters

mirgecom.filter is for filters and filter-related constructs.

Discussion of the spectral filter design can be found in: [Hesthaven_2008], Section 5.3

5.4.1. Mode Response Functions

mirgecom.filter.exponential_mode_response_function(mode, alpha, cutoff, nfilt, filter_order)[source]

Return an exponential filter coefficient for the user-provided mode.

5.4.2. Helper Functions

mirgecom.filter.make_spectral_filter(actx, group, cutoff, mode_response_function)[source]

Create a spectral filter with the provided mode_response_function.

This routine returns a filter operator in the modal basis designed to apply the user-provided mode_response_function to the spectral modes beyond the user-provided cutoff.

Parameters:
Returns:

filter – filter operator in the modal basis

Return type:

numpy.ndarray

mirgecom.filter.apply_spectral_filter(actx, modal_field, discr, cutoff, mode_response_function)[source]

Apply the spectral filter, defined by the mode_response_function.

This routine returns filtered data in the modal basis, which has been applied using a user-provided mode_response_function to dampen modes beyond the user-provided cutoff.

Parameters:
Returns:

modal_field – DOFArray or object array of DOFArrays

Return type:

meshmode.dof_array.DOFArray

5.4.3. Applying Filters

mirgecom.filter.filter_modally(dcoll, cutoff, mode_resp_func, field, *, dd=DOFDesc(domain_tag=VolumeDomainTag(tag=<class 'grudge.dof_desc.VTAG_ALL'>), discretization_tag=<class 'grudge.dof_desc.DISCR_TAG_BASE'>))[source]

Stand-alone procedural interface to spectral filtering.

For each element group in the discretization, and restriction, This routine generates:

  • a filter operator:
    • cutoff filters only modes above this mode id

    • mode_resp_func function returns a filter coefficient

      for a given mode

    • memoized into the array context

  • a filtered solution wherein the filter is applied to field.

Parameters:
Returns:

result – An array container containing the filtered field(s).

Return type:

mirgecom.fluid.ConservedVars

5.4.4. Spectral Analysis Helpers

mirgecom.filter.get_element_spectrum_from_modal_representation(actx, vol_discr, modal_fields, element_order)[source]

Get the Legendre Polynomial expansion for specified fields on elements.

Parameters:
Returns:

Array with the element modes accumulated into the corresponding “modes” for the polynomial basis functions for each field.

Return type:

numpy.ndarray