Class Mesh2DGrid::XView
Defined in File Mesh2DGrid.hpp
Nested Relationships
This class is a nested type of Class Mesh2DGrid.
Class Documentation
-
class XView
Read-only view of the x coordinates of the mesh points.
Either a plain view of an (Nx, Ny) row-major array, or a lazy linear interpolation between two (Nx, Ny) planes read through arbitrary strides – e.g. two adjacent z planes of a Mesh3DInterpolator’s own (Nx, Ny, Nz) x array – evaluated afresh on every access. The latter lets a Mesh2DGrid represent a slice of a 3D mesh at an arbitrary z without ever storing that slice’s own x values; see the Mesh2DGrid constructor taking an XView.
Public Functions
-
XView() = default
-
inline XView(std::span<const double> data, const size_t nx, const size_t ny)
Construct a plain view of a row-major array.
- Parameters:
data – The (Nx, Ny) row-major array
nx – Number of points in the x direction
ny – Number of points in the y direction
-
inline XView(std::span<const double> p0, std::span<const double> p1, const size_t strideI, const size_t strideJ, const size_t nx, const size_t ny, const double t)
Construct a lazy linear interpolation between two strided planes.
- Parameters:
p0 – Storage holding the first plane
p1 – Storage holding the second plane, laid out identically to p0
strideI – Distance, in elements, between points adjacent in the x direction
strideJ – Distance, in elements, between points adjacent in the y direction
nx – Number of points in the x direction
ny – Number of points in the y direction
t – Interpolation weight: element (i,j) is p0(i,j) + t * (p1(i,j) - p0(i,j))
-
inline auto operator[](const size_t i, const size_t j) const -> double
Return the x coordinate of mesh point (i,j)
- Parameters:
i – Index in the x direction
j – Index in the y direction
- Returns:
The x coordinate
-
inline auto extent(const size_t r) const -> size_t
Return the number of points in one direction.
- Parameters:
r – 0 for the x direction, 1 for the y direction
- Returns:
The number of points
-
inline auto size() const -> size_t
Return the total number of points.
- Returns:
Nx * Ny
-
inline auto lazy() const -> bool
Return whether this is a lazy interpolation between two planes.
- Returns:
True if lazy, false if a plain view
-
XView() = default