MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
pointbox.h File Reference

Go to the source code of this file.

Classes

struct  Point< DIM >
 
struct  Box< DIM >
 

Functions

template<MInt DIM>
MFloat dist (const Point< DIM > &p, const Point< DIM > &q)
 
template<MInt DIM>
MFloat dist (const Box< DIM > &b, const Point< DIM > &p)
 

Function Documentation

◆ dist() [1/2]

template<MInt DIM>
MFloat dist ( const Box< DIM > &  b,
const Point< DIM > &  p 
)

Definition at line 62 of file pointbox.h.

62 {
63 MFloat dd = 0;
64 for(MInt i = 0; i < DIM; i++) {
65 if(p.x[i] < b.lo.x[i]) dd += std::pow(p.x[i] - b.lo.x[i], 2);
66 if(p.x[i] > b.hi.x[i]) dd += std::pow(p.x[i] - b.hi.x[i], 2);
67 }
68 return std::sqrt(dd);
69}
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
constexpr std::underlying_type< FcCell >::type p(const FcCell property)
Converts property name to underlying integer value.

◆ dist() [2/2]

template<MInt DIM>
MFloat dist ( const Point< DIM > &  p,
const Point< DIM > &  q 
)

Definition at line 54 of file pointbox.h.

54 {
55 MFloat dd = 0.0;
56 for(MInt j = 0; j < DIM; j++) {
57 dd += std::pow(q.x[j] - p.x[j], 2);
58 }
59 return std::sqrt(dd);
60}
MFloat x[DIM]
Definition: pointbox.h:21