Loading [MathJax]/extensions/tex2jax.js
MAIA bb96820c
Multiphysics at AIA
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
GeometryIntersection< nDim_ >::CsgVector Class Reference
Collaboration diagram for GeometryIntersection< nDim_ >::CsgVector:
[legend]

Public Member Functions

 CsgVector ()=default
 
 CsgVector (const std::array< MFloat, nDim > X)
 
 CsgVector (const CsgVector &Y)
 
 CsgVector (CsgVector &&)=default
 
CsgVectoroperator= (const CsgVector &)=default
 
CsgVectoroperator= (CsgVector &&)=default
 
CsgVector clone () const
 
CsgVector plus (const CsgVector &a) const
 
CsgVector minus (const CsgVector &a) const
 
CsgVector times (const MFloat a) const
 
CsgVector dividedBy (const MFloat a) const
 
MFloat dot (const CsgVector &a) const
 
CsgVector lerp (const CsgVector &a, const MFloat t) const
 
MFloat length () const
 
CsgVector unit () const
 
template<class T = CsgVector>
std::enable_if< nDim_==3, T >::type cross (const CsgVector a) const
 
void negate ()
 

Public Attributes

std::array< MFloat, nDimxx = make_array<MFloat, nDim>(0.0)
 

Detailed Description

template<MInt nDim_>
class GeometryIntersection< nDim_ >::CsgVector

Definition at line 419 of file geometryintersection.h.

Constructor & Destructor Documentation

◆ CsgVector() [1/4]

template<MInt nDim_>
GeometryIntersection< nDim_ >::CsgVector::CsgVector ( )
default

◆ CsgVector() [2/4]

template<MInt nDim_>
GeometryIntersection< nDim_ >::CsgVector::CsgVector ( const std::array< MFloat, nDim X)
inlineexplicit

Definition at line 424 of file geometryintersection.h.

424{ xx = X; }
std::array< MFloat, nDim > xx

◆ CsgVector() [3/4]

template<MInt nDim_>
GeometryIntersection< nDim_ >::CsgVector::CsgVector ( const CsgVector Y)
inline

Definition at line 425 of file geometryintersection.h.

425{ xx = Y.xx; }

◆ CsgVector() [4/4]

template<MInt nDim_>
GeometryIntersection< nDim_ >::CsgVector::CsgVector ( CsgVector &&  )
default

Member Function Documentation

◆ clone()

template<MInt nDim_>
CsgVector GeometryIntersection< nDim_ >::CsgVector::clone ( ) const
inline

Definition at line 430 of file geometryintersection.h.

430 {
431 CsgVector tmp(xx);
432 return tmp;
433 }

◆ cross()

template<MInt nDim_>
template<class T = CsgVector>
std::enable_if< nDim_==3, T >::type GeometryIntersection< nDim_ >::CsgVector::cross ( const CsgVector  a) const
inline

Definition at line 469 of file geometryintersection.h.

469 {
470 ASSERT(nDim == 3, "");
471 CsgVector tmp;
472 tmp.xx[0] = this->xx[1] * a.xx[2] - this->xx[2] * a.xx[1];
473 tmp.xx[1] = this->xx[2] * a.xx[0] - this->xx[0] * a.xx[2];
474 tmp.xx[2] = this->xx[0] * a.xx[1] - this->xx[1] * a.xx[0];
475 return tmp;
476 }
static constexpr MInt nDim
Definition: contexttypes.h:19

◆ dividedBy()

template<MInt nDim_>
CsgVector GeometryIntersection< nDim_ >::CsgVector::dividedBy ( const MFloat  a) const
inline

Definition at line 452 of file geometryintersection.h.

452 {
453 CsgVector tmp(xx);
454 for(MInt i = 0; i < nDim; i++)
455 tmp.xx[i] = this->xx[i] / a;
456 return tmp;
457 }
int32_t MInt
Definition: maiatypes.h:62

◆ dot()

template<MInt nDim_>
MFloat GeometryIntersection< nDim_ >::CsgVector::dot ( const CsgVector a) const
inline

Definition at line 458 of file geometryintersection.h.

458 {
459 MFloat dotp = F0;
460 for(MInt i = 0; i < nDim; i++)
461 dotp += this->xx[i] * a.xx[i];
462 return dotp;
463 }
double MFloat
Definition: maiatypes.h:52

◆ length()

template<MInt nDim_>
MFloat GeometryIntersection< nDim_ >::CsgVector::length ( ) const
inline

Definition at line 465 of file geometryintersection.h.

465{ return sqrt(this->dot(*this)); }
MFloat dot(const CsgVector &a) const

◆ lerp()

template<MInt nDim_>
CsgVector GeometryIntersection< nDim_ >::CsgVector::lerp ( const CsgVector a,
const MFloat  t 
) const
inline

Definition at line 464 of file geometryintersection.h.

464{ return this->plus((a.minus(*this)).times(t)); }
CsgVector plus(const CsgVector &a) const

◆ minus()

template<MInt nDim_>
CsgVector GeometryIntersection< nDim_ >::CsgVector::minus ( const CsgVector a) const
inline

Definition at line 440 of file geometryintersection.h.

440 {
441 CsgVector tmp(xx);
442 for(MInt i = 0; i < nDim; i++)
443 tmp.xx[i] = this->xx[i] - a.xx[i];
444 return tmp;
445 }

◆ negate()

template<MInt nDim_>
void GeometryIntersection< nDim_ >::CsgVector::negate ( )
inline

Definition at line 477 of file geometryintersection.h.

477 {
478 for(MInt i = 0; i < nDim; i++)
479 this->xx[i] = -this->xx[i];
480 }

◆ operator=() [1/2]

template<MInt nDim_>
CsgVector & GeometryIntersection< nDim_ >::CsgVector::operator= ( const CsgVector )
default

◆ operator=() [2/2]

template<MInt nDim_>
CsgVector & GeometryIntersection< nDim_ >::CsgVector::operator= ( CsgVector &&  )
default

◆ plus()

template<MInt nDim_>
CsgVector GeometryIntersection< nDim_ >::CsgVector::plus ( const CsgVector a) const
inline

Definition at line 434 of file geometryintersection.h.

434 {
435 CsgVector tmp(xx);
436 for(MInt i = 0; i < nDim; i++)
437 tmp.xx[i] = this->xx[i] + a.xx[i];
438 return tmp;
439 }

◆ times()

template<MInt nDim_>
CsgVector GeometryIntersection< nDim_ >::CsgVector::times ( const MFloat  a) const
inline

Definition at line 446 of file geometryintersection.h.

446 {
447 CsgVector tmp(xx);
448 for(MInt i = 0; i < nDim; i++)
449 tmp.xx[i] = this->xx[i] * a;
450 return tmp;
451 }

◆ unit()

template<MInt nDim_>
CsgVector GeometryIntersection< nDim_ >::CsgVector::unit ( ) const
inline

Definition at line 466 of file geometryintersection.h.

466{ return this->dividedBy(this->length()); }
CsgVector dividedBy(const MFloat a) const

Member Data Documentation

◆ xx

template<MInt nDim_>
std::array<MFloat, nDim> GeometryIntersection< nDim_ >::CsgVector::xx = make_array<MFloat, nDim>(0.0)

Definition at line 421 of file geometryintersection.h.


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