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

#include <geometryroot.h>

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

Public Member Functions

 SolverAnalyticBoxSurface (const MFloat *const bbox)
 
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_bbox [2 *nDim]
 

Detailed Description

template<MInt nDim>
class SolverAnalyticBoxSurface< nDim >

Definition at line 58 of file geometryroot.h.

Constructor & Destructor Documentation

◆ SolverAnalyticBoxSurface()

template<MInt nDim>
SolverAnalyticBoxSurface< nDim >::SolverAnalyticBoxSurface ( const MFloat *const  bbox)

Definition at line 86 of file geometryroot.cpp.

86 {
87 for(MInt i = 0; i < nDim; i++) {
88 if(bbox[i + nDim] < bbox[i]) mTerm(1, AT_, "invalid bounding box");
89 m_bbox[i] = bbox[i];
90 m_bbox[i + nDim] = bbox[i + nDim];
91 }
92}
MFloat m_bbox[2 *nDim]
Definition: geometryroot.h:68
void mTerm(const MInt errorCode, const MString &location, const MString &message)
Definition: functions.cpp:29
int32_t MInt
Definition: maiatypes.h:62

Member Function Documentation

◆ boundingBox()

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

Reimplemented from SolverSurface.

Definition at line 100 of file geometryroot.cpp.

100 {
101 for(MInt dim = 0; dim < nDim; dim++) {
102 bbox[dim] = m_bbox[dim];
103 bbox[dim + nDim] = m_bbox[dim + nDim];
104 }
105}

◆ countLineIntersectingElements()

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

Reimplemented from SolverSurface.

Definition at line 127 of file geometryroot.cpp.

127 {
128 // check both ends of the line
129 const MBool p1_inside = maia::geom::isPointInsideBox<MFloat, nDim>(line, m_bbox);
130 const MBool p2_inside = maia::geom::isPointInsideBox<MFloat, nDim>(line + nDim, m_bbox);
131
132 if(p1_inside && p2_inside) return 0;
133
134 if(p1_inside != p2_inside) return 1;
135
136 // in case both end are outside we need to take a look
137 if(maia::geom::doesLinePenetrateBox<nDim>(line, m_bbox))
138 return 2;
139 else
140 return 0;
141}
bool MBool
Definition: maiatypes.h:58

◆ getCellIntersectingElements()

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

Reimplemented from SolverSurface.

Definition at line 108 of file geometryroot.cpp.

110 {
111 MFloat cell_bbox[2 * nDim];
112 for(MInt dim = 0; dim < nDim; dim++) {
113 cell_bbox[dim] = cell_coords[dim] - cellHalfLength;
114 cell_bbox[dim + nDim] = cell_coords[dim] + cellHalfLength;
115 }
116
117 if(maia::geom::doBoxesOverlap<MFloat, nDim>(cell_bbox, m_bbox)
118 && !maia::geom::isBoxInsideBox<MFloat, nDim>(cell_bbox, m_bbox)) {
119 cutInfo[0] = true;
120 } else {
121 cutInfo[0] = false;
122 }
123 return cutInfo[0];
124}
double MFloat
Definition: maiatypes.h:52

◆ noSegments()

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

Reimplemented from SolverSurface.

Definition at line 95 of file geometryroot.cpp.

95 {
96 return 1;
97}

Member Data Documentation

◆ m_bbox

template<MInt nDim>
MFloat SolverAnalyticBoxSurface< nDim >::m_bbox[2 *nDim]
private

Definition at line 68 of file geometryroot.h.


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