|
SpECTRE
v2026.06.09.01
|
A modal filter for spherical-shell elements: a top- \(\ell\) Heaviside cutoff in the angular direction plus optional smooth exponential roll-offs in both the angular \(\ell\) direction and the radial direction. More...
#include <SphericalShell.hpp>
Classes | |
| struct | NumModesToKill |
| The number of top \(\ell\) modes to set to zero. More... | |
| struct | AngularHalfPower |
| Half of the exponent \(\sigma_a\) in the smooth exponential roll-off applied to the angular \(\ell\) modes below the top- \(\ell\) cutoff. More... | |
| struct | RadialHalfPower |
| Half of the exponent \(\sigma_r\) in the smooth exponential roll-off applied to the radial modal coefficients. More... | |
| struct | Enable |
| Enable (true) or disable (false) the filter. More... | |
| struct | BlocksToFilter |
| Which blocks the filter should be applied to. More... | |
| struct | VolumeFilterOnSubstep |
| Apply the volume filter inside every Runge-Kutta substep instead of only at whole-step boundaries. More... | |
| struct | BoundaryCorrectionFilterOnSubstep |
| Apply the boundary correction filter inside every Runge-Kutta substep instead of only at whole-step boundaries. More... | |
| struct | VolumeFilterEveryNSteps |
| Apply the volume filter once every N steps. None (std::nullopt) disables the every-N-steps trigger. More... | |
| struct | BoundaryCorrectionFilterEveryNSteps |
| Apply the boundary correction filter once every N steps. None (std::nullopt) disables the every-N-steps trigger. More... | |
Public Types | |
| using | options |
Public Member Functions | |
| SphericalShell (size_t num_modes_to_kill, std::optional< size_t > angular_half_power, std::optional< size_t > radial_half_power, bool enable, const std::optional< std::vector< std::string > > &blocks_to_filter, bool volume_filter_on_substep, bool boundary_filter_on_substep, std::optional< size_t > volume_filter_every_n_steps, std::optional< size_t > boundary_filter_every_n_steps, const Options::Context &context={}) | |
| WRAPPED_PUPable_decl_base_template (SINGLE_ARG(Filter< 3, TagList >), SphericalShell) | |
| SphericalShell (CkMigrateMessage *msg) | |
| void | pup (PUP::er &p) override |
| std::unique_ptr< Filter< 3, TagList > > | get_clone () const override |
| Return a heap-allocated deep copy of this filter. | |
| bool | apply_volume_filter_on_substep () const override |
| Whether the volume filter should be applied inside every Runge-Kutta substep. | |
| bool | apply_volume_filter_on_this_step (size_t step_number) const override |
| Whether the volume filter should be applied at the given step_number. | |
| bool | apply_boundary_filter_on_substep () const override |
| Whether the boundary filter should be applied inside every Runge-Kutta substep. | |
| bool | apply_boundary_filter_on_this_step (size_t step_number) const override |
| Whether the boundary filter should be applied at the given step_number. | |
| bool | need_jacobians () const override |
| Whether the filter needs the grid-to-inertial Jacobian and its inverse. | |
| bool | supports_mesh (const Mesh< 3 > &mesh) const override |
| std::string | name () const override |
| A human-readable name for the concrete filter type, used in diagnostics. | |
| const std::optional< std::vector< size_t > > & | blocks_to_filter () const override |
| The set of block (or block group) names the filter applies to. | |
| void | set_blocks_to_filter (const std::vector< std::string > &all_block_names, const std::unordered_map< std::string, std::unordered_set< std::string > > &block_groups) override |
| Used after construction to change blocks and groups labeled by strings to size_ts, which is what is used throughout the code. | |
| void | apply_in_volume (gsl::not_null< Variables< TagList > * > vars, const Mesh< 3 > &mesh, const std::optional< InverseJacobian< DataVector, 3, Frame::Grid, Frame::Inertial > > &inv_jac_grid_to_inertial, const std::optional< Jacobian< DataVector, 3, Frame::Grid, Frame::Inertial > > &jac_grid_to_inertial) const override |
| void | apply_on_boundary (gsl::not_null< Variables< TagList > * > vars, const Mesh< 2 > &mesh, const std::optional< InverseJacobian< DataVector, 3, Frame::Grid, Frame::Inertial > > &inv_jac_grid_to_inertial, const std::optional< Jacobian< DataVector, 3, Frame::Grid, Frame::Inertial > > &jac_grid_to_inertial) const override |
| bool | is_equal (const Filter< 3, TagList > &other) const override |
| Public Member Functions inherited from Filters::Filter< 3, TagList > | |
| WRAPPED_PUPable_abstract (Filter) | |
| virtual bool | supports_mesh (const Mesh< Dim > &mesh) const=0 |
| Returns true if this filter can filter the mesh. | |
| virtual bool | is_equal (const Filter &other) const=0 |
| Returns true if other is the same concrete filter type and is equivalent to *this. | |
| virtual void | apply_in_volume (gsl::not_null< Variables< TagList > * > vars, const Mesh< Dim > &mesh, const std::optional< InverseJacobian< DataVector, Dim, Frame::Grid, Frame::Inertial > > &inv_jac_grid_to_inertial, const std::optional< Jacobian< DataVector, Dim, Frame::Grid, Frame::Inertial > > &jac_grid_to_inertial) const=0 |
| Apply the filter in place to the volume vars on the Dim-dimensional mesh. | |
| virtual void | apply_on_boundary (gsl::not_null< Variables< TagList > * > vars, const Mesh< Dim - 1 > &mesh, const std::optional< InverseJacobian< DataVector, Dim, Frame::Grid, Frame::Inertial > > &inv_jac_grid_to_inertial, const std::optional< Jacobian< DataVector, Dim, Frame::Grid, Frame::Inertial > > &jac_grid_to_inertial) const=0 |
| Apply the filter in place to face vars on the Dim - 1 face mesh. | |
Static Public Attributes | |
| static constexpr Options::String | help |
Friends | |
| template<typename LocalTagList> | |
| bool | operator== (const SphericalShell< LocalTagList > &lhs, const SphericalShell< LocalTagList > &rhs) |
A modal filter for spherical-shell elements: a top- \(\ell\) Heaviside cutoff in the angular direction plus optional smooth exponential roll-offs in both the angular \(\ell\) direction and the radial direction.
Concrete implementation of Filters::Filter for spherical-shell elements, driven by the DG filtering action. See Filters::Filter for the framing of volume vs. boundary application, the substep / every-N-steps cadence controls, and the blocks_to_filter semantics.
For each component of the tensors in TagList, the filter rescales the Spherepack-normalized angular modal coefficients \(c_{\ell'}\) as
\begin{align*} c_{\ell'} \to c_{\ell'} \exp\!\left[-36 \left(\frac{\ell'} {\ell^+_{\mathrm{cut}}+1}\right)^{2\sigma_a}\right], \end{align*}
where \(\ell^+_{\mathrm{cut}} = \ell_{\mathrm{max}} -\) NumModesToKill is the largest angular mode that is retained and \(\sigma_a\) is the AngularHalfPower option. With the fixed coefficient 36 and \(\sigma_a\) in the typical range 28-32 the angular filter is smooth below \(\ell^+_{\mathrm{cut}}\) and reduces to a sharp Heaviside cutoff as \(\sigma_a \to \infty\). When AngularHalfPower is None, only the Heaviside cutoff is applied. See ylm::TensorYlm for the derivation of the underlying angular filter.
When RadialHalfPower has a value \(\sigma_r\), an additional 1D exponential filter is applied independently along each radial column. The radial nodal coefficients \(c_i\) are rescaled in modal space as
\begin{align*} c_i \to c_i \exp\!\left[-36 \left(\frac{i}{N_r}\right)^{2\sigma_r}\right], \end{align*}
where \(N_r\) is the radial basis degree (radial extent minus one). When RadialHalfPower is None, the radial direction is left untouched.
| using Filters::SphericalShell< TagList >::options |
|
overridevirtual |
Whether the boundary filter should be applied inside every Runge-Kutta substep.
Implements Filters::Filter< 3, TagList >.
|
overridevirtual |
Whether the boundary filter should be applied at the given step_number.
Implements Filters::Filter< 3, TagList >.
|
overridevirtual |
Whether the volume filter should be applied inside every Runge-Kutta substep.
Implements Filters::Filter< 3, TagList >.
|
overridevirtual |
Whether the volume filter should be applied at the given step_number.
Implements Filters::Filter< 3, TagList >.
|
overridevirtual |
The set of block (or block group) names the filter applies to.
std::nullopt means the filter applies to every block in the domain.
Implements Filters::Filter< 3, TagList >.
|
overridevirtual |
Return a heap-allocated deep copy of this filter.
Implements Filters::Filter< 3, TagList >.
|
inlineoverridevirtual |
A human-readable name for the concrete filter type, used in diagnostics.
Implements Filters::Filter< 3, TagList >.
|
inlineoverridevirtual |
Whether the filter needs the grid-to-inertial Jacobian and its inverse.
When false, the driving action passes std::nullopt for the Jacobian arguments of apply_in_volume and apply_on_boundary and avoids constructing them.
Implements Filters::Filter< 3, TagList >.
|
overridevirtual |
Used after construction to change blocks and groups labeled by strings to size_ts, which is what is used throughout the code.
Implements Filters::Filter< 3, TagList >.
|
staticconstexpr |