Loading...
Searching...
No Matches
types.h
// Copyright (C) 2023-2025 Garth N. Wells and Paul T. Kühner
//
// This file is part of DOLFINx (https://www.fenicsproject.org)
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once
#include <basix/mdspan.hpp>
#include <complex>
#include <concepts>
#include <type_traits>
namespace dolfinx
{
template <class T>
concept scalar = std::floating_point<T>
|| std::is_same_v<T, std::complex<typename T::value_type>>;
template <scalar T, typename = void>
struct scalar_value
{
typedef T type;
};
template <scalar T>
struct scalar_value<T, std::void_t<typename T::value_type>>
{
typedef typename T::value_type type;
};
template <scalar T>
using scalar_value_t = typename scalar_value<T>::type;
namespace md = MDSPAN_IMPL_STANDARD_NAMESPACE;
} // namespace dolfinx
dolfinx::scalar
Definition types.h:20
dolfinx
Top-level namespace.
Definition defines.h:12