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

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

Public Member Functions

 PolynomialRectangle (double xl, double al, double xr, double ar)
 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_l-a_l \\ ((16 a_l^3 - 29 a_l^2 (x - x_l) + 20 a_l (x - x_l)^2 - 5 (x - x_l)^3) (a_l + x - x_l)^4)/(32 a_l^7) \text{ if } |x-x_l| < a_l \\ 1 \text{ if } x_l + a_l < x < x_r-a_r \\ ((16 a_r^3 - 29 a_r^2 (x - x_r) + 20 a_r (x - x_r)^2 - 5 (x - x_r)^3) (a_r + x - x_l)^4)/(32 a_r^7) \text{ if } |x-x_r| < a_r \\ 0 \text{ if } x > x_r + a_r \end{cases}\)

An approximation to the Rectangle function using polynomials Basically just the product of two PolynomialHeaviside functions

This function is 3 times continuously differentiable, takes the value 0.5 at xl and xr and has a transition width a_l on both sides of xl and a width a_r on both sides of xr.

Constructor & Destructor Documentation

◆ PolynomialRectangle()

dg::PolynomialRectangle::PolynomialRectangle ( double  xl,
double  al,
double  xr,
double  ar 
)
inline

Construct with xb, width and sign.

Parameters
xlleft boundary value
alleft transition width (must be != 0)
xrright boundary value
arright transition width (must be != 0)

Member Function Documentation

◆ operator()() [1/3]

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

◆ operator()() [2/3]

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

◆ operator()() [3/3]

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

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