SpECTRE
v2024.09.29
|
Holds the number of grid points, basis, and quadrature in each direction of the computational grid. More...
#include <Mesh.hpp>
Classes | |
struct | Basis |
struct | Extents |
struct | Quadrature |
Public Types | |
using | options = implementation defined |
Public Member Functions | |
Mesh (size_t isotropic_extents, Spectral::Basis basis, Spectral::Quadrature quadrature) | |
Construct a computational grid with the same number of collocation points in each dimension. More... | |
Mesh (const std::array< size_t, Dim > &extents, Spectral::Basis basis, Spectral::Quadrature quadrature) | |
Construct a computational grid where each dimension can have a different number of collocation points. More... | |
Mesh (const std::array< size_t, Dim > &extents, const std::array< Spectral::Basis, Dim > &bases, const std::array< Spectral::Quadrature, Dim > &quadratures) | |
Construct a computational grid where each dimension can have both a different number and placement of collocation points. More... | |
Index< Dim > | extents () const |
The number of grid points in each dimension of the grid. | |
size_t | extents (size_t d) const |
The number of grid points in dimension d of the grid (zero-indexed). | |
size_t | number_of_grid_points () const |
The total number of grid points in all dimensions. More... | |
size_t | storage_index (const Index< Dim > &index) const |
Returns the 1-dimensional index corresponding to the Dim dimensional index . More... | |
std::array< Spectral::Basis, Dim > | basis () const |
The basis chosen in each dimension of the grid. | |
Spectral::Basis | basis (size_t d) const |
The basis chosen in dimension d of the grid (zero-indexed). | |
std::array< Spectral::Quadrature, Dim > | quadrature () const |
The quadrature chosen in each dimension of the grid. | |
Spectral::Quadrature | quadrature (size_t d) const |
The quadrature chosen in dimension d of the grid (zero-indexed). | |
template<size_t N = Dim, Requires<(N > 0 and N==Dim)> = nullptr> | |
Mesh< Dim - 1 > | slice_away (size_t d) const |
Returns a Mesh with dimension d removed (zero-indexed). More... | |
template<typename... D, Requires<(sizeof...(D)<=Dim)> = nullptr> | |
Mesh< sizeof...(D)> | slice_through (D... d) const |
Returns a Mesh with the dimensions d , ... present (zero-indexed). More... | |
template<size_t SliceDim, Requires<(SliceDim<=Dim)> = nullptr> | |
Mesh< SliceDim > | slice_through (const std::array< size_t, SliceDim > &dims) const |
Returns a Mesh with the dimensions dims present (zero-indexed). More... | |
std::array< Mesh< 1 >, Dim > | slices () const |
Returns the Meshes representing 1D slices of this Mesh. More... | |
void | pup (PUP::er &p) |
Static Public Attributes | |
static constexpr size_t | dim = Dim |
static constexpr Options::String | help |
Friends | |
template<size_t LocalDim> | |
bool | operator== (const Mesh< LocalDim > &lhs, const Mesh< LocalDim > &rhs) |
Holds the number of grid points, basis, and quadrature in each direction of the computational grid.
A mesh encapsulates all information necessary to construct the placement of grid points in the computational domain. It does so through a choice of basis functions, quadrature and number of points
A simulated physical field can be represented by a DataVector of length number_of_grid_points() that holds the field value on each point of the computational grid. These values are identical to the field's nodal expansion coefficients. They approximate the field by a polynomial of degree
Dim | the number of dimensions of the computational grid. |
Mesh< Dim >::Mesh | ( | size_t | isotropic_extents, |
Spectral::Basis | basis, | ||
Spectral::Quadrature | quadrature | ||
) |
Construct a computational grid with the same number of collocation points in each dimension.
isotropic_extents | The number of collocation points in each dimension. |
basis | The choice of spectral basis to compute the collocation points |
quadrature | The choice of quadrature to compute the collocation points |
Mesh<0>
extends over no dimensions, it has 1 grid point independent of the value of isotropic_extents
. Mesh< Dim >::Mesh | ( | const std::array< size_t, Dim > & | extents, |
Spectral::Basis | basis, | ||
Spectral::Quadrature | quadrature | ||
) |
Construct a computational grid where each dimension can have a different number of collocation points.
extents | The number of collocation points per dimension |
basis | The choice of spectral basis to compute the collocation points |
quadrature | The choice of quadrature to compute the collocation points |
Mesh< Dim >::Mesh | ( | const std::array< size_t, Dim > & | extents, |
const std::array< Spectral::Basis, Dim > & | bases, | ||
const std::array< Spectral::Quadrature, Dim > & | quadratures | ||
) |
Construct a computational grid where each dimension can have both a different number and placement of collocation points.
extents | The number of collocation points per dimension |
bases | The choice of spectral bases to compute the collocation points per dimension |
quadratures | The choice of quadratures to compute the collocation points per dimension |
size_t Mesh< Dim >::number_of_grid_points | ( | ) | const |
The total number of grid points in all dimensions.
DataVector
s that represent field values on the grid have this many entries.
Mesh< Dim - 1 > Mesh< Dim >::slice_away | ( | size_t | d | ) | const |
Returns a Mesh with dimension d
removed (zero-indexed).
Mesh< SliceDim > Mesh< Dim >::slice_through | ( | const std::array< size_t, SliceDim > & | dims | ) | const |
Returns a Mesh with the dimensions dims
present (zero-indexed).
|
inline |
Returns a Mesh with the dimensions d
, ... present (zero-indexed).
Generally you use this method to obtain a lower-dimensional Mesh by slicing through a subset of the dimensions. However, you can also reorder dimensions using this method by slicing through the dimensions in an order you choose.
std::array< Mesh< 1 >, Dim > Mesh< Dim >::slices | ( | ) | const |
Returns the Meshes representing 1D slices of this Mesh.
The is the same as the array filled with slice_through(d)
for d
from 0
to Dim - 1
except in dimension 0 where slice_through(d)
is not defined.
Returns the 1-dimensional index corresponding to the Dim
dimensional index
.
The first dimension varies fastest.
|
staticconstexpr |