Discontinuous Galerkin Library
#include "dg/algorithm.h"

\( f(x) = \begin{cases} 0 \text{ if } x < x_b \\ 1 \text{ else} \end{cases}\) More...

Public Member Functions

 Heaviside (double xb, int sign=+1)
 Construct with xb and sign. More...
 
DG_DEVICE double operator() (double x) const
 

Detailed Description

\( f(x) = \begin{cases} 0 \text{ if } x < x_b \\ 1 \text{ else} \end{cases}\)

Note
the 1 is inclusive i.e if x==x_b the functor always returns 1

Constructor & Destructor Documentation

◆ Heaviside()

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

Construct with xb and sign.

Parameters
xbboundary value
signeither +1 or -1, If -1, we mirror the Heaviside at the x=x_b axis, i.e. we swap the < sign in the definition to >
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()()

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

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