GridFormat 0.2.1
I/O-Library for grid-like data structures
Loading...
Searching...
No Matches
concepts.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022-2023 Dennis Gläser <dennis.glaeser@iws.uni-stuttgart.de>
2// SPDX-License-Identifier: MIT
8#ifndef GRIDFORMAT_GRID_CONCEPTS_HPP_
9#define GRIDFORMAT_GRID_CONCEPTS_HPP_
10
11#include <concepts>
12
13#include <gridformat/common/type_traits.hpp>
14#include <gridformat/grid/type_traits.hpp>
15#include <gridformat/grid/_detail.hpp>
16#include <gridformat/grid/traits.hpp>
17
18namespace GridFormat::Concepts {
19
22
27template<typename T>
28concept EntitySet =
29 GridDetail::ExposesPointRange<T> and
30 GridDetail::ExposesCellRange<T>;
31
37template<typename T>
39 EntitySet<T> and
40 GridDetail::ExposesExtents<T> and
41 GridDetail::ExposesCellLocation<T> and
42 GridDetail::ExposesPointLocation<T> and
43 all_equal<
44 static_size<GridDetail::Extents<T>>,
45 static_size<GridDetail::CellLocation<T>>,
46 static_size<GridDetail::PointLocation<T>>
47 >;
48
52template<typename T>
53concept ImageGrid =
55 GridDetail::ExposesOrigin<T> and
56 GridDetail::ExposesSpacing<T> and
57 all_equal<
58 static_size<GridDetail::Origin<T>>,
59 static_size<GridDetail::Spacing<T>>
60 >;
61
65template<typename T>
68 GridDetail::ExposesOrdinates<T>;
69
73template<typename T>
76 GridDetail::ExposesPointCoordinates<T>;
77
81template<typename T>
83 EntitySet<T> and
84 GridDetail::ExposesPointCoordinates<T> and
85 GridDetail::ExposesPointId<T> and
86 GridDetail::ExposesCellType<T> and
87 GridDetail::ExposesCellPoints<T>;
88
92template<typename T>
94
98template<typename T, typename Grid>
100 = std::invocable<T, GridDetail::PointReference<Grid>>
101 and is_scalar<GridDetail::PointFunctionScalarType<Grid, T>>;
102
106template<typename T, typename Grid>
108 = std::invocable<T, GridDetail::CellReference<Grid>>
109 and is_scalar<GridDetail::CellFunctionScalarType<Grid, T>>;
110
112
113} // namespace GridFormat::Concepts
114
115#endif // GRIDFORMAT_GRID_CONCEPTS_HPP_
Concept for functions invocable with grid cells, usable as cell field data.
Definition: concepts.hpp:108
Basic concept all grids must fulfill. We must be able to iterate over a grid's cells & points.
Definition: concepts.hpp:28
Concept a type that fulfills any of the grid interfaces.
Definition: concepts.hpp:93
Concept for grids to be used as image grids.
Definition: concepts.hpp:53
Concept for functions invocable with grid points, usable as point field data.
Definition: concepts.hpp:100
Concept for grids to be used as rectilinear grids.
Definition: concepts.hpp:66
Basic concept for all grids with a structured topology. We need to know the extents of the grid and n...
Definition: concepts.hpp:38
Concept for grids to be used as structured grids.
Definition: concepts.hpp:74
Concept for grids to be used as unstructured grids.
Definition: concepts.hpp:82