Discontinuous Galerkin Library
#include "dg/algorithm.h"
dg::PolynomialHeaviside Struct Reference

\( f(x) = \begin{cases} 0 \text{ if } x < x_b-a \\ ((16 a^3 - 29 a^2 (x - x_b) + 20 a (x - x_b)^2 - 5 (x - x_b)^3) (a + x - x_b)^4)/(32 a^7) \text{ if } |x-x_b| < a \\ 1 \text{ if } x > x_b + a \end{cases}\) More...

Public Member Functions

 PolynomialHeaviside (double xb, double a, int sign=+1)
 Construct with xb, width and sign. More...
 
DG_DEVICE double operator() (double x) const
 
DG_DEVICE double operator() (double x, double y) const
 
DG_DEVICE double operator() (double x, double y, double z) const
 

Detailed Description

\( f(x) = \begin{cases} 0 \text{ if } x < x_b-a \\ ((16 a^3 - 29 a^2 (x - x_b) + 20 a (x - x_b)^2 - 5 (x - x_b)^3) (a + x - x_b)^4)/(32 a^7) \text{ if } |x-x_b| < a \\ 1 \text{ if } x > x_b + a \end{cases}\)

An approximation to Heaviside using polynomials. This function is 3 times continuously differentiable, takes the value 0.5 at xb and has a transition width a on both sides of xb.

Constructor & Destructor Documentation

◆ PolynomialHeaviside()

dg::PolynomialHeaviside::PolynomialHeaviside ( double  xb,
double  a,
int  sign = +1 
)
inline

Construct with xb, width and sign.

Parameters
xbboundary value
atransition width (must be != 0)
signeither +1 (original Heaviside) or -1 (the function is mirrored at the x=xb axis: f(2xb-x))
Note
When sign is positive the function leaves the positive and damps the negative and vice versa when sign is negative the function leaves the negative and damps the positive.

Member Function Documentation

◆ operator()() [1/3]

DG_DEVICE double dg::PolynomialHeaviside::operator() ( double  x) const
inline

◆ operator()() [2/3]

DG_DEVICE double dg::PolynomialHeaviside::operator() ( double  x,
double  y 
) const
inline

◆ operator()() [3/3]

DG_DEVICE double dg::PolynomialHeaviside::operator() ( double  x,
double  y,
double  z 
) const
inline

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