num::structured_grid_graph¶
Defined in header <structures/graph/structured_grid.hpp>
template <std::size_t D, typename Weight = double, std::integral Index = num::idx>
class structured_grid_graph;
An allocation-free graph view of a uniform D-dimensional Cartesian grid.
Vertices are cells, with axis 0 varying fastest. Edge weights are face transmissibilities A/h, so a finite-volume diffusion jump rate is diffusivity * edge.weight / source_volume. Reflecting boundaries omit the exterior edge; periodic boundaries wrap to the opposite cell.
Members¶
| member | description |
|---|---|
using weight_type = Weight |
|
using index_type = Index |
|
using coordinate_type = std::array<Index, D> |
|
explicit structured_grid_graph( coordinate_type dimensions, std::array<Weight, D> spacing = unit_spacing(), std::array<grid_boundary, D> boundaries = reflecting_boundaries()) |
|
static constexpr std::array<Weight, D> unit_spacing() |
|
static constexpr std::array<grid_boundary, D> reflecting_boundaries() |
|
Index n_vertices() const noexcept |
|
Index n_edges() const noexcept |
|
bool is_directed() const noexcept |
|
const coordinate_type &dimensions() const noexcept |
|
const std::array<Weight, D> &spacing() const noexcept |
|
const std::array<grid_boundary, D> &boundaries() const noexcept |
|
Weight cell_volume() const noexcept |
|
coordinate_type coordinate(Index vertex) const |
|
Index vertex(const coordinate_type &coordinate) const |
|
Index degree(Index vertex_index) const |
|
Weight weighted_degree(Index vertex_index) const |
|
neighbor_range neighbors(Index vertex_index) const |