DOLFINx
DOLFINx C++ interface
Loading...
Searching...
No Matches
types.h
1// Copyright (C) 2023-2025 Garth N. Wells and Paul T. Kühner
2//
3// This file is part of DOLFINx (https://www.fenicsproject.org)
4//
5// SPDX-License-Identifier: LGPL-3.0-or-later
6
7#pragma once
8
9#include <basix/mdspan.hpp>
10#include <complex>
11#include <concepts>
12#include <type_traits>
13
14namespace dolfinx
15{
19template <class T>
20concept scalar = std::floating_point<T>
21 || std::is_same_v<T, std::complex<typename T::value_type>>;
22
25template <scalar T, typename = void>
26struct scalar_value
27{
29 typedef T type;
30};
32template <scalar T>
33struct scalar_value<T, std::void_t<typename T::value_type>>
34{
35 typedef typename T::value_type type;
36};
38template <scalar T>
39using scalar_value_t = typename scalar_value<T>::type;
40
42namespace md = MDSPAN_IMPL_STANDARD_NAMESPACE;
43
44} // namespace dolfinx
Definition types.h:20
Top-level namespace.
Definition defines.h:12