4#include "sphereTopology.hh"
10#define CONCEPTS_SPHERECELL_D 1
44 inline bool hasChildren()
const {
return chld_.size() > 0; }
60 return mapping_.center_ + mapping_.radius_*
62 std::sin(
phi)*std::sin(theta),
71 if(
phi < 0.)
phi += 2*3.14159265358979323846264338328;
81 theta = 3.14159265358979323846264338328 - theta;
83 if( std::abs(
sphericalCoord[2]-1.) < 1e1*std::numeric_limits<concepts::Real>::epsilon()
84 || std::abs(
sphericalCoord[2]+1.) < 1e1*std::numeric_limits<concepts::Real>::epsilon()) {
85 static std::default_random_engine
engine_;
86 static std::uniform_real_distribution<concepts::Real>
distribution_(0.,2.*3.14159265358979323846264338328);
89 if( std::isnan( theta ) ) {
90 if(std::abs(
sphericalCoord[2]-1.)<1e1*std::numeric_limits<concepts::Real>::epsilon())
91 theta = 1e1*std::numeric_limits<concepts::Real>::epsilon();
92 else if(std::abs(
sphericalCoord[2]+1.)<1e1*std::numeric_limits<concepts::Real>::epsilon())
93 theta = 3.14159265358979323846264338328-1e1*std::numeric_limits<concepts::Real>::epsilon();
103 return mapping_.radius_*mapping_.radius_*std::sin(
coord_local[0]); }
105 Real getRadius()
const {
return mapping_.radius_; }
107 Real3d getCenter()
const {
return mapping_.center_; }
109 std::ostream&
info(std::ostream&
os)
const override;
115 std::vector<Quad2d*> chld_;
141 inline bool hasChildren()
const {
return false; }
158 return mapping_.center_ + mapping_.radius_*radius*
160 std::sin(
phi)*std::sin(theta),
174 if(
phi < 0.)
phi += 2*3.14159265358979323846264338328;
184 theta = 3.14159265358979323846264338328 - theta;
186 if( std::abs(
sphericalCoord[2]-1.) < 1e1*std::numeric_limits<concepts::Real>::epsilon()
187 || std::abs(
sphericalCoord[2]+1.) < 1e1*std::numeric_limits<concepts::Real>::epsilon()) {
188 static std::default_random_engine
engine_;
189 static std::uniform_real_distribution<concepts::Real>
distribution_(0.,2.*3.14159265358979323846264338328);
193 if( std::isnan( theta ) ) {
194 if(std::abs(
sphericalCoord[2]-1.)<1e1*std::numeric_limits<concepts::Real>::epsilon())
195 theta = 1e1*std::numeric_limits<concepts::Real>::epsilon();
196 else if(std::abs(
sphericalCoord[2]+1.)<1e1*std::numeric_limits<concepts::Real>::epsilon())
197 theta = 3.14159265358979323846264338328-1e1*std::numeric_limits<concepts::Real>::epsilon();
199 if ( !(
phi >= 0. &&
phi <= 2*3.14159265358979323846264338328) ) {
200 DEBUGL(1,
"Phi value out of range: " <<
phi <<
".");
212 return mapping_.radius_*mapping_.radius_*
215 Real getRadius()
const {
return mapping_.radius_; }
217 Real3d getCenter()
const {
return mapping_.center_; }
219 std::ostream&
info(std::ostream&
os)
const override;
std::ostream & info(std::ostream &os) const override
Returns information in an output stream.
Real3d elemMap(const Real3d &coord_local) const override
Element map from point local coordinates in 3D.
Sphere & connector() const override
Returns the connector.
Real3d inverseElemMap(const Real3d &coord_global) const
Real3d elemMap(const Real coord_local) const override
Element map from point local coordinates in 1D.
Quad2d * child(uint i) override
Real3d elemMap(const Real2d &coord_local) const override
Element map from point local coordinates in 2D.
const Cell * child(uint i) const override
Real3d elemMap(const Real3d &coord_local) const override
Element map from point local coordinates in 3D.
Real3d elemMap(const Real2d &coord_local) const override
Element map from point local coordinates in 2D.
SphericalSurface & connector() const override
Returns the connector.
Quad2d * child(uint i) override
const Quad2d * child(uint i) const override
std::ostream & info(std::ostream &os) const override
Returns information in an output stream.
Real2d inverseElemMap(const Real3d &coord_global) const
Real3d elemMap(const Real coord_local) const override
Element map from point local coordinates in 1D.
#define conceptsAssert(cond, exc)
#define DEBUGL(doit, msg)
Set< F > makeSet(uint n, const F &first,...)