make_array_view(const Iterator begin, const Iterator end)
{
static_assert(
- std::is_same<typename std::iterator_traits<Iterator>::iterator_category,
- typename std::random_access_iterator_tag>::value
+ std::is_same_v<typename std::iterator_traits<Iterator>::iterator_category,
+ typename std::random_access_iterator_tag>
#ifdef DEAL_II_HAVE_CXX20
||
- std::is_same<typename std::iterator_traits<Iterator>::iterator_category,
- typename std::contiguous_iterator_tag>::value
+ std::is_same_v<typename std::iterator_traits<Iterator>::iterator_category,
+ typename std::contiguous_iterator_tag>
#endif
,
"The provided iterator needs to be a random access iterator.");
*/
template <typename Container>
std::enable_if_t<
- std::is_same<Container,
- std::vector<typename Container::value_type>>::value,
+ std::is_same_v<Container, std::vector<typename Container::value_type>>,
Container>
initialize_container(const std::vector<hsize_t> &dimensions);
*/
template <typename Container>
std::enable_if_t<
- std::is_same<Container,
- FullMatrix<typename Container::value_type>>::value,
+ std::is_same_v<Container, FullMatrix<typename Container::value_type>>,
Container>
initialize_container(const std::vector<hsize_t> &dimensions);
template <typename Container>
std::enable_if_t<
- std::is_same<Container,
- std::vector<typename Container::value_type>>::value,
+ std::is_same_v<Container, std::vector<typename Container::value_type>>,
Container>
initialize_container(const std::vector<hsize_t> &dimensions)
{
template <typename Container>
std::enable_if_t<
- std::is_same<Container,
- FullMatrix<typename Container::value_type>>::value,
+ std::is_same_v<Container, FullMatrix<typename Container::value_type>>,
Container>
initialize_container(const std::vector<hsize_t> &dimensions)
{
void
sum(const T &values, const MPI_Comm mpi_communicator, U &sums)
{
- static_assert(std::is_same<typename std::decay<T>::type,
- typename std::decay<U>::type>::value,
+ static_assert(std::is_same_v<typename std::decay<T>::type,
+ typename std::decay<U>::type>,
"Input and output arguments must have the same type!");
const auto array_view_values = make_array_view(values);
using const_type =
void
max(const T &values, const MPI_Comm mpi_communicator, U &maxima)
{
- static_assert(std::is_same<typename std::decay<T>::type,
- typename std::decay<U>::type>::value,
+ static_assert(std::is_same_v<typename std::decay<T>::type,
+ typename std::decay<U>::type>,
"Input and output arguments must have the same type!");
const auto array_view_values = make_array_view(values);
using const_type =
void
min(const T &values, const MPI_Comm mpi_communicator, U &minima)
{
- static_assert(std::is_same<typename std::decay<T>::type,
- typename std::decay<U>::type>::value,
+ static_assert(std::is_same_v<typename std::decay<T>::type,
+ typename std::decay<U>::type>,
"Input and output arguments must have the same type!");
const auto array_view_values = make_array_view(values);
using const_type =
void
logical_or(const T &values, const MPI_Comm mpi_communicator, U &results)
{
- static_assert(std::is_same<typename std::decay<T>::type,
- typename std::decay<U>::type>::value,
+ static_assert(std::is_same_v<typename std::decay<T>::type,
+ typename std::decay<U>::type>,
"Input and output arguments must have the same type!");
static_assert(std::is_integral<typename T::value_type>::value,
template <typename F>
static constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE T
value(const F &f,
- std::enable_if_t<!std::is_same<typename std::decay<T>::type,
- typename std::decay<F>::type>::value &&
+ std::enable_if_t<!std::is_same_v<typename std::decay<T>::type,
+ typename std::decay<F>::type> &&
std::is_constructible<T, F>::value> * = nullptr)
{
return T(f);
template <typename F>
static constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE T
value(const F &f,
- std::enable_if_t<!std::is_same<typename std::decay<T>::type,
- typename std::decay<F>::type>::value &&
+ std::enable_if_t<!std::is_same_v<typename std::decay<T>::type,
+ typename std::decay<F>::type> &&
!std::is_constructible<T, F>::value &&
is_explicitly_convertible<const F, T>::value> * =
nullptr)
static T
value(
const F &f,
- std::enable_if_t<!std::is_same<typename std::decay<T>::type,
- typename std::decay<F>::type>::value &&
+ std::enable_if_t<!std::is_same_v<typename std::decay<T>::type,
+ typename std::decay<F>::type> &&
!std::is_constructible<T, F>::value &&
!is_explicitly_convertible<const F, T>::value &&
Differentiation::AD::is_ad_number<F>::value> * = nullptr)
for (unsigned int i = 0; i < n_import_targets; ++i)
{
# if defined(DEAL_II_MPI_WITH_DEVICE_SUPPORT)
- if constexpr (std::is_same<MemorySpaceType,
- MemorySpace::Default>::value)
+ if constexpr (std::is_same_v<MemorySpaceType, MemorySpace::Default>)
{
const auto chunk_size = import_indices_plain_dev[i].size();
using IndexType = decltype(chunk_size);
{
const unsigned int chunk_size =
ghost_range.second - ghost_range.first;
- if constexpr (std::is_same<MemorySpaceType,
- MemorySpace::Host>::value)
+ if constexpr (std::is_same_v<MemorySpaceType,
+ MemorySpace::Host>)
{
// If source and destination are overlapping, we must be
// careful to use an appropriate copy function.
if (ghost_array_ptr + offset !=
ghost_array.data() + my_ghosts->first)
{
- if constexpr (std::is_same<MemorySpaceType,
- MemorySpace::Host>::value)
+ if constexpr (std::is_same_v<MemorySpaceType,
+ MemorySpace::Host>)
{
if (offset > my_ghosts->first)
std::copy_backward(ghost_array.data() +
const Number *read_position = temporary_storage.data();
# if defined(DEAL_II_MPI_WITH_DEVICE_SUPPORT)
- if constexpr (std::is_same<MemorySpaceType,
- MemorySpace::Default>::value)
+ if constexpr (std::is_same_v<MemorySpaceType, MemorySpace::Default>)
{
if (vector_operation == VectorOperation::add)
{
Assert(ghost_array.begin() != nullptr, ExcInternalError());
# if defined(DEAL_II_MPI_WITH_DEVICE_SUPPORT)
- if constexpr (std::is_same<MemorySpaceType,
- MemorySpace::Default>::value)
+ if constexpr (std::is_same_v<MemorySpaceType, MemorySpace::Default>)
{
Kokkos::deep_copy(
Kokkos::View<Number *, MemorySpace::Default::kokkos_space>(
make_vectorized_array(const typename VectorizedArrayType::value_type &u)
{
static_assert(
- std::is_same<VectorizedArrayType,
- VectorizedArray<typename VectorizedArrayType::value_type,
- VectorizedArrayType::size()>>::value,
+ std::is_same_v<VectorizedArrayType,
+ VectorizedArray<typename VectorizedArrayType::value_type,
+ VectorizedArrayType::size()>>,
"VectorizedArrayType is not a VectorizedArray.");
VectorizedArrayType result = u;
template <typename SacadoNumber>
struct SacadoNumberInfo<
SacadoNumber,
- std::enable_if_t<std::is_same<
- SacadoNumber,
- Sacado::Fad::DFad<typename SacadoNumber::value_type>>::value>>
+ std::enable_if_t<
+ std::is_same_v<SacadoNumber,
+ Sacado::Fad::DFad<typename SacadoNumber::value_type>>>>
{
using ad_type = SacadoNumber;
using scalar_type = typename ad_type::scalar_type;
template <typename SacadoNumber>
struct SacadoNumberInfo<
SacadoNumber,
- std::enable_if_t<std::is_same<
+ std::enable_if_t<std::is_same_v<
SacadoNumber,
- Sacado::Rad::ADvar<typename SacadoNumber::value_type>>::value>>
+ Sacado::Rad::ADvar<typename SacadoNumber::value_type>>>>
{
using ad_type = SacadoNumber;
using scalar_type = typename ad_type::ADVari::scalar_type;
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- std::enable_if_t<std::is_same<
- ADNumberType,
- Sacado::Fad::DFad<typename ADNumberType::scalar_type>>::value>>
+ std::enable_if_t<
+ std::is_same_v<ADNumberType,
+ Sacado::Fad::DFad<typename ADNumberType::scalar_type>>>>
: NumberTraits<typename ADNumberType::scalar_type,
NumberTypes::sacado_dfad>
{};
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- std::enable_if_t<std::is_same<
- ADNumberType,
- std::complex<Sacado::Fad::DFad<
- typename ADNumberType::value_type::scalar_type>>>::value>>
+ std::enable_if_t<
+ std::is_same_v<ADNumberType,
+ std::complex<Sacado::Fad::DFad<
+ typename ADNumberType::value_type::scalar_type>>>>>
: NumberTraits<
std::complex<typename ADNumberType::value_type::scalar_type>,
NumberTypes::sacado_dfad>
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- std::enable_if_t<std::is_same<
+ std::enable_if_t<std::is_same_v<
ADNumberType,
- Sacado::Rad::ADvar<typename ADNumberType::ADVari::scalar_type>>::value>>
+ Sacado::Rad::ADvar<typename ADNumberType::ADVari::scalar_type>>>>
: NumberTraits<typename ADNumberType::ADVari::scalar_type,
NumberTypes::sacado_rad>
{};
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- std::enable_if_t<std::is_same<
+ std::enable_if_t<std::is_same_v<
ADNumberType,
std::complex<Sacado::Rad::ADvar<
- typename ADNumberType::value_type::ADVari::scalar_type>>>::value>>
+ typename ADNumberType::value_type::ADVari::scalar_type>>>>>
: NumberTraits<
std::complex<typename ADNumberType::value_type::ADVari::scalar_type>,
NumberTypes::sacado_rad>
* a floating point type.
*/
template <typename ADNumberType>
- struct ADNumberTraits<ADNumberType,
- std::enable_if_t<std::is_same<
- ADNumberType,
- Sacado::Fad::DFad<Sacado::Fad::DFad<
- typename ADNumberType::scalar_type>>>::value>>
+ struct ADNumberTraits<
+ ADNumberType,
+ std::enable_if_t<std::is_same_v<ADNumberType,
+ Sacado::Fad::DFad<Sacado::Fad::DFad<
+ typename ADNumberType::scalar_type>>>>>
: NumberTraits<typename ADNumberType::scalar_type,
NumberTypes::sacado_dfad_dfad>
{};
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- std::enable_if_t<std::is_same<
- ADNumberType,
- std::complex<Sacado::Fad::DFad<Sacado::Fad::DFad<
- typename ADNumberType::value_type::scalar_type>>>>::value>>
+ std::enable_if_t<
+ std::is_same_v<ADNumberType,
+ std::complex<Sacado::Fad::DFad<Sacado::Fad::DFad<
+ typename ADNumberType::value_type::scalar_type>>>>>>
: NumberTraits<
std::complex<typename ADNumberType::value_type::scalar_type>,
NumberTypes::sacado_dfad_dfad>
* a floating point type.
*/
template <typename ADNumberType>
- struct ADNumberTraits<
- ADNumberType,
- std::enable_if_t<
- std::is_same<ADNumberType,
- Sacado::Rad::ADvar<Sacado::Fad::DFad<
- typename ADNumberType::ADVari::scalar_type>>>::value>>
+ struct ADNumberTraits<ADNumberType,
+ std::enable_if_t<std::is_same_v<
+ ADNumberType,
+ Sacado::Rad::ADvar<Sacado::Fad::DFad<
+ typename ADNumberType::ADVari::scalar_type>>>>>
: NumberTraits<typename ADNumberType::ADVari::scalar_type,
NumberTypes::sacado_rad_dfad>
{};
template <typename ADNumberType>
struct ADNumberTraits<
ADNumberType,
- std::enable_if_t<std::is_same<
+ std::enable_if_t<std::is_same_v<
ADNumberType,
std::complex<Sacado::Rad::ADvar<Sacado::Fad::DFad<
- typename ADNumberType::value_type::ADVari::scalar_type>>>>::value>>
+ typename ADNumberType::value_type::ADVari::scalar_type>>>>>>
: NumberTraits<
std::complex<typename ADNumberType::value_type::ADVari::scalar_type>,
NumberTypes::sacado_rad_dfad>
template <typename NumberType>
struct is_sacado_dfad_number<
NumberType,
- std::enable_if_t<std::is_same<
- NumberType,
- Sacado::Fad::Expr<typename NumberType::value_type>>::value>>
+ std::enable_if_t<
+ std::is_same_v<NumberType,
+ Sacado::Fad::Expr<typename NumberType::value_type>>>>
: std::true_type
{};
struct is_sacado_rad_number<
NumberType,
std::enable_if_t<
- std::is_same<NumberType,
- Sacado::Rad::ADvari<Sacado::Fad::DFad<
- typename NumberType::ADVari::scalar_type>>>::value>>
+ std::is_same_v<NumberType,
+ Sacado::Rad::ADvari<Sacado::Fad::DFad<
+ typename NumberType::ADVari::scalar_type>>>>>
: std::true_type
{};
out[indices_out] *= 0.5;
// TODO: Implement for SymmetricTensor<4,dim,...>
- if (std::is_same<TensorType_1<rank_1, dim, ValueType>,
- SymmetricTensor<2, dim, ValueType>>::
- value) // Symmetric function
+ if (std::is_same_v<
+ TensorType_1<rank_1, dim, ValueType>,
+ SymmetricTensor<2, dim, ValueType>>) // Symmetric function
{
const TableIndices<rank_1 + rank_2> indices_out_t =
concatenate_indices(transpose_indices(indices_i),
indices_j);
out[indices_out_t] = out[indices_out];
}
- else if (std::is_same<TensorType_2<rank_2, dim, ValueType>,
- SymmetricTensor<2, dim, ValueType>>::
- value) // Symmetric operator
+ else if (std::is_same_v<
+ TensorType_2<rank_2, dim, ValueType>,
+ SymmetricTensor<2, dim, ValueType>>) // Symmetric
+ // operator
{
const TableIndices<rank_1 + rank_2> indices_out_t =
concatenate_indices(indices_i,
template <
class... FEPairs,
typename = enable_if_all_t<
- (std::is_same<typename std::decay<FEPairs>::type,
- std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
- unsigned int>>::value ||
+ (std::is_same_v<typename std::decay<FEPairs>::type,
+ std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
+ unsigned int>> ||
std::is_base_of_v<FiniteElement<dim, spacedim>,
typename std::decay<FEPairs>::type>)...>>
FESystem(FEPairs &&...fe_pairs);
* types).
*/
static const bool value =
- std::is_same<decltype(check(std::declval<MatrixType *>())),
- std::true_type>::value;
+ std::is_same_v<decltype(check(std::declval<MatrixType *>())),
+ std::true_type>;
};
// instantiation of the static member
if (partitioner->n_import_indices() > 0)
{
# if !defined(DEAL_II_MPI_WITH_DEVICE_SUPPORT)
- if (std::is_same<MemorySpaceType,
- dealii::MemorySpace::Default>::value)
+ if (std::is_same_v<MemorySpaceType, dealii::MemorySpace::Default>)
{
if (import_data.values_host_buffer.size() == 0)
Kokkos::resize(import_data.values_host_buffer,
typename =
std::enable_if_t<!std::is_lvalue_reference<OperatorExemplar>::value>,
typename = std::enable_if_t<
- !std::is_same<OperatorExemplar,
- LinearOperator<Range, Domain, Payload>>::value>>
+ !std::is_same_v<OperatorExemplar, LinearOperator<Range, Domain, Payload>>>>
LinearOperator<Range, Domain, Payload>
linear_operator(OperatorExemplar &&, const Matrix &) = delete;
typename =
std::enable_if_t<!std::is_lvalue_reference<OperatorExemplar>::value>,
typename = std::enable_if_t<
- !std::is_same<OperatorExemplar,
- LinearOperator<Range, Domain, Payload>>::value>>
+ !std::is_same_v<OperatorExemplar, LinearOperator<Range, Domain, Payload>>>>
LinearOperator<Range, Domain, Payload>
linear_operator(OperatorExemplar &&, Matrix &&) = delete;
typename =
std::enable_if_t<!std::is_same_v<Preconditioner, PreconditionIdentity>>,
typename = std::enable_if_t<
- !std::is_same<Preconditioner,
- LinearOperator<Range, Domain, Payload>>::value>>
+ !std::is_same_v<Preconditioner, LinearOperator<Range, Domain, Payload>>>>
LinearOperator<Domain, Range, Payload>
inverse_operator(const LinearOperator<Range, Domain, Payload> &,
Solver &,
typename PreconditionerType>
constexpr bool has_vmult_with_std_functions =
is_supported_operation<vmult_functions_t, MatrixType, VectorType> &&
- std::is_same<PreconditionerType,
- dealii::DiagonalMatrix<VectorType>>::value &&
- (std::is_same<VectorType,
- dealii::Vector<typename VectorType::value_type>>::value ||
- std::is_same<
+ std::is_same_v<PreconditionerType, dealii::DiagonalMatrix<VectorType>> &&
+ (std::is_same_v<VectorType,
+ dealii::Vector<typename VectorType::value_type>> ||
+ std::is_same_v<
VectorType,
LinearAlgebra::distributed::Vector<typename VectorType::value_type,
- MemorySpace::Host>>::value);
+ MemorySpace::Host>>);
template <typename MatrixType, typename VectorType>
// We do not need the second temporary vector in case we have a
// DiagonalMatrix as preconditioner and use deal.II's own vectors
using NumberType = typename VectorType::value_type;
- if (std::is_same<PreconditionerType,
- dealii::DiagonalMatrix<VectorType>>::value == false ||
+ if (std::is_same_v<PreconditionerType, dealii::DiagonalMatrix<VectorType>> ==
+ false ||
(std::is_same_v<VectorType, dealii::Vector<NumberType>> == false &&
- ((std::is_same<VectorType,
- LinearAlgebra::distributed::
- Vector<NumberType, MemorySpace::Host>>::value ==
+ ((std::is_same_v<
+ VectorType,
+ LinearAlgebra::distributed::Vector<NumberType, MemorySpace::Host>> ==
false) ||
- (std::is_same<VectorType,
- LinearAlgebra::distributed::
- Vector<NumberType, MemorySpace::Default>>::value ==
- false))))
+ (std::is_same_v<VectorType,
+ LinearAlgebra::distributed::
+ Vector<NumberType, MemorySpace::Default>> == false))))
temp_vector2.reinit(src, true);
else
{
std::enable_if_t<has_vmult_functions<MatrixType, VectorType> &&
(has_apply_to_subrange<PreconditionerType> ||
has_apply<PreconditionerType>)&&std::
- is_same<VectorType,
- LinearAlgebra::distributed::Vector<
- typename VectorType::value_type,
- MemorySpace::Host>>::value,
+ is_same_v<VectorType,
+ LinearAlgebra::distributed::Vector<
+ typename VectorType::value_type,
+ MemorySpace::Host>>,
int>>
: public IterationWorkerBase<VectorType, MatrixType, PreconditionerType>
{
VectorType,
typename std::enable_if<!internal::is_block_vector<VectorType>>::type>
{
- static constexpr bool value = std::is_same<
+ static constexpr bool value = std::is_same_v<
VectorType,
LinearAlgebra::distributed::Vector<typename VectorType::value_type,
- MemorySpace::Host>>::value;
+ MemorySpace::Host>>;
};
VectorType,
typename std::enable_if<internal::is_block_vector<VectorType>>::type>
{
- static constexpr bool value = std::is_same<
+ static constexpr bool value = std::is_same_v<
typename VectorType::BlockType,
LinearAlgebra::distributed::Vector<typename VectorType::value_type,
- MemorySpace::Host>>::value;
+ MemorySpace::Host>>;
};
TrilinosBlockPayload(const Args &...)
{
static_assert(
- std::is_same<
+ std::is_same_v<
PayloadBlockType,
- internal::LinearOperatorImplementation::TrilinosPayload>::value,
+ internal::LinearOperatorImplementation::TrilinosPayload>,
"TrilinosBlockPayload can only accept a payload of type TrilinosPayload.");
}
};
// `OtherNumber` is either `const Number` (evaluate()) or `Number`
// (integrate())
static_assert(
- std::is_same<Number,
- typename std::remove_const<OtherNumber>::type>::value,
+ std::is_same_v<Number, typename std::remove_const<OtherNumber>::type>,
"Type of Number and of OtherNumber do not match.");
const auto element_type = fe_eval.get_shape_info().element_type;
*/
template <typename MatrixType,
typename Number,
- std::enable_if_t<std::is_same<
+ std::enable_if_t<std::is_same_v<
typename std::remove_const<typename std::remove_reference<
typename MatrixType::value_type>::type>::type,
typename std::remove_const<typename std::remove_reference<
- Number>::type>::type>::value> * = nullptr>
+ Number>::type>::type>> * = nullptr>
const AffineConstraints<typename MatrixType::value_type> &
create_new_affine_constraints_if_needed(
const MatrixType &,
*/
template <typename MatrixType,
typename Number,
- std::enable_if_t<!std::is_same<
+ std::enable_if_t<!std::is_same_v<
typename std::remove_const<typename std::remove_reference<
typename MatrixType::value_type>::type>::type,
typename std::remove_const<typename std::remove_reference<
- Number>::type>::type>::value> * = nullptr>
+ Number>::type>::type>> * = nullptr>
const AffineConstraints<typename MatrixType::value_type> &
create_new_affine_constraints_if_needed(
const MatrixType &,
*/
template <typename VectorType>
constexpr bool is_dealii_vector =
- std::is_same<VectorType,
- dealii::Vector<typename VectorType::value_type>>::value ||
- std::is_same<VectorType,
- dealii::BlockVector<typename VectorType::value_type>>::value ||
- std::is_same<VectorType,
- dealii::LinearAlgebra::distributed::Vector<
- typename VectorType::value_type>>::value ||
- std::is_same<VectorType,
- dealii::LinearAlgebra::distributed::BlockVector<
- typename VectorType::value_type>>::value;
+ std::is_same_v<VectorType,
+ dealii::Vector<typename VectorType::value_type>> ||
+ std::is_same_v<VectorType,
+ dealii::BlockVector<typename VectorType::value_type>> ||
+ std::is_same_v<VectorType,
+ dealii::LinearAlgebra::distributed::Vector<
+ typename VectorType::value_type>> ||
+ std::is_same_v<VectorType,
+ dealii::LinearAlgebra::distributed::BlockVector<
+ typename VectorType::value_type>>;
/**
* Helper functions that call set_ghost_state() if the vector supports this