|
SpECTRE
v2026.04.01
|
Abstract base class for spectral filters. More...
#include <Filter.hpp>
Public Member Functions | |
| WRAPPED_PUPable_abstract (Filter) | |
| Filter (CkMigrateMessage *m) | |
| virtual std::unique_ptr< Filter< Dim, TagList > > | get_clone () const =0 |
| Return a heap-allocated deep copy of this filter. | |
| virtual bool | apply_volume_filter_on_substep () const =0 |
| Whether the volume filter should be applied inside every Runge-Kutta substep. | |
| virtual bool | apply_volume_filter_on_this_step (size_t step_number) const =0 |
| Whether the volume filter should be applied at the given step_number. | |
| virtual bool | apply_boundary_filter_on_substep () const =0 |
| Whether the boundary filter should be applied inside every Runge-Kutta substep. | |
| virtual bool | apply_boundary_filter_on_this_step (size_t step_number) const =0 |
| Whether the boundary filter should be applied at the given step_number. | |
| virtual bool | need_jacobians () const =0 |
| Whether the filter needs the grid-to-inertial Jacobian and its inverse. | |
| 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 const std::optional< std::vector< size_t > > & | blocks_to_filter () const =0 |
| The set of block (or block group) names the filter applies to. | |
| virtual 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)=0 |
| Used after construction to change blocks and groups labeled by strings to size_ts, which is what is used throughout the code. | |
| 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. | |
Abstract base class for spectral filters.
Derived classes implement spectral filters that suppress high-frequency modes in the modal expansion of a discontinuous Galerkin solution. Writing the 1-D modal coefficients of a tensor component as \(c_i\), a spectral filter rescales them as
\begin{align*} c_i \to \sigma\!\left(\frac{i}{N}\right) c_i, \end{align*}
where \(N\) is the basis degree (number of grid points per element per dimension minus one) and \(\sigma\) is a derived-class-specific damping factor (for example, an exponential in Filters::Hypercube). For a discussion of filtering see section 5.3 of [101].
The interface is organized along two axes:
Derived classes additionally declare via need_jacobians() whether they require the grid-to-inertial Jacobian and its inverse in apply_in_volume / apply_on_boundary. When need_jacobians() returns false, the driving action passes std::nullopt for both Jacobian arguments and skips computing them.
The set of domain blocks to which the filter applies is reported by blocks_to_filter(); a std::nullopt return value means the filter applies to every block in the domain.
|
pure virtual |
Whether the boundary filter should be applied inside every Runge-Kutta substep.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Whether the boundary filter should be applied at the given step_number.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Apply the filter in place to the volume vars on the Dim-dimensional mesh.
The grid-to-inertial Jacobian jac_grid_to_inertial and its inverse inv_jac_grid_to_inertial are populated only when need_jacobians() returns true; otherwise both arguments are std::nullopt.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Apply the filter in place to face vars on the Dim - 1 face mesh.
Used to filter the lifted boundary corrections produced by the DG numerical flux before they enter the volume right-hand side. The grid-to-inertial Jacobian jac_grid_to_inertial and its inverse inv_jac_grid_to_inertial are populated only when need_jacobians() returns true; otherwise both arguments are std::nullopt.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Whether the volume filter should be applied inside every Runge-Kutta substep.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Whether the volume filter should be applied at the given step_number.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
The set of block (or block group) names the filter applies to.
std::nullopt means the filter applies to every block in the domain.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Return a heap-allocated deep copy of this filter.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Returns true if other is the same concrete filter type and is equivalent to *this.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
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.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Used after construction to change blocks and groups labeled by strings to size_ts, which is what is used throughout the code.
Implemented in Filters::Hypercube< Dim, TagList >.
|
pure virtual |
Returns true if this filter can filter the mesh.
Implemented in Filters::Hypercube< Dim, TagList >.