*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE
+ constexpr DEAL_II_HOST_DEVICE
Point();
/**
* Convert a tensor to a point.
*/
- explicit DEAL_II_HOST_DEVICE
+ constexpr explicit DEAL_II_HOST_DEVICE
Point(const Tensor<1, dim, Number> &);
/**
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- explicit DEAL_II_HOST_DEVICE
+ constexpr explicit DEAL_II_HOST_DEVICE
Point(const Number x);
/**
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE
+ constexpr DEAL_II_HOST_DEVICE
Point(const Number x, const Number y);
/**
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE
+ constexpr DEAL_II_HOST_DEVICE
Point(const Number x, const Number y, const Number z);
/**
*/
template <std::size_t dummy_dim,
std::enable_if_t<(dim == dummy_dim) && (dummy_dim != 0), int> = 0>
- Point(const boost::geometry::model::
- point<Number, dummy_dim, boost::geometry::cs::cartesian> &boost_pt);
+ constexpr Point(
+ const boost::geometry::model::
+ point<Number, dummy_dim, boost::geometry::cs::cartesian> &boost_pt);
/**
* Return a unit vector in coordinate direction <tt>i</tt>, i.e., a vector
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- static DEAL_II_HOST_DEVICE Point<dim, Number>
- unit_vector(const unsigned int i);
+ static constexpr DEAL_II_HOST_DEVICE Point<dim, Number>
+ unit_vector(const unsigned int i);
/**
* Read access to the <tt>index</tt>th coordinate.
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE Number
+ constexpr DEAL_II_HOST_DEVICE Number
operator()(const unsigned int index) const;
/**
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE Number &
+ constexpr DEAL_II_HOST_DEVICE Number &
operator()(const unsigned int index);
/**
* convertible to @p Number.
*/
template <typename OtherNumber>
- Point<dim, Number> &
+ constexpr Point<dim, Number> &
operator=(const Tensor<1, dim, OtherNumber> &p);
/**
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE Point<dim, Number>
- operator+(const Tensor<1, dim, Number> &) const;
+ constexpr DEAL_II_HOST_DEVICE Point<dim, Number>
+ operator+(const Tensor<1, dim, Number> &) const;
/**
* Subtract two points, i.e., obtain the vector that connects the two. As
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE Tensor<1, dim, Number>
- operator-(const Point<dim, Number> &) const;
+ constexpr DEAL_II_HOST_DEVICE Tensor<1, dim, Number>
+ operator-(const Point<dim, Number> &) const;
/**
* Subtract a difference vector (represented by a Tensor@<1,dim@>) from the
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE Point<dim, Number>
- operator-(const Tensor<1, dim, Number> &) const;
+ constexpr DEAL_II_HOST_DEVICE Point<dim, Number>
+ operator-(const Tensor<1, dim, Number> &) const;
/**
* The opposite vector.
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE Point<dim, Number>
- operator-() const;
+ constexpr DEAL_II_HOST_DEVICE Point<dim, Number>
+ operator-() const;
/**
* @}
* @relatesalso EnableIfScalar
*/
template <typename OtherNumber>
- DEAL_II_HOST_DEVICE Point<
+ constexpr DEAL_II_HOST_DEVICE Point<
dim,
typename ProductType<Number,
typename EnableIfScalar<OtherNumber>::type>::type>
* @note This function can also be used in @ref GlossDevice "device" code.
*/
template <typename OtherNumber>
- DEAL_II_HOST_DEVICE Point<
+ constexpr DEAL_II_HOST_DEVICE Point<
dim,
typename ProductType<Number,
typename EnableIfScalar<OtherNumber>::type>::type>
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE Number
+ constexpr DEAL_II_HOST_DEVICE Number
operator*(const Tensor<1, dim, Number> &p) const;
/**
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE typename numbers::NumberTraits<Number>::real_type
- square() const;
+ constexpr DEAL_II_HOST_DEVICE
+ typename numbers::NumberTraits<Number>::real_type
+ square() const;
/**
* Return the Euclidean distance of <tt>this</tt> point to the point
*
* @note This function can also be used in @ref GlossDevice "device" code.
*/
- DEAL_II_HOST_DEVICE typename numbers::NumberTraits<Number>::real_type
- distance_square(const Point<dim, Number> &p) const;
+ constexpr DEAL_II_HOST_DEVICE
+ typename numbers::NumberTraits<Number>::real_type
+ distance_square(const Point<dim, Number> &p) const;
/**
* @}
// and we can't use 'Point<dim,Number>::Point () = default' here.
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number>::Point() // NOLINT
+constexpr DEAL_II_HOST_DEVICE Point<dim, Number>::Point() // NOLINT
{}
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number>::Point(
+constexpr DEAL_II_HOST_DEVICE Point<dim, Number>::Point(
const Tensor<1, dim, Number> &t)
: Tensor<1, dim, Number>(t)
{}
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number>::Point(const Number x)
+constexpr DEAL_II_HOST_DEVICE Point<dim, Number>::Point(const Number x)
{
Assert(dim == 1,
ExcMessage(
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number>::Point(const Number x,
- const Number y)
+constexpr DEAL_II_HOST_DEVICE Point<dim, Number>::Point(const Number x,
+ const Number y)
{
Assert(dim == 2,
ExcMessage(
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number>::Point(const Number x,
- const Number y,
- const Number z)
+constexpr DEAL_II_HOST_DEVICE Point<dim, Number>::Point(const Number x,
+ const Number y,
+ const Number z)
{
Assert(dim == 3,
ExcMessage(
DEAL_II_CXX20_REQUIRES(dim >= 0)
template <std::size_t dummy_dim,
std::enable_if_t<(dim == dummy_dim) && (dummy_dim != 0), int>>
-inline Point<dim, Number>::Point(
+constexpr Point<dim, Number>::Point(
const boost::geometry::model::
point<Number, dummy_dim, boost::geometry::cs::cartesian> &boost_pt)
{
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number> Point<dim, Number>::unit_vector(
- unsigned int i)
+constexpr DEAL_II_HOST_DEVICE
+ Point<dim, Number> Point<dim, Number>::unit_vector(unsigned int i)
{
Point<dim, Number> p;
p[i] = 1.;
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Number Point<dim, Number>::operator()(
+constexpr DEAL_II_HOST_DEVICE Number Point<dim, Number>::operator()(
const unsigned int index) const
{
AssertIndexRange(static_cast<int>(index), dim);
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Number &Point<dim, Number>::operator()(
+constexpr DEAL_II_HOST_DEVICE Number &Point<dim, Number>::operator()(
const unsigned int index)
{
AssertIndexRange(static_cast<int>(index), dim);
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
template <typename OtherNumber>
-inline DEAL_II_ALWAYS_INLINE Point<dim, Number> &Point<dim, Number>::operator=(
- const Tensor<1, dim, OtherNumber> &p)
+constexpr DEAL_II_ALWAYS_INLINE Point<dim, Number>
+ &Point<dim, Number>::operator=(const Tensor<1, dim, OtherNumber> &p)
{
Tensor<1, dim, Number>::operator=(p);
return *this;
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number> Point<dim, Number>::operator+(
+constexpr DEAL_II_HOST_DEVICE Point<dim, Number> Point<dim, Number>::operator+(
const Tensor<1, dim, Number> &p) const
{
Point<dim, Number> tmp = *this;
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Tensor<1, dim, Number> Point<dim, Number>::operator-(
- const Point<dim, Number> &p) const
+constexpr DEAL_II_HOST_DEVICE
+ Tensor<1, dim, Number> Point<dim, Number>::operator-(
+ const Point<dim, Number> &p) const
{
return (Tensor<1, dim, Number>(*this) -= p);
}
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number> Point<dim, Number>::operator-(
+constexpr DEAL_II_HOST_DEVICE Point<dim, Number> Point<dim, Number>::operator-(
const Tensor<1, dim, Number> &p) const
{
Point<dim, Number> tmp = *this;
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Point<dim, Number> Point<dim, Number>::operator-()
+constexpr DEAL_II_HOST_DEVICE Point<dim, Number> Point<dim, Number>::operator-()
const
{
Point<dim, Number> result;
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
template <typename OtherNumber>
-inline DEAL_II_HOST_DEVICE Point<
+constexpr DEAL_II_HOST_DEVICE Point<
dim,
typename ProductType<Number, typename EnableIfScalar<OtherNumber>::type>::
type> Point<dim, Number>::operator*(const OtherNumber factor) const
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
template <typename OtherNumber>
-inline DEAL_II_HOST_DEVICE Point<
+constexpr DEAL_II_HOST_DEVICE Point<
dim,
typename ProductType<Number, typename EnableIfScalar<OtherNumber>::type>::
type> Point<dim, Number>::operator/(const OtherNumber factor) const
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE Number Point<dim, Number>::operator*(
+constexpr DEAL_II_HOST_DEVICE Number Point<dim, Number>::operator*(
const Tensor<1, dim, Number> &p) const
{
Number res = Number();
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE typename numbers::NumberTraits<Number>::real_type
+constexpr DEAL_II_HOST_DEVICE typename numbers::NumberTraits<Number>::real_type
Point<dim, Number>::square() const
{
return this->norm_square();
template <int dim, typename Number>
DEAL_II_CXX20_REQUIRES(dim >= 0)
-inline DEAL_II_HOST_DEVICE typename numbers::NumberTraits<Number>::real_type
+constexpr DEAL_II_HOST_DEVICE typename numbers::NumberTraits<Number>::real_type
Point<dim, Number>::distance_square(const Point<dim, Number> &p) const
{
Number sum = internal::NumberType<Number>::value(0.0);
* @relates Point
*/
template <int dim, typename Number, typename OtherNumber>
-inline DEAL_II_HOST_DEVICE
+constexpr DEAL_II_HOST_DEVICE
Point<dim,
typename ProductType<Number,
typename EnableIfScalar<OtherNumber>::type>::type>