MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
maia::filter::slope Namespace Reference

Namespaces

namespace  detail_
 

Functions

template<typename T >
linear (const T a, const T b, const T x)
 Linear slope filter. More...
 
template<typename T >
linear2way (const T a, const T b, const T c, const T d, const T x)
 
template<MInt nDim, typename T >
linearbox (const T *const boxmin, const T *const boxmax, const T width, const T *const x)
 
template<MInt nDim, typename T >
linearmultibox (const T *const boxmin, const T *const boxmax, const T *const width, const T *const x)
 
template<MInt nDim, typename T >
linearsphere (const T *const center, const T radius, const T width, const T *const x)
 
template<typename T >
cos (const T a, const T b, const T x)
 Cosine slope filter. More...
 
template<typename T >
cos2way (const T a, const T b, const T c, const T d, const T x)
 
template<MInt nDim, typename T >
cosbox (const T *const boxmin, const T *const boxmax, const T width, const T *const x)
 
template<MInt nDim, typename T >
cosmultibox (const T *const boxmin, const T *const boxmax, const T *const width, const T *const x)
 
template<MInt nDim, typename T >
cossphere (const T *const center, const T radius, const T width, const T *const x)
 
template<MInt nDim, typename T >
coscylinderzaxis (const T *const center, const T radius, const T width, const T *const x)
 

Function Documentation

◆ cos()

template<typename T >
T maia::filter::slope::cos ( const T  a,
const T  b,
const T  x 
)
Author
Michael Schlottke (mic) mic@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2014-08-11
Template Parameters
TDatatype that supports substraction and divison.
Parameters
[in]aBeginning of slope.
[in]bEnd of slope.
[in]xPoint to interpolate.
Returns
0.0 if x < a, 1.0 if x > b, value between 0.0 and 1.0 otherwise.

Definition at line 125 of file filter.h.

125 {
126 if(x < a) {
127 return 0.0;
128 } else if(x > b) {
129 return 1.0;
130 } else {
131 return 0.5 * std::cos(PI / (b - a) * (x - b)) + 0.5;
132 }
133}
Definition: contexttypes.h:19

◆ cos2way()

template<typename T >
T maia::filter::slope::cos2way ( const T  a,
const T  b,
const T  c,
const T  d,
const T  x 
)

Definition at line 136 of file filter.h.

136 {
137 return detail_::f2way(a, b, c, d, x, &cos<T>);
138}

◆ cosbox()

template<MInt nDim, typename T >
T maia::filter::slope::cosbox ( const T *const  boxmin,
const T *const  boxmax,
const T  width,
const T *const  x 
)

Definition at line 141 of file filter.h.

141 {
142 return detail_::fbox<nDim>(boxmin, boxmax, width, x, &cos<T>);
143}

◆ coscylinderzaxis()

template<MInt nDim, typename T >
T maia::filter::slope::coscylinderzaxis ( const T *const  center,
const T  radius,
const T  width,
const T *const  x 
)

Definition at line 156 of file filter.h.

156 {
157 return detail_::fsphere<nDim>(center, radius, width, x, &cos<T>);
158}

◆ cosmultibox()

template<MInt nDim, typename T >
T maia::filter::slope::cosmultibox ( const T *const  boxmin,
const T *const  boxmax,
const T *const  width,
const T *const  x 
)

Definition at line 146 of file filter.h.

146 {
147 return detail_::fmultibox<nDim>(boxmin, boxmax, width, x, &cos<T>);
148}

◆ cossphere()

template<MInt nDim, typename T >
T maia::filter::slope::cossphere ( const T *const  center,
const T  radius,
const T  width,
const T *const  x 
)

Definition at line 151 of file filter.h.

151 {
152 return detail_::fsphere<nDim>(center, radius, width, x, &cos<T>);
153}

◆ linear()

template<typename T >
T maia::filter::slope::linear ( const T  a,
const T  b,
const T  x 
)
Author
Michael Schlottke (mic) mic@a.nosp@m.ia.r.nosp@m.wth-a.nosp@m.ache.nosp@m.n.de
Date
2014-08-11
Template Parameters
TDatatype that supports substraction and divison.
Parameters
[in]aBeginning of slope.
[in]bEnd of slope.
[in]xPoint to interpolate.
Returns
0.0 if x < a, 1.0 if x > b, value between 0.0 and 1.0 otherwise.

Definition at line 83 of file filter.h.

83 {
84 if(x < a) {
85 return 0.0;
86 } else if(x > b) {
87 return 1.0;
88 } else {
89 return (x - a) / (b - a);
90 }
91}

◆ linear2way()

template<typename T >
T maia::filter::slope::linear2way ( const T  a,
const T  b,
const T  c,
const T  d,
const T  x 
)

Definition at line 94 of file filter.h.

94 {
95 return detail_::f2way(a, b, c, d, x, &linear<T>);
96}

◆ linearbox()

template<MInt nDim, typename T >
T maia::filter::slope::linearbox ( const T *const  boxmin,
const T *const  boxmax,
const T  width,
const T *const  x 
)

Definition at line 99 of file filter.h.

99 {
100 return detail_::fbox<nDim>(boxmin, boxmax, width, x, &linear<T>);
101}

◆ linearmultibox()

template<MInt nDim, typename T >
T maia::filter::slope::linearmultibox ( const T *const  boxmin,
const T *const  boxmax,
const T *const  width,
const T *const  x 
)

Definition at line 104 of file filter.h.

104 {
105 return detail_::fmultibox<nDim>(boxmin, boxmax, width, x, &linear<T>);
106}

◆ linearsphere()

template<MInt nDim, typename T >
T maia::filter::slope::linearsphere ( const T *const  center,
const T  radius,
const T  width,
const T *const  x 
)

Definition at line 109 of file filter.h.

109 {
110 return detail_::fsphere<nDim>(center, radius, width, x, &linear<T>);
111}