invert(const SymmetricTensor<4, dim, Number> &);
template <int dim2, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number
- trace(const SymmetricTensor<2, dim2, Number> &);
+constexpr inline DEAL_II_ALWAYS_INLINE Number
+ trace(const SymmetricTensor<2, dim2, Number> &);
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number>
- deviator(const SymmetricTensor<2, dim, Number> &);
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number>
+ deviator(const SymmetricTensor<2, dim, Number> &);
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number
- determinant(const SymmetricTensor<2, dim, Number> &);
+constexpr inline DEAL_II_ALWAYS_INLINE Number
+ determinant(const SymmetricTensor<2, dim, Number> &);
/**
* Index operator.
*/
- DEAL_II_CONSTEXPR Accessor<rank, dim, constness, P - 1, Number>
- operator[](const unsigned int i);
+ constexpr Accessor<rank, dim, constness, P - 1, Number>
+ operator[](const unsigned int i);
/**
* Index operator.
/**
* Index operator.
*/
- DEAL_II_CONSTEXPR reference operator[](const unsigned int);
+ constexpr reference operator[](const unsigned int);
/**
* Index operator.
* the object from the internal namespace is to work around bugs in some
* older compilers.
*/
- DEAL_II_CONSTEXPR
- SymmetricTensor(const Number (&array)[n_independent_components]);
+ constexpr SymmetricTensor(const Number (&array)[n_independent_components]);
/**
* Copy constructor from tensors with different underlying scalar type. This
* @p Number.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR SymmetricTensor &
- operator=(const SymmetricTensor<rank_, dim, OtherNumber> &rhs);
+ constexpr SymmetricTensor &
+ operator=(const SymmetricTensor<rank_, dim, OtherNumber> &rhs);
/**
* This operator assigns a scalar to a tensor. To avoid confusion with what
* value allowed for <tt>d</tt>, allowing the intuitive notation
* $\mathbf A = 0$ to reset all elements of the tensor to zero.
*/
- DEAL_II_CONSTEXPR SymmetricTensor &
- operator=(const Number &d);
+ constexpr SymmetricTensor &
+ operator=(const Number &d);
/**
* Convert the present symmetric tensor into a full tensor with the same
* Add another tensor.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR SymmetricTensor &
- operator+=(const SymmetricTensor<rank_, dim, OtherNumber> &);
+ constexpr SymmetricTensor &
+ operator+=(const SymmetricTensor<rank_, dim, OtherNumber> &);
/**
* Subtract another tensor.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR SymmetricTensor &
- operator-=(const SymmetricTensor<rank_, dim, OtherNumber> &);
+ constexpr SymmetricTensor &
+ operator-=(const SymmetricTensor<rank_, dim, OtherNumber> &);
/**
* Scale the tensor by <tt>factor</tt>, i.e. multiply all components by
* <tt>factor</tt>.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR SymmetricTensor &
- operator*=(const OtherNumber &factor);
+ constexpr SymmetricTensor &
+ operator*=(const OtherNumber &factor);
/**
* Scale the tensor by <tt>1/factor</tt>.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR SymmetricTensor &
- operator/=(const OtherNumber &factor);
+ constexpr SymmetricTensor &
+ operator/=(const OtherNumber &factor);
/**
* Unary minus operator. Negate all entries of a tensor.
*/
- DEAL_II_CONSTEXPR SymmetricTensor
- operator-() const;
+ constexpr SymmetricTensor
+ operator-() const;
/**
* Double contraction product between the present symmetric tensor and a
/**
* Return a read-write reference to the indicated element.
*/
- DEAL_II_CONSTEXPR Number &
- operator()(const TableIndices<rank_> &indices);
+ constexpr Number &
+ operator()(const TableIndices<rank_> &indices);
/**
* Return a @p const reference to the value referred to by the argument.
*/
- DEAL_II_CONSTEXPR const Number &
- operator()(const TableIndices<rank_> &indices) const;
+ constexpr const Number &
+ operator()(const TableIndices<rank_> &indices) const;
/**
* Access the elements of a row of this symmetric tensor. This function is
* Access the elements of a row of this symmetric tensor. This function is
* called for non-constant tensors.
*/
- DEAL_II_CONSTEXPR internal::SymmetricTensorAccessors::
+ constexpr internal::SymmetricTensorAccessors::
Accessor<rank_, dim, false, rank_ - 1, Number>
operator[](const unsigned int row);
*
* Exactly the same as operator().
*/
- DEAL_II_CONSTEXPR Number &operator[](const TableIndices<rank_> &indices);
+ constexpr Number &operator[](const TableIndices<rank_> &indices);
/**
* Access to an element according to unrolled index. The function
* <tt>s[s.unrolled_to_component_indices(unrolled_index)]</tt>, but more
* efficiently.
*/
- DEAL_II_CONSTEXPR const Number &
- access_raw_entry(const unsigned int unrolled_index) const;
+ constexpr const Number &
+ access_raw_entry(const unsigned int unrolled_index) const;
/**
* Access to an element according to unrolled index. The function
* <tt>s[s.unrolled_to_component_indices(unrolled_index)]</tt>, but more
* efficiently.
*/
- DEAL_II_CONSTEXPR Number &
- access_raw_entry(const unsigned int unrolled_index);
+ constexpr Number &
+ access_raw_entry(const unsigned int unrolled_index);
/**
* Return the Frobenius-norm of a tensor, i.e. the square root of the sum of
* and indeed the state where all elements have a zero value is the state
* right after construction of such an object.
*/
- DEAL_II_CONSTEXPR void
+ constexpr void
clear();
/**
// Make a few more functions friends.
template <int dim2, typename Number2>
- friend DEAL_II_CONSTEXPR Number2
- trace(const SymmetricTensor<2, dim2, Number2> &d);
+ friend constexpr Number2
+ trace(const SymmetricTensor<2, dim2, Number2> &d);
template <int dim2, typename Number2>
- friend DEAL_II_CONSTEXPR Number2
- determinant(const SymmetricTensor<2, dim2, Number2> &t);
+ friend constexpr Number2
+ determinant(const SymmetricTensor<2, dim2, Number2> &t);
template <int dim2, typename Number2>
- friend DEAL_II_CONSTEXPR SymmetricTensor<2, dim2, Number2>
- deviator(const SymmetricTensor<2, dim2, Number2> &t);
+ friend constexpr SymmetricTensor<2, dim2, Number2>
+ deviator(const SymmetricTensor<2, dim2, Number2> &t);
template <int dim2, typename Number2>
friend DEAL_II_CONSTEXPR SymmetricTensor<2, dim2, Number2>
template <int rank_, int dim, bool constness, int P, typename Number>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+ constexpr inline DEAL_II_ALWAYS_INLINE
Accessor<rank_, dim, constness, P - 1, Number>
Accessor<rank_, dim, constness, P, Number>::
operator[](const unsigned int i)
template <int rank_, int dim, bool constness, typename Number>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+ constexpr inline DEAL_II_ALWAYS_INLINE
typename Accessor<rank_, dim, constness, 1, Number>::reference
Accessor<rank_, dim, constness, 1, Number>::
operator[](const unsigned int i)
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
SymmetricTensor<rank_, dim, Number>::SymmetricTensor(
const Number (&array)[n_independent_components])
: data(
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- SymmetricTensor<rank_, dim, Number> &
- SymmetricTensor<rank_, dim, Number>::
- operator=(const SymmetricTensor<rank_, dim, OtherNumber> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim, Number> &
+ SymmetricTensor<rank_, dim, Number>::
+ operator=(const SymmetricTensor<rank_, dim, OtherNumber> &t)
{
data = t.data;
return *this;
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- SymmetricTensor<rank_, dim, Number> &
- SymmetricTensor<rank_, dim, Number>::operator=(const Number &d)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim, Number> &
+SymmetricTensor<rank_, dim, Number>::operator=(const Number &d)
{
Assert(numbers::value_is_zero(d),
ExcMessage("Only assignment with zero is allowed"));
namespace SymmetricTensorImplementation
{
template <int dim, typename Number>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- dealii::Tensor<2, dim, Number>
- convert_to_tensor(const dealii::SymmetricTensor<2, dim, Number> &s)
+ constexpr inline DEAL_II_ALWAYS_INLINE dealii::Tensor<2, dim, Number>
+ convert_to_tensor(const dealii::SymmetricTensor<2, dim, Number> &s)
{
dealii::Tensor<2, dim, Number> t;
template <int dim, typename Number>
- DEAL_II_CONSTEXPR dealii::Tensor<4, dim, Number>
- convert_to_tensor(const dealii::SymmetricTensor<4, dim, Number> &st)
+ constexpr dealii::Tensor<4, dim, Number>
+ convert_to_tensor(const dealii::SymmetricTensor<4, dim, Number> &st)
{
// utilize the symmetry properties of SymmetricTensor<4,dim>
// discussed in the class documentation to avoid accessing all
template <typename Number>
struct Inverse<2, 1, Number>
{
- DEAL_II_CONSTEXPR static inline DEAL_II_ALWAYS_INLINE
+ constexpr static inline DEAL_II_ALWAYS_INLINE
dealii::SymmetricTensor<2, 1, Number>
value(const dealii::SymmetricTensor<2, 1, Number> &t)
{
template <typename Number>
struct Inverse<2, 2, Number>
{
- DEAL_II_CONSTEXPR static inline DEAL_II_ALWAYS_INLINE
+ constexpr static inline DEAL_II_ALWAYS_INLINE
dealii::SymmetricTensor<2, 2, Number>
value(const dealii::SymmetricTensor<2, 2, Number> &t)
{
template <typename Number>
struct Inverse<2, 3, Number>
{
- DEAL_II_CONSTEXPR static dealii::SymmetricTensor<2, 3, Number>
+ constexpr static dealii::SymmetricTensor<2, 3, Number>
value(const dealii::SymmetricTensor<2, 3, Number> &t)
{
dealii::SymmetricTensor<2, 3, Number> tmp;
template <typename Number>
struct Inverse<4, 1, Number>
{
- DEAL_II_CONSTEXPR static inline dealii::SymmetricTensor<4, 1, Number>
+ constexpr static inline dealii::SymmetricTensor<4, 1, Number>
value(const dealii::SymmetricTensor<4, 1, Number> &t)
{
dealii::SymmetricTensor<4, 1, Number> tmp;
template <typename Number>
struct Inverse<4, 2, Number>
{
- DEAL_II_CONSTEXPR static inline dealii::SymmetricTensor<4, 2, Number>
+ constexpr static inline dealii::SymmetricTensor<4, 2, Number>
value(const dealii::SymmetricTensor<4, 2, Number> &t)
{
dealii::SymmetricTensor<4, 2, Number> tmp;
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- SymmetricTensor<rank_, dim, Number> &
- SymmetricTensor<rank_, dim, Number>::
- operator+=(const SymmetricTensor<rank_, dim, OtherNumber> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim, Number> &
+ SymmetricTensor<rank_, dim, Number>::
+ operator+=(const SymmetricTensor<rank_, dim, OtherNumber> &t)
{
data += t.data;
return *this;
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- SymmetricTensor<rank_, dim, Number> &
- SymmetricTensor<rank_, dim, Number>::
- operator-=(const SymmetricTensor<rank_, dim, OtherNumber> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim, Number> &
+ SymmetricTensor<rank_, dim, Number>::
+ operator-=(const SymmetricTensor<rank_, dim, OtherNumber> &t)
{
data -= t.data;
return *this;
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- SymmetricTensor<rank_, dim, Number> &
- SymmetricTensor<rank_, dim, Number>::operator*=(const OtherNumber &d)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim, Number> &
+SymmetricTensor<rank_, dim, Number>::operator*=(const OtherNumber &d)
{
data *= d;
return *this;
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- SymmetricTensor<rank_, dim, Number> &
- SymmetricTensor<rank_, dim, Number>::operator/=(const OtherNumber &d)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim, Number> &
+SymmetricTensor<rank_, dim, Number>::operator/=(const OtherNumber &d)
{
data /= d;
return *this;
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- SymmetricTensor<rank_, dim, Number>
- SymmetricTensor<rank_, dim, Number>::operator-() const
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim, Number>
+SymmetricTensor<rank_, dim, Number>::operator-() const
{
SymmetricTensor tmp = *this;
tmp.data = -tmp.data;
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE void
+constexpr inline DEAL_II_ALWAYS_INLINE void
SymmetricTensor<rank_, dim, Number>::clear()
{
data.clear();
Type Uninitialized<Type>::value;
template <int dim, typename Number>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number &
- symmetric_tensor_access(const TableIndices<2> &indices,
- typename SymmetricTensorAccessors::
- StorageType<2, dim, Number>::base_tensor_type &data)
+ constexpr inline DEAL_II_ALWAYS_INLINE Number &
+ symmetric_tensor_access(const TableIndices<2> &indices,
+ typename SymmetricTensorAccessors::
+ StorageType<2, dim, Number>::base_tensor_type &data)
{
// 1d is very simple and done first
if (dim == 1)
template <int dim, typename Number>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE const Number &
- symmetric_tensor_access(const TableIndices<2> &indices,
- const typename SymmetricTensorAccessors::
- StorageType<2, dim, Number>::base_tensor_type &data)
+ constexpr inline DEAL_II_ALWAYS_INLINE const Number &
+ symmetric_tensor_access(const TableIndices<2> &indices,
+ const typename SymmetricTensorAccessors::
+ StorageType<2, dim, Number>::base_tensor_type &data)
{
// 1d is very simple and done first
if (dim == 1)
template <int dim, typename Number>
- DEAL_II_CONSTEXPR inline Number &
+ constexpr inline Number &
symmetric_tensor_access(const TableIndices<4> &indices,
typename SymmetricTensorAccessors::
StorageType<4, dim, Number>::base_tensor_type &data)
template <int dim, typename Number>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE const Number &
- symmetric_tensor_access(const TableIndices<4> &indices,
- const typename SymmetricTensorAccessors::
- StorageType<4, dim, Number>::base_tensor_type &data)
+ constexpr inline DEAL_II_ALWAYS_INLINE const Number &
+ symmetric_tensor_access(const TableIndices<4> &indices,
+ const typename SymmetricTensorAccessors::
+ StorageType<4, dim, Number>::base_tensor_type &data)
{
switch (dim)
{
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number &
- SymmetricTensor<rank_, dim, Number>::
- operator()(const TableIndices<rank_> &indices)
+constexpr inline DEAL_II_ALWAYS_INLINE Number &
+ SymmetricTensor<rank_, dim, Number>::
+ operator()(const TableIndices<rank_> &indices)
{
for (unsigned int r = 0; r < rank; ++r)
AssertIndexRange(indices[r], dimension);
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE const Number &
- SymmetricTensor<rank_, dim, Number>::
- operator()(const TableIndices<rank_> &indices) const
+constexpr inline DEAL_II_ALWAYS_INLINE const Number &
+ SymmetricTensor<rank_, dim, Number>::
+ operator()(const TableIndices<rank_> &indices) const
{
for (unsigned int r = 0; r < rank; ++r)
AssertIndexRange(indices[r], dimension);
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE internal::
- SymmetricTensorAccessors::Accessor<rank_, dim, false, rank_ - 1, Number>
+constexpr inline DEAL_II_ALWAYS_INLINE internal::SymmetricTensorAccessors::
+ Accessor<rank_, dim, false, rank_ - 1, Number>
SymmetricTensor<rank_, dim, Number>::operator[](const unsigned int row)
{
return internal::SymmetricTensorAccessors::
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number &
- SymmetricTensor<rank_, dim, Number>::
- operator[](const TableIndices<rank_> &indices)
+constexpr inline DEAL_II_ALWAYS_INLINE Number &
+ SymmetricTensor<rank_, dim, Number>::
+ operator[](const TableIndices<rank_> &indices)
{
return operator()(indices);
}
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline const Number &
+constexpr inline const Number &
SymmetricTensor<rank_, dim, Number>::access_raw_entry(
const unsigned int index) const
{
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline Number &
+constexpr inline Number &
SymmetricTensor<rank_, dim, Number>::access_raw_entry(const unsigned int index)
{
AssertIndexRange(index, n_independent_components);
namespace internal
{
template <int dim, typename Number>
- DEAL_II_CONSTEXPR inline typename numbers::NumberTraits<Number>::real_type
+ constexpr inline typename numbers::NumberTraits<Number>::real_type
compute_norm(const typename SymmetricTensorAccessors::
StorageType<2, dim, Number>::base_tensor_type &data)
{
template <int dim, typename Number>
- DEAL_II_CONSTEXPR inline typename numbers::NumberTraits<Number>::real_type
+ constexpr inline typename numbers::NumberTraits<Number>::real_type
compute_norm(const typename SymmetricTensorAccessors::
StorageType<4, dim, Number>::base_tensor_type &data)
{
//
// this function is for rank-2 tensors
template <int dim>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE unsigned int
+ constexpr inline DEAL_II_ALWAYS_INLINE unsigned int
component_to_unrolled_index(const TableIndices<2> &indices)
{
AssertIndexRange(indices[0], dim);
// this function is for tensors of ranks not already handled
// above
template <int dim, int rank_>
- DEAL_II_CONSTEXPR inline unsigned int
+ constexpr inline unsigned int
component_to_unrolled_index(const TableIndices<rank_> &indices)
{
(void)indices;
//
// this function is for rank-2 tensors
template <int dim>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE TableIndices<2>
- unrolled_to_component_indices(const unsigned int i,
- const std::integral_constant<int, 2> &)
+ constexpr inline DEAL_II_ALWAYS_INLINE TableIndices<2>
+ unrolled_to_component_indices(const unsigned int i,
+ const std::integral_constant<int, 2> &)
{
Assert(
(i < dealii::SymmetricTensor<2, dim, double>::n_independent_components),
// this function is for tensors of a rank not already handled
// above
template <int dim, int rank_>
- DEAL_II_CONSTEXPR inline
+ constexpr inline
typename std::enable_if<rank_ != 2, TableIndices<rank_>>::type
unrolled_to_component_indices(const unsigned int i,
const std::integral_constant<int, rank_> &)
* @relatesalso SymmetricTensor
*/
template <int rank_, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
SymmetricTensor<rank_, dim, typename ProductType<Number, OtherNumber>::type>
operator+(const SymmetricTensor<rank_, dim, Number> & left,
const SymmetricTensor<rank_, dim, OtherNumber> &right)
* @relatesalso SymmetricTensor
*/
template <int rank_, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
SymmetricTensor<rank_, dim, typename ProductType<Number, OtherNumber>::type>
operator-(const SymmetricTensor<rank_, dim, Number> & left,
const SymmetricTensor<rank_, dim, OtherNumber> &right)
* @relatesalso SymmetricTensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number
- determinant(const SymmetricTensor<2, dim, Number> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE Number
+ determinant(const SymmetricTensor<2, dim, Number> &t)
{
switch (dim)
{
* @relatesalso SymmetricTensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number
- trace(const SymmetricTensor<2, dim, Number> &d)
+constexpr inline DEAL_II_ALWAYS_INLINE Number
+ trace(const SymmetricTensor<2, dim, Number> &d)
{
Number t = d.data[0];
for (unsigned int i = 1; i < dim; ++i)
* @relatesalso SymmetricTensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number>
- deviator(const SymmetricTensor<2, dim, Number> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number>
+ deviator(const SymmetricTensor<2, dim, Number> &t)
{
SymmetricTensor<2, dim, Number> tmp = t;
* @relatesalso SymmetricTensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline SymmetricTensor<4, dim, Number>
+constexpr inline SymmetricTensor<4, dim, Number>
outer_product(const SymmetricTensor<2, dim, Number> &t1,
const SymmetricTensor<2, dim, Number> &t2)
{
* @relatesalso SymmetricTensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number>
- symmetrize(const Tensor<2, dim, Number> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number>
+ symmetrize(const Tensor<2, dim, Number> &t)
{
SymmetricTensor<2, dim, Number> result;
for (unsigned int d = 0; d < dim; ++d)
* @relatesalso SymmetricTensor
*/
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- SymmetricTensor<rank_, dim, Number>
- operator*(const SymmetricTensor<rank_, dim, Number> &t, const Number &factor)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim, Number>
+ operator*(const SymmetricTensor<rank_, dim, Number> &t, const Number &factor)
{
SymmetricTensor<rank_, dim, Number> tt = t;
tt *= factor;
* @relatesalso EnableIfScalar
*/
template <int rank_, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<
rank_,
dim,
typename ProductType<Number,
* @relatesalso EnableIfScalar
*/
template <int rank_, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<
rank_,
dim,
typename ProductType<OtherNumber,
* @relatesalso SymmetricTensor
*/
template <int rank_, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline SymmetricTensor<
+constexpr inline SymmetricTensor<
rank_,
dim,
typename ProductType<Number,
* @relatesalso SymmetricTensor
*/
template <int rank_, int dim>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim>
- operator*(const SymmetricTensor<rank_, dim> &t, const double factor)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim>
+ operator*(const SymmetricTensor<rank_, dim> &t, const double factor)
{
SymmetricTensor<rank_, dim> tt(t);
tt *= factor;
* @relatesalso SymmetricTensor
*/
template <int rank_, int dim>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim>
- operator*(const double factor, const SymmetricTensor<rank_, dim> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<rank_, dim>
+ operator*(const double factor, const SymmetricTensor<rank_, dim> &t)
{
SymmetricTensor<rank_, dim> tt(t);
tt *= factor;
* @relatesalso SymmetricTensor
*/
template <int rank_, int dim>
-DEAL_II_CONSTEXPR inline SymmetricTensor<rank_, dim>
+constexpr inline SymmetricTensor<rank_, dim>
operator/(const SymmetricTensor<rank_, dim> &t, const double factor)
{
SymmetricTensor<rank_, dim> tt(t);
* @relatesalso SymmetricTensor
*/
template <int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
typename ProductType<Number, OtherNumber>::type
scalar_product(const SymmetricTensor<2, dim, Number> &t1,
const Tensor<2, dim, OtherNumber> & t2)
* @relatesalso SymmetricTensor
*/
template <typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE void double_contract(
+constexpr inline DEAL_II_ALWAYS_INLINE void double_contract(
SymmetricTensor<2, 1, typename ProductType<Number, OtherNumber>::type> &tmp,
const SymmetricTensor<4, 1, Number> & t,
const SymmetricTensor<2, 1, OtherNumber> & s)
* @relatesalso SymmetricTensor
*/
template <typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline void double_contract(
+constexpr inline void double_contract(
SymmetricTensor<2, 1, typename ProductType<Number, OtherNumber>::type> &tmp,
const SymmetricTensor<2, 1, Number> & s,
const SymmetricTensor<4, 1, OtherNumber> & t)
* @relatesalso SymmetricTensor
*/
template <typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline void double_contract(
+constexpr inline void double_contract(
SymmetricTensor<2, 2, typename ProductType<Number, OtherNumber>::type> &tmp,
const SymmetricTensor<4, 2, Number> & t,
const SymmetricTensor<2, 2, OtherNumber> & s)
* @relatesalso SymmetricTensor
*/
template <typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline void double_contract(
+constexpr inline void double_contract(
SymmetricTensor<2, 2, typename ProductType<Number, OtherNumber>::type> &tmp,
const SymmetricTensor<2, 2, Number> & s,
const SymmetricTensor<4, 2, OtherNumber> & t)
* @relatesalso SymmetricTensor
*/
template <typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline void double_contract(
+constexpr inline void double_contract(
SymmetricTensor<2, 3, typename ProductType<Number, OtherNumber>::type> &tmp,
const SymmetricTensor<4, 3, Number> & t,
const SymmetricTensor<2, 3, OtherNumber> & s)
* @relatesalso SymmetricTensor
*/
template <typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline void double_contract(
+constexpr inline void double_contract(
SymmetricTensor<2, 3, typename ProductType<Number, OtherNumber>::type> &tmp,
const SymmetricTensor<2, 3, Number> & s,
const SymmetricTensor<4, 3, OtherNumber> & t)
* @relatesalso SymmetricTensor
*/
template <int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR
- Tensor<1, dim, typename ProductType<Number, OtherNumber>::type>
- operator*(const SymmetricTensor<2, dim, Number> &src1,
- const Tensor<1, dim, OtherNumber> & src2)
+constexpr Tensor<1, dim, typename ProductType<Number, OtherNumber>::type>
+operator*(const SymmetricTensor<2, dim, Number> &src1,
+ const Tensor<1, dim, OtherNumber> & src2)
{
Tensor<1, dim, typename ProductType<Number, OtherNumber>::type> dest;
for (unsigned int i = 0; i < dim; ++i)
/**
* Read-only access the value of the <tt>i</tt>th index.
*/
- DEAL_II_CONSTEXPR std::size_t operator[](const unsigned int i) const;
+ constexpr std::size_t operator[](const unsigned int i) const;
/**
* Write access the value of the <tt>i</tt>th index.
*/
- DEAL_II_CONSTEXPR std::size_t &operator[](const unsigned int i);
+ constexpr std::size_t &operator[](const unsigned int i);
/**
* Compare two index fields for equality.
template <int N>
-DEAL_II_CONSTEXPR inline std::size_t TableIndices<N>::
- operator[](const unsigned int i) const
+constexpr inline std::size_t TableIndices<N>::
+ operator[](const unsigned int i) const
{
AssertIndexRange(i, N);
return indices[i];
template <int N>
-DEAL_II_CONSTEXPR inline std::size_t &TableIndices<N>::
- operator[](const unsigned int i)
+constexpr inline std::size_t &TableIndices<N>::operator[](const unsigned int i)
{
AssertIndexRange(i, N);
return indices[i];
*
* @note This function can also be used in CUDA device code.
*/
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV operator Number &();
+ constexpr DEAL_II_CUDA_HOST_DEV operator Number &();
/**
* Return a reference to the encapsulated Number object. Since rank-0
*
* @note This function can also be used in CUDA device code.
*/
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV operator const Number &() const;
+ constexpr DEAL_II_CUDA_HOST_DEV operator const Number &() const;
/**
* Assignment from tensors with different underlying scalar type. This
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator=(const Tensor<0, dim, OtherNumber> &rhs);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator=(const Tensor<0, dim, OtherNumber> &rhs);
#ifdef __INTEL_COMPILER
/**
*
* @note This function can also be used in CUDA device code.
*/
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator=(const Tensor<0, dim, Number> &rhs);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator=(const Tensor<0, dim, Number> &rhs);
#endif
/**
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator=(const OtherNumber &d);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator=(const OtherNumber &d);
/**
* Test for equality of two tensors.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR bool
+ constexpr bool
operator==(const Tensor<0, dim, OtherNumber> &rhs) const;
/**
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator+=(const Tensor<0, dim, OtherNumber> &rhs);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator+=(const Tensor<0, dim, OtherNumber> &rhs);
/**
* Subtract another scalar.
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator-=(const Tensor<0, dim, OtherNumber> &rhs);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator-=(const Tensor<0, dim, OtherNumber> &rhs);
/**
* Multiply the scalar with a <tt>factor</tt>.
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator*=(const OtherNumber &factor);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator*=(const OtherNumber &factor);
/**
* Divide the scalar by <tt>factor</tt>.
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator/=(const OtherNumber &factor);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator/=(const OtherNumber &factor);
/**
* Tensor with inverted entries.
* and indeed the state where all elements have a zero value is the state
* right after construction of such an object.
*/
- DEAL_II_CONSTEXPR void
+ constexpr void
clear();
/**
*
* @note This function can also be used in CUDA device code.
*/
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV real_type
- norm_square() const;
+ constexpr DEAL_II_CUDA_HOST_DEV real_type
+ norm_square() const;
/**
* Read or write the data of this object to or from a stream for the purpose
*
* @note This function can also be used in CUDA device code.
*/
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV value_type &
- operator[](const unsigned int i);
+ constexpr DEAL_II_CUDA_HOST_DEV value_type &operator[](const unsigned int i);
/**
* Read-only access operator.
/**
* Read access using TableIndices <tt>indices</tt>
*/
- DEAL_II_CONSTEXPR const Number &
- operator[](const TableIndices<rank_> &indices) const;
+ constexpr const Number &operator[](const TableIndices<rank_> &indices) const;
/**
* Read and write access using TableIndices <tt>indices</tt>
*/
- DEAL_II_CONSTEXPR Number &operator[](const TableIndices<rank_> &indices);
+ constexpr Number &operator[](const TableIndices<rank_> &indices);
/**
* Return a pointer to the first element of the underlying storage.
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator=(const Tensor<rank_, dim, OtherNumber> &rhs);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator=(const Tensor<rank_, dim, OtherNumber> &rhs);
/**
* This operator assigns a scalar to a tensor. To avoid confusion with what
* value allowed for <tt>d</tt>, allowing the intuitive notation
* <tt>t=0</tt> to reset all elements of the tensor to zero.
*/
- DEAL_II_CONSTEXPR Tensor &
- operator=(const Number &d);
+ constexpr Tensor &
+ operator=(const Number &d);
/**
* Test for equality of two tensors.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR bool
+ constexpr bool
operator==(const Tensor<rank_, dim, OtherNumber> &) const;
/**
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator+=(const Tensor<rank_, dim, OtherNumber> &);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator+=(const Tensor<rank_, dim, OtherNumber> &);
/**
* Subtract another tensor.
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator-=(const Tensor<rank_, dim, OtherNumber> &);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator-=(const Tensor<rank_, dim, OtherNumber> &);
/**
* Scale the tensor by <tt>factor</tt>, i.e. multiply all components by
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator*=(const OtherNumber &factor);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator*=(const OtherNumber &factor);
/**
* Scale the vector by <tt>1/factor</tt>.
* @note This function can also be used in CUDA device code.
*/
template <typename OtherNumber>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor &
- operator/=(const OtherNumber &factor);
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor &
+ operator/=(const OtherNumber &factor);
/**
* Unary minus operator. Negate all entries of a tensor.
*
* @note This function can also be used in CUDA device code.
*/
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV Tensor
- operator-() const;
+ constexpr DEAL_II_CUDA_HOST_DEV Tensor
+ operator-() const;
/**
* Reset all values to zero.
* and indeed the state where all elements have a zero value is the state
* right after construction of such an object.
*/
- DEAL_II_CONSTEXPR void
+ constexpr void
clear();
/**
*
* @note This function can also be used in CUDA device code.
*/
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV
+ constexpr DEAL_II_CUDA_HOST_DEV
typename numbers::NumberTraits<Number>::real_type
norm_square() const;
* Return an unrolled index in the range $[0,\text{dim}^{\text{rank}}-1]$
* for the element of the tensor indexed by the argument to the function.
*/
- static DEAL_II_CONSTEXPR unsigned int
+ static constexpr unsigned int
component_to_unrolled_index(const TableIndices<rank_> &indices);
/**
* $[0, \text{dim}^{\text{rank}}-1]$, return which set of indices it would
* correspond to.
*/
- static DEAL_II_CONSTEXPR TableIndices<rank_>
- unrolled_to_component_indices(const unsigned int i);
+ static constexpr TableIndices<rank_>
+ unrolled_to_component_indices(const unsigned int i);
/**
* Determine an estimate for the memory consumption (in bytes) of this
return t;
}
- static DEAL_II_CONSTEXPR DEAL_II_ALWAYS_INLINE Tensor<rank, dim, T>
- value(const T &t)
+ static constexpr DEAL_II_ALWAYS_INLINE Tensor<rank, dim, T>
+ value(const T &t)
{
Tensor<rank, dim, T> tmp;
tmp = t;
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number>::operator Number &()
{
// We cannot use Assert inside a CUDA kernel
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number>::operator const Number &() const
{
// We cannot use Assert inside a CUDA kernel
template <int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> &
Tensor<0, dim, Number>::operator=(const Tensor<0, dim, OtherNumber> &p)
{
# ifdef __INTEL_COMPILER
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> &
Tensor<0, dim, Number>::operator=(const Tensor<0, dim, Number> &p)
{
template <int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> &
Tensor<0, dim, Number>::operator=(const OtherNumber &d)
{
template <int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline bool
+constexpr inline bool
Tensor<0, dim, Number>::operator==(const Tensor<0, dim, OtherNumber> &p) const
{
# if defined(DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING)
template <int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> &
Tensor<0, dim, Number>::operator+=(const Tensor<0, dim, OtherNumber> &p)
{
template <int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> &
Tensor<0, dim, Number>::operator-=(const Tensor<0, dim, OtherNumber> &p)
{
namespace ComplexWorkaround
{
template <typename Number, typename OtherNumber>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV void
- multiply_assign_scalar(Number &val, const OtherNumber &s)
+ constexpr inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV void
+ multiply_assign_scalar(Number &val, const OtherNumber &s)
{
val *= s;
}
# ifdef __CUDA_ARCH__
template <typename Number, typename OtherNumber>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV void
- multiply_assign_scalar(std::complex<Number> &, const OtherNumber &)
+ constexpr inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV void
+ multiply_assign_scalar(std::complex<Number> &, const OtherNumber &)
{
printf("This function is not implemented for std::complex<Number>!\n");
assert(false);
template <int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> &
Tensor<0, dim, Number>::operator*=(const OtherNumber &s)
{
template <int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> &
+constexpr inline DEAL_II_CUDA_HOST_DEV Tensor<0, dim, Number> &
Tensor<0, dim, Number>::operator/=(const OtherNumber &s)
{
value /= s;
template <int dim, typename Number>
-DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
typename Tensor<0, dim, Number>::real_type
Tensor<0, dim, Number>::norm_square() const
{
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline void
+constexpr inline void
Tensor<0, dim, Number>::clear()
{
// Some auto-differentiable numbers need explicit
namespace TensorSubscriptor
{
template <typename ArrayElementType, int dim>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+ constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV ArrayElementType &
subscript(ArrayElementType * values,
const unsigned int i,
Type Uninitialized<Type>::value;
template <typename ArrayElementType>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+ constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV ArrayElementType &
subscript(ArrayElementType *,
const unsigned int,
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV
+constexpr inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV
typename Tensor<rank_, dim, Number>::value_type &Tensor<rank_, dim, Number>::
operator[](const unsigned int i)
{
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE const Number &
- Tensor<rank_, dim, Number>::
- operator[](const TableIndices<rank_> &indices) const
+constexpr inline DEAL_II_ALWAYS_INLINE const Number &
+ Tensor<rank_, dim, Number>::
+ operator[](const TableIndices<rank_> &indices) const
{
# ifndef DEAL_II_COMPILER_CUDA_AWARE
Assert(dim != 0,
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number &
- Tensor<rank_, dim, Number>::operator[](const TableIndices<rank_> &indices)
+constexpr inline DEAL_II_ALWAYS_INLINE Number &Tensor<rank_, dim, Number>::
+ operator[](const TableIndices<rank_> &indices)
{
# ifndef DEAL_II_COMPILER_CUDA_AWARE
Assert(dim != 0,
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Tensor<rank_, dim, Number> &
+constexpr inline DEAL_II_ALWAYS_INLINE Tensor<rank_, dim, Number> &
Tensor<rank_, dim, Number>::operator=(const Tensor<rank_, dim, OtherNumber> &t)
{
// The following loop could be written more concisely using std::copy, but
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Tensor<rank_, dim, Number> &
+constexpr inline DEAL_II_ALWAYS_INLINE Tensor<rank_, dim, Number> &
Tensor<rank_, dim, Number>::operator=(const Number &d)
{
Assert(numbers::value_is_zero(d), ExcScalarAssignmentOnlyForZeroValue());
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline bool
+constexpr inline bool
Tensor<rank_, dim, Number>::
operator==(const Tensor<rank_, dim, OtherNumber> &p) const
{
// implement this function here
template <>
template <>
-DEAL_II_CONSTEXPR inline bool
+constexpr inline bool
Tensor<1, 0, double>::operator==(const Tensor<1, 0, double> &) const
{
return true;
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<rank_, dim, Number> &
Tensor<rank_, dim, Number>::
operator+=(const Tensor<rank_, dim, OtherNumber> &p)
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<rank_, dim, Number> &
Tensor<rank_, dim, Number>::
operator-=(const Tensor<rank_, dim, OtherNumber> &p)
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<rank_, dim, Number> &
Tensor<rank_, dim, Number>::operator*=(const OtherNumber &s)
{
typename ProductType<Number, OtherNumber>::type>::value &&
!std::is_same<Number, Differentiation::SD::Expression>::value,
int>::type = 0>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE void
- division_operator(Tensor<rank, dim, Number> (&t)[dim],
- const OtherNumber &factor)
+ constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE void
+ division_operator(Tensor<rank, dim, Number> (&t)[dim],
+ const OtherNumber &factor)
{
const Number inverse_factor = Number(1.) / factor;
// recurse over the base objects
typename ProductType<Number, OtherNumber>::type>::value ||
std::is_same<Number, Differentiation::SD::Expression>::value,
int>::type = 0>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE void
- division_operator(Tensor<rank, dim, Number> (&t)[dim],
- const OtherNumber &factor)
+ constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE void
+ division_operator(Tensor<rank, dim, Number> (&t)[dim],
+ const OtherNumber &factor)
{
// recurse over the base objects
for (unsigned int d = 0; d < dim; ++d)
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<rank_, dim, Number> &
Tensor<rank_, dim, Number>::operator/=(const OtherNumber &s)
{
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
DEAL_II_CUDA_HOST_DEV Tensor<rank_, dim, Number>
Tensor<rank_, dim, Number>::operator-() const
{
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV
+constexpr inline DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV
typename numbers::NumberTraits<Number>::real_type
Tensor<rank_, dim, Number>::norm_square() const
{
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline unsigned int
+constexpr inline unsigned int
Tensor<rank_, dim, Number>::component_to_unrolled_index(
const TableIndices<rank_> &indices)
{
// and rank=2. Make sure we don't have compiler warnings.
template <int dim>
- inline DEAL_II_CONSTEXPR unsigned int
+ inline constexpr unsigned int
mod(const unsigned int x)
{
return x % dim;
}
template <int dim>
- inline DEAL_II_CONSTEXPR unsigned int
+ inline constexpr unsigned int
div(const unsigned int x)
{
return x / dim;
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline TableIndices<rank_>
+constexpr inline TableIndices<rank_>
Tensor<rank_, dim, Number>::unrolled_to_component_indices(const unsigned int i)
{
AssertIndexRange(i, n_independent_components);
template <int rank_, int dim, typename Number>
-DEAL_II_CONSTEXPR inline void
+constexpr inline void
Tensor<rank_, dim, Number>::clear()
{
for (unsigned int i = 0; i < dim; ++i)
* @relatesalso Tensor
*/
template <int dim, typename Number, typename Other>
-DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
typename ProductType<Other, Number>::type
operator*(const Other &object, const Tensor<0, dim, Number> &t)
{
* @relatesalso Tensor
*/
template <int dim, typename Number, typename Other>
-DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
typename ProductType<Number, Other>::type
operator*(const Tensor<0, dim, Number> &t, const Other &object)
{
* @relatesalso Tensor
*/
template <int rank, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
- Tensor<rank,
+constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+ Tensor<rank,
dim,
typename ProductType<Number,
typename EnableIfScalar<OtherNumber>::type>::type>
- operator*(const Tensor<rank, dim, Number> &t, const OtherNumber &factor)
+ operator*(const Tensor<rank, dim, Number> &t, const OtherNumber &factor)
{
// recurse over the base objects
Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type> tt;
* @relatesalso Tensor
*/
template <int rank, int dim, typename Number, typename OtherNumber>
-DEAL_II_CUDA_HOST_DEV DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
- Tensor<rank,
+DEAL_II_CUDA_HOST_DEV constexpr inline DEAL_II_ALWAYS_INLINE
+ Tensor<rank,
dim,
typename ProductType<typename EnableIfScalar<Number>::type,
OtherNumber>::type>
- operator*(const Number &factor, const Tensor<rank, dim, OtherNumber> &t)
+ operator*(const Number &factor, const Tensor<rank, dim, OtherNumber> &t)
{
// simply forward to the operator above
return t * factor;
!std::is_integral<
typename ProductType<Number, OtherNumber>::type>::value,
int>::type = 0>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
- Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
- division_operator(const Tensor<rank, dim, Number> &t,
- const OtherNumber & factor)
+ constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+ Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
+ division_operator(const Tensor<rank, dim, Number> &t,
+ const OtherNumber & factor)
{
Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type> tt;
const Number inverse_factor = Number(1.) / factor;
std::is_integral<
typename ProductType<Number, OtherNumber>::type>::value,
int>::type = 0>
- DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
- Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
- division_operator(const Tensor<rank, dim, Number> &t,
- const OtherNumber & factor)
+ constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+ Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
+ division_operator(const Tensor<rank, dim, Number> &t,
+ const OtherNumber & factor)
{
Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type> tt;
// recurse over the base objects
* @relatesalso Tensor
*/
template <int rank, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
- Tensor<rank,
+constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+ Tensor<rank,
dim,
typename ProductType<Number,
typename EnableIfScalar<OtherNumber>::type>::type>
- operator/(const Tensor<rank, dim, Number> &t, const OtherNumber &factor)
+ operator/(const Tensor<rank, dim, Number> &t, const OtherNumber &factor)
{
return internal::TensorImplementation::division_operator(t, factor);
}
* @relatesalso Tensor
*/
template <int rank, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
- Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
- operator+(const Tensor<rank, dim, Number> & p,
+constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+ Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
+ operator+(const Tensor<rank, dim, Number> & p,
const Tensor<rank, dim, OtherNumber> &q)
{
Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type> tmp(p);
* @relatesalso Tensor
*/
template <int rank, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
- Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
- operator-(const Tensor<rank, dim, Number> & p,
+constexpr DEAL_II_CUDA_HOST_DEV inline DEAL_II_ALWAYS_INLINE
+ Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
+ operator-(const Tensor<rank, dim, Number> & p,
const Tensor<rank, dim, OtherNumber> &q)
{
Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type> tmp(p);
* @relatesalso Tensor
*/
template <int dim, typename Number, typename OtherNumber>
-inline DEAL_II_CONSTEXPR DEAL_II_ALWAYS_INLINE
- Tensor<0, dim, typename ProductType<Number, OtherNumber>::type>
- schur_product(const Tensor<0, dim, Number> & src1,
- const Tensor<0, dim, OtherNumber> &src2)
+inline constexpr DEAL_II_ALWAYS_INLINE
+ Tensor<0, dim, typename ProductType<Number, OtherNumber>::type>
+ schur_product(const Tensor<0, dim, Number> & src1,
+ const Tensor<0, dim, OtherNumber> &src2)
{
Tensor<0, dim, typename ProductType<Number, OtherNumber>::type> tmp(src1);
* @relatesalso Tensor
*/
template <int rank, int dim, typename Number, typename OtherNumber>
-inline DEAL_II_CONSTEXPR DEAL_II_ALWAYS_INLINE
- Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
- schur_product(const Tensor<rank, dim, Number> & src1,
- const Tensor<rank, dim, OtherNumber> &src2)
+inline constexpr DEAL_II_ALWAYS_INLINE
+ Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type>
+ schur_product(const Tensor<rank, dim, Number> & src1,
+ const Tensor<rank, dim, OtherNumber> &src2)
{
Tensor<rank, dim, typename ProductType<Number, OtherNumber>::type> tmp;
typename Number,
typename OtherNumber,
typename = typename std::enable_if<rank_1 >= 1 && rank_2 >= 1>::type>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
typename Tensor<rank_1 + rank_2 - 2,
dim,
typename ProductType<Number, OtherNumber>::type>::tensor_type
int dim,
typename Number,
typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
typename Tensor<rank_1 + rank_2 - 2,
dim,
typename ProductType<Number, OtherNumber>::type>::tensor_type
using namespace TensorAccessors::internal;
// Reorder index_1 to the end of src1:
- ReorderedIndexView<index_1, rank_1, const Tensor<rank_1, dim, Number>>
+ const ReorderedIndexView<index_1, rank_1, const Tensor<rank_1, dim, Number>>
reord_01 = reordered_index_view<index_1, rank_1>(src1);
// Reorder index_2 to the end of src2:
- ReorderedIndexView<index_2, rank_2, const Tensor<rank_2, dim, OtherNumber>>
+ const ReorderedIndexView<index_2,
+ rank_2,
+ const Tensor<rank_2, dim, OtherNumber>>
reord_02 = reordered_index_view<index_2, rank_2>(src2);
typename Tensor<rank_1 + rank_2 - 2,
int dim,
typename Number,
typename OtherNumber>
-DEAL_II_CONSTEXPR inline
+constexpr inline
typename Tensor<rank_1 + rank_2 - 4,
dim,
typename ProductType<Number, OtherNumber>::type>::tensor_type
* @relatesalso Tensor
*/
template <int rank, int dim, typename Number, typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
typename ProductType<Number, OtherNumber>::type
scalar_product(const Tensor<rank, dim, Number> & left,
const Tensor<rank, dim, OtherNumber> &right)
typename T1,
typename T2,
typename T3>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
typename ProductType<T1, typename ProductType<T2, T3>::type>::type
contract3(const TensorT1<rank_1, dim, T1> & left,
const TensorT2<rank_1 + rank_2, dim, T2> &middle,
int dim,
typename Number,
typename OtherNumber>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
Tensor<rank_1 + rank_2, dim, typename ProductType<Number, OtherNumber>::type>
outer_product(const Tensor<rank_1, dim, Number> & src1,
const Tensor<rank_2, dim, OtherNumber> &src2)
* @relatesalso Tensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Tensor<1, dim, Number>
- cross_product_2d(const Tensor<1, dim, Number> &src)
+constexpr inline DEAL_II_ALWAYS_INLINE Tensor<1, dim, Number>
+ cross_product_2d(const Tensor<1, dim, Number> &src)
{
Assert(dim == 2, ExcInternalError());
* @relatesalso Tensor
*/
template <int dim, typename Number1, typename Number2>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE
+constexpr inline DEAL_II_ALWAYS_INLINE
Tensor<1, dim, typename ProductType<Number1, Number2>::type>
cross_product_3d(const Tensor<1, dim, Number1> &src1,
const Tensor<1, dim, Number2> &src2)
* @relatesalso Tensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number
- determinant(const Tensor<2, dim, Number> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE Number
+ determinant(const Tensor<2, dim, Number> &t)
{
// Compute the determinant using the Laplace expansion of the
// determinant. We expand along the last row.
* @relatesalso Tensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number
- trace(const Tensor<2, dim, Number> &d)
+constexpr inline DEAL_II_ALWAYS_INLINE Number
+ trace(const Tensor<2, dim, Number> &d)
{
Number t = d[0][0];
for (unsigned int i = 1; i < dim; ++i)
* @relatesalso Tensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline Tensor<2, dim, Number>
+constexpr inline Tensor<2, dim, Number>
invert(const Tensor<2, dim, Number> &)
{
Number return_tensor[dim][dim];
#ifndef DOXYGEN
template <typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Tensor<2, 1, Number>
- invert(const Tensor<2, 1, Number> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE Tensor<2, 1, Number>
+ invert(const Tensor<2, 1, Number> &t)
{
Tensor<2, 1, Number> return_tensor;
template <typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Tensor<2, 2, Number>
- invert(const Tensor<2, 2, Number> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE Tensor<2, 2, Number>
+ invert(const Tensor<2, 2, Number> &t)
{
Tensor<2, 2, Number> return_tensor;
template <typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Tensor<2, 3, Number>
- invert(const Tensor<2, 3, Number> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE Tensor<2, 3, Number>
+ invert(const Tensor<2, 3, Number> &t)
{
Tensor<2, 3, Number> return_tensor;
* @relatesalso Tensor
*/
template <int dim, typename Number>
-DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Tensor<2, dim, Number>
- transpose(const Tensor<2, dim, Number> &t)
+constexpr inline DEAL_II_ALWAYS_INLINE Tensor<2, dim, Number>
+ transpose(const Tensor<2, dim, Number> &t)
{
Tensor<2, dim, Number> tt;
for (unsigned int i = 0; i < dim; ++i)
typename T1,
typename T2,
typename T3>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE void
+ constexpr inline DEAL_II_ALWAYS_INLINE void
contract(T1 &result, const T2 &left, const T3 &right)
{
static_assert(rank_1 >= no_contr,
{
public:
template <typename T1, typename T2, typename T3>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE static void
+ constexpr inline DEAL_II_ALWAYS_INLINE static void
contract(T1 &result, const T2 &left, const T3 &right)
{
for (unsigned int i = 0; i < dim; ++i)
{
public:
template <typename T1, typename T2, typename T3>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE static void
+ constexpr inline DEAL_II_ALWAYS_INLINE static void
contract(T1 &result, const T2 &left, const T3 &right)
{
for (unsigned int i = 0; i < dim; ++i)
{
public:
template <typename T1, typename T2, typename T3>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE static void
+ constexpr inline DEAL_II_ALWAYS_INLINE static void
contract(T1 &result, const T2 &left, const T3 &right)
{
result = Contract2<no_contr, dim>::template contract2<T1>(left, right);
{
public:
template <typename T1, typename T2, typename T3>
- DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE static T1
+ constexpr inline DEAL_II_ALWAYS_INLINE static T1
contract2(const T2 &left, const T3 &right)
{
// Some auto-differentiable numbers need explicit
{
public:
template <typename T1, typename T2, typename T3, typename T4>
- DEAL_II_CONSTEXPR static inline T1
+ constexpr static inline T1
contract3(const T2 &left, const T3 &middle, const T4 &right)
{
// Some auto-differentiable numbers need explicit
{
public:
template <typename T1, typename T2, typename T3, typename T4>
- DEAL_II_CONSTEXPR static inline T1
+ constexpr static inline T1
contract3(const T2 &left, const T3 &middle, const T4 &right)
{
// Some auto-differentiable numbers need explicit