SpECTRE  v2026.06.30
Loading...
Searching...
No Matches
Filters::FilledCylinder< TagList > Class Template Reference

A modal filter for filled-cylinder elements: a smooth exponential roll-off of the coupled ZernikeB2 radial-angular (disk) modes and an independent exponential roll-off in the axial direction, plus an optional top-mode Heaviside cutoff in the angular direction. More...

#include <FilledCylinder.hpp>

Classes

struct  BlocksToFilter
 Which blocks the filter should be applied to. More...
struct  BoundaryCorrectionFilterEveryNSteps
 Apply the boundary correction filter once every N steps. None (std::nullopt) disables the every-N-steps trigger. More...
struct  BoundaryCorrectionFilterOnSubstep
 Apply the boundary correction filter inside every Runge-Kutta substep instead of only at whole-step boundaries. More...
struct  Enable
 Enable (true) or disable (false) the filter. More...
struct  NumModesToKill
 The number of top angular (Fourier) \(m\)-modes to set to zero. More...
struct  RadialAngularHalfPower
 Half of the exponent \(m\) in the smooth exponential roll-off applied to the coupled ZernikeB2 radial-angular (disk) modal coefficients (logical dimensions 0 and 1). More...
struct  VolumeFilterEveryNSteps
 Apply the volume filter once every N steps. None (std::nullopt) disables the every-N-steps trigger. More...
struct  VolumeFilterOnSubstep
 Apply the volume filter inside every Runge-Kutta substep instead of only at whole-step boundaries. More...
struct  ZHalfPower
 Half of the exponent \(m\) in the smooth exponential roll-off applied to the axial \(z\) modal coefficients (logical dimension 2). If None, the axial direction is not filtered. More...

Public Types

using options

Public Member Functions

 FilledCylinder (size_t num_modes_to_kill, std::optional< size_t > radial_angular_half_power, std::optional< size_t > z_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 >), FilledCylinder)
 FilledCylinder (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 FilledCylinder< LocalTagList > &lhs, const FilledCylinder< LocalTagList > &rhs)

Detailed Description

template<typename TagList>
class Filters::FilledCylinder< TagList >

A modal filter for filled-cylinder elements: a smooth exponential roll-off of the coupled ZernikeB2 radial-angular (disk) modes and an independent exponential roll-off in the axial direction, plus an optional top-mode Heaviside cutoff in the angular direction.

Concrete implementation of Filters::Filter for the central filled-cylinder block created by domain::creators::AngularCylinder, 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.

A filled-cylinder element uses a ZernikeB2 basis in the radial direction (logical dimension 0), a ZernikeB2 basis in the angular direction (logical dimension 1), and a Legendre/Chebyshev basis in the axial \(z\) direction (logical dimension 2). Unlike the Fourier-angular Filters::HollowCylinder shells, the ZernikeB2 radial and angular spectral spaces are intertwined (a two-dimensional disk basis), so the radial and angular roll-offs cannot be specified independently: a single RadialAngularHalfPower drives the combined disk exponential filter, while ZHalfPower drives the axial filter.

In the volume the disk and axial filters are applied by Spectral::filtering::zernike_b2_cylinder_filter. The coefficient of the exponential roll-off is hardcoded to 36, matching Filters::Hypercube, Filters::SphericalShell, and Filters::HollowCylinder. When NumModesToKill is nonzero, the top NumModesToKill angular (Fourier \(m\)) modes are additionally set to zero by a Heaviside cutoff (the \(m=0\) mode is always retained).

For boundary-correction filtering the face mesh is classified by basis and quadrature:

  • an axial face (both directions ZernikeB2) is a full disk and is filtered by Spectral::filtering::zernike_b2_disk_filter;
  • a mantle/radial face (ZernikeB2 with Equiangular quadrature in the angular direction, Legendre/Chebyshev in \(z\)) is filtered by treating the equiangular angular direction as a Fourier direction (an exponential roll-off using RadialAngularHalfPower plus the NumModesToKill cutoff), together with the axial filter;

Member Typedef Documentation

◆ options

