33 <<
"The radius <" << arg1 <<
"> can not be negative.");
37 <<
"The azimuth angle <" << arg1 <<
"> is not in [0,2Pi).");
41 <<
"The polar angle <" << arg1 <<
"> is not in [0,Pi].");
45 std::array<double, dim>
48 std::array<double, dim> scoord{};
52 if constexpr (dim > 1)
54 scoord[0] = position.
norm();
56 scoord[1] = std::atan2(position[1], position[0]);
63 if constexpr (dim == 3)
66 if (scoord[0] > std::numeric_limits<double>::min())
67 scoord[2] =
std::acos(position[2] / scoord[0]);
74 template <std::
size_t dim>
89 ccoord[0] = scoord[0] *
std::cos(scoord[1]);
90 ccoord[1] = scoord[0] *
std::sin(scoord[1]);
100 ccoord[2] = scoord[0] *
std::cos(scoord[2]);
112#include "geometric_utilities.inst"
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & SphericalAzimuth(double arg1)
static ::ExceptionBase & NegativeRadius(double arg1)
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & SphericalPolar(double arg1)
#define DeclException1(Exception1, type1, outsequence)
#define DEAL_II_NOT_IMPLEMENTED()
Point< dim > from_spherical(const std::array< double, dim > &scoord)
std::array< double, dim > to_spherical(const Point< dim > &point)
static constexpr double PI
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
inline ::VectorizedArray< Number, width > acos(const ::VectorizedArray< Number, width > &x)