DOLFINx
DOLFINx C++
Toggle main menu visibility
Loading...
Searching...
No Matches
dolfinx
common
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
14
namespace
dolfinx
15
{
19
20
template
<
class
T>
21
struct
is_custom_scalar : std::false_type
22
{
23
};
24
25
template
<
class
T>
26
concept
scalar
= std::floating_point<T>
27
|| std::is_same_v<T, std::complex<typename T::value_type>>
28
|| is_custom_scalar<T>::value;
29
32
template
<scalar T,
typename
=
void
>
33
struct
scalar_value
34
{
36
typedef
T type;
37
};
38
40
template
<scalar T>
41
struct
scalar_value<T, std::void_t<typename T::value_type>>
42
{
43
typedef
typename
T::value_type type;
44
};
45
47
template
<scalar T>
48
using
scalar_value_t =
typename
scalar_value<T>::type;
49
51
namespace
md = MDSPAN_IMPL_STANDARD_NAMESPACE;
52
53
}
// namespace dolfinx
dolfinx::scalar
Definition
types.h:26
dolfinx
Top-level namespace.
Definition
defines.h:12
Generated by
1.17.0