25#ifndef DESCRIPTOR_BASE_H
26#define DESCRIPTOR_BASE_H
34namespace descriptors {
36template <
typename FIELD>
37using is_data_field = std::integral_constant<bool, !is_tag_field<FIELD>::value>;
48template <
typename... FIELDS>
55 template <
template<
typename...>
class COLLECTION>
62 template <
template<
typename>
class COND>
67 template <
typename WANTED_FIELD>
82template <
unsigned... PARAMS>
84 template <
typename FIELD>
85 static constexpr std::size_t
size() {
86 return FIELD::template
size<PARAMS...>();
91template <
typename PARAMETERS,
typename... FIELDS>
99 template<
typename BASE>
114 template <
typename ...NESTED_FIELDS>
124 template <
typename FIELD =
void>
125 static constexpr std::size_t
size()
127 if constexpr (std::is_void_v<FIELD>) {
128 return (parameter_tuple_t::template size<FIELDS>() + ... + 0);
130 return parameter_tuple_t::template size<FIELD>();
132 __builtin_unreachable();
137template <
unsigned D,
typename... FIELDS>
140 static constexpr int d = D;
146template <
unsigned D,
unsigned Q,
typename... FIELDS>
152 static constexpr int d = D;
154 static constexpr int q = Q;
171template <
typename T,
typename DESCRIPTOR>
181template <
typename TYPE>
183 typename std::remove_reference_t<TYPE>::value_t,
184 typename std::remove_reference_t<TYPE>::descriptor_t
189template <
unsigned D,
typename... FIELDS>
194 static constexpr int d = D;
std::integral_constant< bool, !is_tag_field< FIELD >::value > is_data_field
std::is_base_of< DESCRIPTOR_TAG, FIELD > is_tag_field
Top level namespace for all of OpenLB.
Tuple of concretized field declarations.
std::conditional_t< meta::contains< typename meta::list_item_with_base_default_base< BASE, FIELDS... >::type, FIELDS... >(), typename meta::list_item_with_base_default_base< BASE, FIELDS... >::type, void > derivedField
Returns FIELD by provided BASE.
static constexpr std::size_t size()
Returns size of FIELD if given or of whole tuple if not.
static constexpr bool providesNested()
Returns whether WANTED_FIELD (last in NESTED_FIELDS) is provided by CONCRETE_FIELD_TUPLE.
PARAMETERS parameter_tuple_t
Tuple of abstract field declarations.
static constexpr bool provides()
Returns whether WANTED_FIELD is contained in FIELDS.
FIELD_TUPLE()=delete
Deleted constructor to enforce pure usage as type and prevent implicit narrowing conversions.
static constexpr std::size_t field_count
Number of fields.
COLLECTION< FIELDS... > decompose_into
typename meta::filter_t< COND, FIELDS... > ::template decompose_into< FIELD_TUPLE > filter
Returns FIELD_TUPLE with subset of FIELDS meeting COND.
static bool provides(std::type_index field)
Returns whether field is contained in FIELDS.
Base descriptor of a D-dimensional lattice with Q directions and a list of additional fields.
TYPE_LATTICE type
Type identifier.
meta::filter_t< is_tag_field, FIELDS... > tags_t
typename tags_t::template first_with_base_or_fallback< tag::CATEGORY, tag::DEFAULT > category_tag
Tag that describes the category of the descriptor.
static constexpr int q
Number of velocities.
static constexpr int d
Number of dimensions.
meta::filter_t< is_data_field, FIELDS... > fields_t
Tuple of parameters to concretize field declarations.
static constexpr std::size_t size()
Base descriptor of a particle system.
static constexpr int d
Number of dimensions.
TYPE_PARTICLE type
Type identifier.
Base descriptor of a d-dimensional system.
static constexpr int d
Number of dimensions.
Pair of base value and descriptor type.