SpECTRE
v2024.12.16
|
Variable and flux vector splitting reconstruction schemes for finite difference methods. More...
Enumerations | |
enum class | FallbackReconstructorType { Minmod , MonotonisedCentral , None } |
Possible types of reconstruction routines to fall back to from higher-order reconstruction when using adaptive method. More... | |
Functions | |
template<size_t NonlinearWeightExponent, size_t Dim> | |
void | aoweno_53 (const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_upper_side_of_face_vars, const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_lower_side_of_face_vars, const gsl::span< const double > &volume_vars, const DirectionMap< Dim, gsl::span< const double > > &ghost_cell_vars, const Index< Dim > &volume_extents, const size_t number_of_variables, const double gamma_hi, const double gamma_lo, const double epsilon) |
Performs an adaptive order (AO) WENO reconstruction using a single 5th order stencil and a 3rd-order CWENO scheme. More... | |
template<size_t Dim> | |
auto | aoweno_53_function_pointers (size_t nonlinear_weight_exponent) -> std::tuple< void(*)(gsl::not_null< std::array< gsl::span< double >, Dim > * >, gsl::not_null< std::array< gsl::span< double >, Dim > * >, const gsl::span< const double > &, const DirectionMap< Dim, gsl::span< const double > > &, const Index< Dim > &, size_t, double, double, double), void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const double &, const double &), void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const double &, const double &)> |
Returns function pointers to the aoweno_53 function, lower neighbor reconstruction, and upper neighbor reconstruction. More... | |
std::ostream & | operator<< (std::ostream &os, fd::reconstruction::FallbackReconstructorType recons_type) |
template<size_t Dim> | |
void | minmod (const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_upper_side_of_face_vars, const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_lower_side_of_face_vars, const gsl::span< const double > &volume_vars, const DirectionMap< Dim, gsl::span< const double > > &ghost_cell_vars, const Index< Dim > &volume_extents, const size_t number_of_variables) |
Performs minmod reconstruction on the volume_vars in each direction. More... | |
template<size_t Dim> | |
void | monotonicity_preserving_5 (const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_upper_side_of_face_vars, const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_lower_side_of_face_vars, const gsl::span< const double > &volume_vars, const DirectionMap< Dim, gsl::span< const double > > &ghost_cell_vars, const Index< Dim > &volume_extents, const size_t number_of_variables, const double alpha, const double epsilon) |
Performs the fifth order monotonicity-preserving (MP5) reconstruction [184]. More... | |
template<size_t Dim> | |
void | monotonised_central (const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_upper_side_of_face_vars, const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_lower_side_of_face_vars, const gsl::span< const double > &volume_vars, const DirectionMap< Dim, gsl::span< const double > > &ghost_cell_vars, const Index< Dim > &volume_extents, const size_t number_of_variables) |
Performs monotonised central-difference reconstruction on the vars in each direction. More... | |
template<size_t Dim, bool ReturnReconstructionOrder> | |
auto | positivity_preserving_adaptive_order_function_pointers (bool positivity_preserving, bool use_9th_order, bool use_7th_order, FallbackReconstructorType fallback_recons) -> std::tuple< detail::ppao_recons_type< Dim, ReturnReconstructionOrder >, void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const double &, const double &), void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const double &, const double &)> |
Returns function pointers to the positivity_preserving_adaptive_order function, lower neighbor reconstruction, and upper neighbor reconstruction. | |
template<Side LowerOrUpperSide, typename Reconstructor , bool UseExteriorCell = true, size_t NumberOfGhostPoints = (Reconstructor::stencil_width() / 2 + 1), size_t Dim, typename... ArgsForReconstructor> | |
void | reconstruct_neighbor (gsl::not_null< DataVector * > face_data, const DataVector &volume_data, const DataVector &neighbor_data, const Index< Dim > &volume_extents, const Index< Dim > &ghost_data_extents, const Direction< Dim > &direction_to_reconstruct, const ArgsForReconstructor &... args_for_reconstructor) |
In a given direction, reconstruct the cells in the neighboring Element (or cluster of cells) nearest to the shared boundary between the current and neighboring Element (or cluster of cells). More... | |
template<size_t Degree, size_t Dim> | |
void | unlimited (const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_upper_side_of_face_vars, const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_lower_side_of_face_vars, const gsl::span< const double > &volume_vars, const DirectionMap< Dim, gsl::span< const double > > &ghost_cell_vars, const Index< Dim > &volume_extents, const size_t number_of_variables) |
Performs unlimited reconstruction on the vars in each direction. More... | |
template<size_t NonlinearWeightExponent, class FallbackReconstructor , size_t Dim> | |
void | wcns5z (const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_upper_side_of_face_vars, const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_lower_side_of_face_vars, const gsl::span< const double > &volume_vars, const DirectionMap< Dim, gsl::span< const double > > &ghost_cell_vars, const Index< Dim > &volume_extents, const size_t number_of_variables, const double epsilon, const size_t max_number_of_extrema) |
Performs fifth order weighted compact nonlinear scheme reconstruction based on the WENO-Z method (WCNS-5Z). Adaptive fallback combined with an auxiliary reconstruction method (e.g. monotonised central) is also supported. More... | |
template<size_t Dim> | |
auto | wcns5z_function_pointers (size_t nonlinear_weight_exponent, FallbackReconstructorType fallback_recons) -> std::tuple< void(*)(gsl::not_null< std::array< gsl::span< double >, Dim > * >, gsl::not_null< std::array< gsl::span< double >, Dim > * >, const gsl::span< const double > &, const DirectionMap< Dim, gsl::span< const double > > &, const Index< Dim > &, size_t, double, size_t), void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const size_t &), void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const size_t &)> |
Returns function pointers to the wcns5z function, lower neighbor reconstruction, and upper neighbor reconstruction. | |
template<typename LowOrderReconstructor , bool PositivityPreserving, bool Use9thOrder, bool Use7thOrder, size_t Dim> | |
void | positivity_preserving_adaptive_order (const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_upper_side_of_face_vars, const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_lower_side_of_face_vars, const gsl::span< const double > &volume_vars, const DirectionMap< Dim, gsl::span< const double > > &ghost_cell_vars, const Index< Dim > &volume_extents, const size_t number_of_variables, const double four_to_the_alpha_5, const double six_to_the_alpha_7, const double eight_to_the_alpha_9) |
Performs positivity-preserving adaptive-order FD reconstruction. More... | |
template<typename LowOrderReconstructor , bool PositivityPreserving, bool Use9thOrder, bool Use7thOrder, size_t Dim> | |
void | positivity_preserving_adaptive_order (const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_upper_side_of_face_vars, const gsl::not_null< std::array< gsl::span< double >, Dim > * > reconstructed_lower_side_of_face_vars, const gsl::not_null< std::optional< std::array< gsl::span< std::uint8_t >, Dim > > * > reconstruction_order, const gsl::span< const double > &volume_vars, const DirectionMap< Dim, gsl::span< const double > > &ghost_cell_vars, const Index< Dim > &volume_extents, const size_t number_of_variables, const double four_to_the_alpha_5, const double six_to_the_alpha_7, const double eight_to_the_alpha_9) |
Performs positivity-preserving adaptive-order FD reconstruction. More... | |
Variable and flux vector splitting reconstruction schemes for finite difference methods.
Implementations of reconstruction methods must call the function fd::reconstruction::detail::reconstruct
to perform the reconstruction. This function performs the actual loops taking into account strides and ghost zones for the reconstruction method. The reconstruct
function has the following signature:
The type of reconstruction done is specified with the Reconstructor
explicit template parameter. Parameters for the reconstruction scheme, such as the linear weights and the epsilon tolerance in a CWENO reconstruction scheme, are forwarded along using the args_for_reconstruction
parameter pack.
Reconstructor
classes must define:
static constexpr size_t stencil_width()
function that returns the size of the stencil, e.g. 3 for minmod, and 5 for 5-point reconstruction.u
are the cell-centered values to reconstruct. The value \(u_i\) in the current FD cell is located at u[0]
, the value at neighbor cell \(u_{i+1}\) is at u[stride]
, and the value at neighbor cell \(u_{i-1}\) is at u[-stride]
. The returned values are the reconstructed solution on the lower and upper side of the cell.stride
parameter in the reconstruction schemes to make testing performance easier in the future.Here is an ASCII illustration of the names of various quantities and where in the cells they are:
Notice that the reconstructed_upper_side_of_face_vars
are actually on the lower side of the cells, while the reconstructed_lower_side_of_face_vars
are on the upper side of the cells. The upper
and lower
here refers to which side of the interface the quantity is on, not from the perspective of each cells.
auto fd::reconstruction::aoweno_53_function_pointers | ( | size_t | nonlinear_weight_exponent | ) | -> std::tuple< void(*)(gsl::not_null< std::array< gsl::span< double >, Dim > * >, gsl::not_null< std::array< gsl::span< double >, Dim > * >, const gsl::span< const double > &, const DirectionMap< Dim, gsl::span< const double > > &, const Index< Dim > &, size_t, double, double, double), void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const double &, const double &), void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const double &, const double &)> |
Returns function pointers to the aoweno_53
function, lower neighbor reconstruction, and upper neighbor reconstruction.
This is useful for controlling template parameters like the NonlinearWeightExponent
from an input file by setting a function pointer. Note that the reason the reconstruction functions instead of say the pointwise
member function is returned is to avoid function pointers inside tight loops.