MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
SolverAnalyticSphereSurface< nDim > Class Template Reference

#include <geometryroot.h>

Inheritance diagram for SolverAnalyticSphereSurface< nDim >:
[legend]
Collaboration diagram for SolverAnalyticSphereSurface< nDim >:
[legend]

Public Member Functions

 SolverAnalyticSphereSurface (const MFloat *const c, const MFloat R)
 
MBool getCellIntersectingElements (const MFloat *const cell_coords, const MFloat cellHalfLength, MBool *const cutInfo)
 
MInt countLineIntersectingElements (const MFloat *const line)
 
void boundingBox (MFloat *const bbox)
 
MInt noSegments ()
 
- Public Member Functions inherited from SolverSurface
 SolverSurface ()
 
virtual MBool getCellIntersectingElements (const MFloat *const, const MFloat, MBool *const)
 
virtual MInt countLineIntersectingElements (const MFloat *const)
 
virtual void boundingBox (MFloat *const)
 
virtual MInt noSegments ()
 
virtual void setGeometryPointer (Geometry< 2 > *&)
 
virtual void setGeometryPointer (Geometry< 3 > *&)
 

Private Attributes

MFloat m_center [nDim]
 
MFloat m_radius
 

Detailed Description

template<MInt nDim>
class SolverAnalyticSphereSurface< nDim >

Definition at line 72 of file geometryroot.h.

Constructor & Destructor Documentation

◆ SolverAnalyticSphereSurface()

template<MInt nDim>
SolverAnalyticSphereSurface< nDim >::SolverAnalyticSphereSurface ( const MFloat *const  c,
const MFloat  R 
)

Definition at line 146 of file geometryroot.cpp.

146 {
147 for(MInt i = 0; i < nDim; i++) {
148 m_center[i] = c[i];
149 }
150 m_radius = R;
151}
int32_t MInt
Definition: maiatypes.h:62

Member Function Documentation

◆ boundingBox()

template<MInt nDim>
void SolverAnalyticSphereSurface< nDim >::boundingBox ( MFloat *const  bbox)
virtual

Reimplemented from SolverSurface.

Definition at line 159 of file geometryroot.cpp.

159 {
160 for(MInt dim = 0; dim < nDim; dim++) {
161 bbox[dim] = m_center[dim] - m_radius;
162 bbox[dim + nDim] = m_center[dim] + m_radius;
163 }
164}

◆ countLineIntersectingElements()

template<MInt nDim>
MInt SolverAnalyticSphereSurface< nDim >::countLineIntersectingElements ( const MFloat *const  line)
virtual

Reimplemented from SolverSurface.

Definition at line 186 of file geometryroot.cpp.

186 {
187 if(!maia::geom::doesLinePenetrateSphere<nDim>(line, m_center, m_radius)) return 0;
188
189 // check start of line
190 const MBool p1_inside = maia::geom::isPointInsideSphere<nDim>(line, m_center, m_radius);
191
192 if(p1_inside) return 1;
193
194 // check end of line
195 const MBool p2_inside = maia::geom::isPointInsideSphere<nDim>(line + nDim, m_center, m_radius);
196
197 if(p2_inside)
198 return 1;
199 else
200 return 2;
201}
bool MBool
Definition: maiatypes.h:58

◆ getCellIntersectingElements()

template<MInt nDim>
MBool SolverAnalyticSphereSurface< nDim >::getCellIntersectingElements ( const MFloat *const  cell_coords,
const MFloat  cellHalfLength,
MBool *const  cutInfo 
)
virtual

Reimplemented from SolverSurface.

Definition at line 167 of file geometryroot.cpp.

169 {
170 MFloat cell_bbox[2 * nDim];
171 for(MInt dim = 0; dim < nDim; dim++) {
172 cell_bbox[dim] = cell_coords[dim] - cellHalfLength;
173 cell_bbox[dim + nDim] = cell_coords[dim] + cellHalfLength;
174 }
175
176 if(maia::geom::doBoxAndSphereOverlap<nDim>(cell_bbox, m_center, m_radius)
177 && !maia::geom::isBoxInsideSphere<nDim>(cell_bbox, m_center, m_radius)) {
178 cutInfo[0] = true;
179 } else {
180 cutInfo[0] = false;
181 }
182 return cutInfo[0];
183}
double MFloat
Definition: maiatypes.h:52

◆ noSegments()

template<MInt nDim>
MInt SolverAnalyticSphereSurface< nDim >::noSegments
virtual

Reimplemented from SolverSurface.

Definition at line 154 of file geometryroot.cpp.

154 {
155 return 1;
156}

Member Data Documentation

◆ m_center

template<MInt nDim>
MFloat SolverAnalyticSphereSurface< nDim >::m_center[nDim]
private

Definition at line 82 of file geometryroot.h.

◆ m_radius

template<MInt nDim>
MFloat SolverAnalyticSphereSurface< nDim >::m_radius
private

Definition at line 83 of file geometryroot.h.


The documentation for this class was generated from the following files: