Functions | Variables
fd::reconstruction Namespace Reference

Variable and flux vector splitting reconstruction schemes for finite difference methods. 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) noexcept
 Performs an adaptive order (AO) WENO reconstruction using a single 5th order stencil and a 3rd-order CWENO scheme. More...
 
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) noexcept
 Performs minmod reconstruction on the volume_vars in each direction. More...
 
template<size_t Dim>
void monotised_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) noexcept
 Performs monotised central-difference reconstruction on the vars in each direction. More...
 
template<Side LowerOrUpperSide, typename Reconstructor , 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) noexcept
 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...
 

Variables

template<size_t Dim>
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) noexcept, void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const double &, const double &) noexcept, void(*)(gsl::not_null< DataVector * >, const DataVector &, const DataVector &, const Index< Dim > &, const Index< Dim > &, const Direction< Dim > &, const double &, const double &, const double &) noexcept > aoweno_53_function_pointers (size_t nonlinear_weight_exponent) noexcept
 Returns function pointers to the aoweno_53 function, lower neighbor reconstruction, and upper neighbor reconstruction. More...
 

Detailed Description

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:

template <typename Reconstructor, typename... ArgsForReconstructor, size_t
Dim>
reconstructed_upper_side_of_face_vars,
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 ArgsForReconstructor&... args_for_reconstructor) noexcept;

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:

Note
Currently the stride is always one because we transpose the data before reconstruction. However, it may be faster to have a non-unit stride without the transpose. We have the 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:

reconstructed_upper_side_of_face_vars v
reconstructed_lower_side_of_face_vars v
volume_vars (at the cell-center) v
| x |
^ reconstructed_upper_side_of_face_vars
^ reconstructed_lower_side_of_face_vars

Notice that the reconstructed_upper_side_of_face_vars are on the lower side of the cell, while the reconstructed_lower_side_of_face_vars are on the upper side of the cell.

Variable Documentation

◆ aoweno_53_function_pointers

template<size_t Dim>
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) noexcept, void (*)(gsl::not_null<DataVector*>, const DataVector&, const DataVector&, const Index<Dim>&, const Index<Dim>&, const Direction<Dim>&, const double&, const double&, const double&) noexcept, void (*)(gsl::not_null<DataVector*>, const DataVector&, const DataVector&, const Index<Dim>&, const Index<Dim>&, const Direction<Dim>&, const double&, const double&, const double&) noexcept> fd::reconstruction::aoweno_53_function_pointers(size_t nonlinear_weight_exponent) noexcept
noexcept

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.

gsl::at
constexpr T & at(std::array< T, N > &arr, Size index)
Retrieve a entry from a container, with checks in Debug mode that the index being retrieved is valid.
Definition: Gsl.hpp:125
Index
Definition: Index.hpp:31
SPECTRE_ALWAYS_INLINE
#define SPECTRE_ALWAYS_INLINE
Definition: ForceInline.hpp:16
std::array
gsl::span
Create a span/view on a range, which is cheap to copy (one pointer).
Definition: Gsl.hpp:292
DirectionMap
Definition: DirectionMap.hpp:15
evolution::dg::subcell::fd::reconstruct
DataVector reconstruct(const DataVector &subcell_u_times_projected_det_jac, const Mesh< Dim > &dg_mesh, const Index< Dim > &subcell_extents) noexcept
reconstruct the variable subcell_u_times_projected_det_jac onto the DG grid dg_mesh.
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13