DOLFINx 0.12.0.0
DOLFINx C++
Loading...
Searching...
No Matches
traits.h
1// Copyright (C) 2024 Joseph P. Dean and Garth N. Wells
2// This file is part of DOLFINx (https://www.fenicsproject.org)
3//
4// SPDX-License-Identifier: LGPL-3.0-or-later
5
6#pragma once
7
8#include <basix/mdspan.hpp>
9#include <concepts>
10#include <cstdint>
11#include <dolfinx/common/types.h>
12#include <span>
13#include <tuple>
14#include <type_traits>
15
16namespace dolfinx::fem
17{
19template <class U, class T>
21 = std::is_invocable_v<U, std::span<T>, std::span<const std::uint32_t>,
22 std::int32_t, int>;
23
28template <class U, class T, class G = dolfinx::scalar_value_t<T>>
29concept FEkernel = std::is_invocable_v<U, T*, const T*, const T*, const G*,
30 const int*, const std::uint8_t*, void*>;
31
33template <class T>
34concept MDSpan2
35 = std::is_convertible_v<
36 std::remove_cvref_t<T>,
37 md::mdspan<const std::int32_t, md::dextents<std::size_t, 2>>>
38 or std::is_convertible_v<
39 std::remove_cvref_t<T>,
40 md::mdspan<const std::int32_t, md::dextents<std::size_t, 1>>>;
41
50template <class T>
51concept DofMapPackBase = requires(const std::remove_cvref_t<T>& t) {
52 requires std::tuple_size_v<std::remove_cvref_t<T>> == 3;
53 requires std::is_convertible_v<
54 std::remove_cvref_t<decltype(std::get<0>(t))>,
55 md::mdspan<const std::int32_t, md::dextents<std::size_t, 2>>>;
56 { std::get<1>(t) } -> std::convertible_to<int>;
57};
59
63template <class T>
65 = DofMapPackBase<T> and requires(const std::remove_cvref_t<T>& t) {
66 { std::get<2>(t)[0] } -> std::convertible_to<std::int32_t>;
67 };
68
72template <class T>
74 = DofMapPackBase<T> and requires(const std::remove_cvref_t<T>& t) {
75 { std::get<2>(t)(0, 0) } -> std::convertible_to<std::int32_t>;
76 };
77
81template <class T>
83 = DofMapPackBase<T> and requires(const std::remove_cvref_t<T>& t) {
84 { std::get<2>(t)(0, 0, 0) } -> std::convertible_to<std::int32_t>;
85 };
86} // namespace dolfinx::fem
Concept for the degree-of-freedom map data passed to the cell assembly kernel, whose (2) entry is a f...
Definition traits.h:65
Concept for the degree-of-freedom map data passed to the entity assembly kernel, whose (2) entry is i...
Definition traits.h:74
Concept for the degree-of-freedom map data passed to the interior facet assembly kernel,...
Definition traits.h:83
DOF transform kernel concept.
Definition traits.h:21
Finite element cell kernel concept.
Definition traits.h:29
Concept for mdspan of rank 1 or 2.
Definition traits.h:35
Finite element method functionality.
Definition assemble_expression_impl.h:23