Class Mesh2DGrid::SView

Nested Relationships

This class is a nested type of Class Mesh2DGrid.

Class Documentation

class SView

Read-only view of the cumulative lengths along the mesh spines.

Element (i,j) is the length along spine i from (i,0) to (i,j). Either a plain view of stored (Nx, Ny) values, or computed on each access from an XView and the y coordinates – in O(j) time, accumulating segment by segment in exactly the same order computeSlopesAndLengths() does, so that the result is identical to the stored value.

Public Functions

SView() = default
inline SView(std::span<const double> data, const size_t ny)

Construct a plain view of stored lengths.

Parameters:
  • data – The (Nx, Ny) row-major array of lengths

  • ny – Number of points in the y direction

inline SView(const XView &x, std::span<const double> y)

Construct a view computing lengths on demand.

Parameters:
  • x – The x coordinates of the mesh points

  • y – The y coordinates of the mesh points

inline auto operator[](const size_t i, const size_t j) const -> double

Return the cumulative length along spine i up to point j.

Parameters:
  • i – Index in the x direction

  • j – Index in the y direction

Returns:

The length