template<typename TagList>
using Filters::FilledCylinder< TagList >::options
Initial value:
Which blocks the filter should be applied to.
Definition FilledCylinder.hpp:130
Apply the boundary correction filter once every N steps. None (std::nullopt) disables the every-N-ste...
Definition FilledCylinder.hpp:175
Apply the boundary correction filter inside every Runge-Kutta substep instead of only at whole-step b...
Definition FilledCylinder.hpp:149
Enable (true) or disable (false) the filter.
Definition FilledCylinder.hpp:124
The number of top angular (Fourier) -modes to set to zero.
Definition FilledCylinder.hpp:83
Half of the exponent in the smooth exponential roll-off applied to the coupled ZernikeB2 radial-angu...
Definition FilledCylinder.hpp:103
Apply the volume filter once every N steps. None (std::nullopt) disables the every-N-steps trigger.
Definition FilledCylinder.hpp:162
Apply the volume filter inside every Runge-Kutta substep instead of only at whole-step boundaries.
Definition FilledCylinder.hpp:141
Half of the exponent in the smooth exponential roll-off applied to the axial modal coefficients (lo...
Definition FilledCylinder.hpp:116

Member Function Documentation

◆ apply_boundary_filter_on_substep()

template<typename TagList>
bool Filters::FilledCylinder< TagList >::apply_boundary_filter_on_substep ( ) const
overridevirtual

Whether the boundary filter should be applied inside every Runge-Kutta substep.

Implements Filters::Filter< 3, TagList >.

◆ apply_boundary_filter_on_this_step()

template<typename TagList>
bool Filters::FilledCylinder< TagList >::apply_boundary_filter_on_this_step ( size_t step_number) const
overridevirtual

Whether the boundary filter should be applied at the given step_number.

Note
Currently the check for whether to filter on every N steps is done relative to the start of the current Slab. This means that for GTS, independent of the value of N for every N steps, every step has a filter applied since GTS has one step per slab.

Implements Filters::Filter< 3, TagList >.

◆ apply_volume_filter_on_substep()

template<typename TagList>
bool Filters::FilledCylinder< TagList >::apply_volume_filter_on_substep ( ) const
overridevirtual

Whether the volume filter should be applied inside every Runge-Kutta substep.

Implements Filters::Filter< 3, TagList >.

◆ apply_volume_filter_on_this_step()

template<typename TagList>
bool Filters::FilledCylinder< TagList >::apply_volume_filter_on_this_step ( size_t step_number) const
overridevirtual

Whether the volume filter should be applied at the given step_number.

Note
Currently the check for whether to filter on every N steps is done relative to the start of the current Slab. This means that for GTS, independent of the value of N for every N steps, every step has a filter applied since GTS has one step per slab.

Implements Filters::Filter< 3, TagList >.

◆ blocks_to_filter()

template<typename TagList>
const std::optional< std::vector< size_t > > & Filters::FilledCylinder< TagList >::blocks_to_filter ( ) const
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 >.

◆ get_clone()

template<typename TagList>
std::unique_ptr< Filter< 3, TagList > > Filters::FilledCylinder< TagList >::get_clone ( ) const
overridevirtual

Return a heap-allocated deep copy of this filter.

Implements Filters::Filter< 3, TagList >.

◆ name()

template<typename TagList>
std::string Filters::FilledCylinder< TagList >::name ( ) const
inlineoverridevirtual

A human-readable name for the concrete filter type, used in diagnostics.

Implements Filters::Filter< 3, TagList >.

◆ need_jacobians()

template<typename TagList>
bool Filters::FilledCylinder< TagList >::need_jacobians ( ) const
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 >.

◆ set_blocks_to_filter()

template<typename TagList>
void Filters::FilledCylinder< TagList >::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 )
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 >.

Member Data Documentation

◆ help

template<typename TagList>
Options::String Filters::FilledCylinder< TagList >::help
staticconstexpr
Initial value:
= {
"A filled-cylinder filter applying a smooth exponential roll-off of the "
"coupled ZernikeB2 radial-angular (disk) modes and an independent "
"exponential roll-off in the axial direction, with an optional top-mode "
"Heaviside cutoff in the angular direction."}

The documentation for this class was generated from the following file:
  • src/NumericalAlgorithms/LinearOperators/Filters/FilledCylinder.hpp