Go to the documentation of this file.
17 #include "Utilities/TypeTraits.hpp"
18 #include "Utilities/TypeTraits/IsInteger.hpp"
50 static constexpr
size_t dim = Dim;
55 "The number of collocation points per dimension"};
61 "The choice of spectral basis to compute the collocation points"};
67 "The choice of quadrature to compute the collocation points"};
70 using options = tmpl::list<Extents, Basis, Quadrature>;
73 "Holds the number of grid points, basis, and quadrature in each "
74 "direction of the computational grid. "
75 "A mesh encapsulates all information necessary to construct the "
76 "placement of grid points in the computational domain. It does so "
77 "through a choice of basis functions, quadrature and number of points "
80 Mesh() noexcept = default;
98 : extents_(isotropic_extents) {
115 : extents_(std::move(
extents)) {
132 : extents_(std::move(
extents)),
133 bases_(std::move(bases)),
134 quadratures_(std::move(quadratures)) {}
145 size_t extents(
const size_t d)
const noexcept {
return extents_[d]; }
195 return gsl::at(quadratures_, d);
204 template <
size_t N = Dim, Requires<(N > 0 and N == Dim)> =
nullptr>
217 template <
typename... D,
Requires<(
sizeof...(D) <= Dim)> =
nullptr>
220 "The dimensions must be integers.");
221 const std::array<size_t,
sizeof...(D)> dims{{
static_cast<size_t>(d)...}};
230 template <
size_t SliceDim, Requires<(SliceDim <= Dim)> =
nullptr>
231 Mesh<SliceDim> slice_through(
232 const std::array<
size_t, SliceDim>& dims) const noexcept;
241 std::array<Mesh<1>, Dim> slices() const noexcept;
244 void pup(PUP::er& p) noexcept;
247 Index<Dim> extents_{};
248 std::array<Spectral::Basis, Dim> bases_{};
249 std::array<Spectral::Quadrature, Dim> quadratures_{};
253 template <
size_t Dim>
256 template <
size_t Dim>
259 template <
size_t Dim>
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
Basis
The choice of basis functions for computing collocation points and weights.
Definition: Spectral.hpp:70
Mesh(std::array< size_t, Dim > extents, std::array< Spectral::Basis, Dim > bases, std::array< Spectral::Quadrature, Dim > quadratures) noexcept
Construct a computational grid where each dimension can have both a different number and placement of...
Definition: Mesh.hpp:130
const std::array< Spectral::Basis, Dim > & basis() const noexcept
The basis chosen in each dimension of the grid.
Definition: Mesh.hpp:173
Check if I is an integer type (non-bool, non-character), unlike std::is_integral.
Definition: IsInteger.hpp:33
size_t collapsed_index(const Index< N > &index, const Index< N > &extents) noexcept
Spectral::Basis basis(const size_t d) const noexcept
The basis chosen in dimension d of the grid (zero-indexed).
Definition: Mesh.hpp:180
size_t storage_index(const Index< Dim > &index) const noexcept
Returns the 1-dimensional index corresponding to the Dim dimensional index.
Definition: Mesh.hpp:166
size_t number_of_grid_points() const noexcept
The total number of grid points in all dimensions.
Definition: Mesh.hpp:156
Quadrature
The choice of quadrature method to compute integration weights.
Definition: Spectral.hpp:90
Mesh< sizeof...(D)> slice_through(D... d) const noexcept
Returns a Mesh with the dimensions d, ... present (zero-indexed).
Definition: Mesh.hpp:218
Holds the number of grid points, basis, and quadrature in each direction of the computational grid.
Definition: Mesh.hpp:48
const char *const String
The string used in option structs.
Definition: Options.hpp:32
Spectral::Quadrature quadrature(const size_t d) const noexcept
The quadrature chosen in dimension d of the grid (zero-indexed).
Definition: Mesh.hpp:194
size_t extents(const size_t d) const noexcept
The number of grid points in dimension d of the grid (zero-indexed).
Definition: Mesh.hpp:145
const std::array< Spectral::Quadrature, Dim > & quadrature() const noexcept
The quadrature chosen in each dimension of the grid.
Definition: Mesh.hpp:187
typename Requires_detail::requires_impl< B >::template_error_type_failed_to_meet_requirements_on_template_parameters Requires
Express requirements on the template parameters of a function or class, replaces std::enable_if_t
Definition: Requires.hpp:67
Mesh< Dim - 1 > slice_away(size_t d) const noexcept
Returns a Mesh with dimension d removed (zero-indexed).
const Index< Dim > & extents() const noexcept
The number of grid points in each dimension of the grid.
Definition: Mesh.hpp:139
Mesh(std::array< size_t, Dim > extents, const Spectral::Basis basis, const Spectral::Quadrature quadrature) noexcept
Construct a computational grid where each dimension can have a different number of collocation points...
Definition: Mesh.hpp:113
Functionality associated with a particular choice of basis functions and quadrature for spectral oper...
Definition: ComplexDataView.hpp:13