Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
#include <cmath>
#include <vector>
#include <random>
#include <functional>
#include "blas1.h"
#include "topology/grid.h"
#include "topology/evaluation.h"
#include "topology/functions.h"
Go to the source code of this file.
Classes | |
struct | dg::ZERO |
\( f(x) = f(x,y) = f(x,y,z) = 0\) More... | |
struct | dg::ONE |
\( f(x) = f(x,y) = f(x,y,z) = 1\) More... | |
struct | dg::CONSTANT |
\( f(x) = f(x,y) = f(x,y,z) = c\) More... | |
struct | dg::PLUS< T > |
\( f(x) = x + c\) More... | |
struct | dg::EXP< T > |
\( f(x) = \exp( x)\) More... | |
struct | dg::LN< T > |
\( f(x) = \ln(x)\) More... | |
struct | dg::SQRT< T > |
\( f(x) = \sqrt{x}\) More... | |
struct | dg::Square |
\( f(x) = x^2\) More... | |
struct | dg::InvSqrt< T > |
\( f(x) = \frac{1}{\sqrt{x}}\) More... | |
struct | dg::INVERT< T > |
\( f(x) = 1/x \) More... | |
struct | dg::ABS< T > |
\( f(x) = |x|\) More... | |
struct | dg::Sign< T > |
\( f(x) = \text{sgn}(x) = \begin{cases} -1 \text{ for } x < 0 \\ 0 \text{ for } x = 0 \\ +1 \text{ for } x > 0 \end{cases}\) More... | |
struct | dg::AbsMax< T > |
\( f(x,y) = \max(|x|,|y|)\) More... | |
struct | dg::AbsMin< T > |
\( f(x,y) = \min(|x|,|y|)\) More... | |
struct | dg::POSVALUE< T > |
\( f(x) = \begin{cases} x \text{ for } x>0 \\ 0 \text{ else} \end{cases} \) More... | |
struct | dg::MOD< T > |
\( f(x) = \) x mod m > 0 ? x mod m : x mod m + m More... | |
struct | dg::ISNFINITE< T > |
\( f(x) = \mathrm{!std::isfinite(x)}\) More... | |
struct | dg::ISNSANE< T > |
\( f(x) =\begin{cases} \mathrm{true\ if}\ |x| > 10^{100}\\ \mathrm{false\ else} \end{cases}\) More... | |
struct | dg::MinMod |
\( f(x_1, x_2, ...) = \begin{cases} \min(x_1, x_2, ...) &\text{ for } x_1, x_2, ... >0 \\ \max(x_1, x_2, ...) &\text{ for } x_1, x_2, ... <0 \\ 0 &\text{ else} \end{cases} \) More... | |
struct | dg::VanLeer |
\( f(x_1,x_2) = 2\begin{cases} \frac{x_1x_2}{x_1+x_2} &\text{ if } x_1x_2 > 0 \\ 0 & \text { else } \end{cases} \) More... | |
struct | dg::Upwind |
\( \text{up}(v, b, f ) = \begin{cases} b &\text{ if } v \geq 0 \\ f &\text{ else} \end{cases} \) More... | |
struct | dg::UpwindProduct |
\( \text{up}(v, b, f ) = v \begin{cases} b &\text{ if } v \geq 0 \\ f &\text{ else} \end{cases} \) More... | |
struct | dg::SlopeLimiter< Limiter > |
\( \text{up}(v, g_m, g_0, g_p, h_m, h_p ) = \begin{cases} +h_m \Lambda( g_0, g_m) &\text{ if } v \geq 0 \\ -h_p \Lambda( g_p, g_0) &\text{ else} \end{cases} \) More... | |
struct | dg::SlopeLimiterProduct< Limiter > |
\( \text{up}(v, g_m, g_0, g_p, h_m, h_p ) = v \begin{cases} +h_m \Lambda( g_0, g_m) &\text{ if } v \geq 0 \\ -h_p \Lambda( g_p, g_0) &\text{ else} \end{cases} \) More... | |
struct | dg::Iris |
\( f(\psi) = \begin{cases} 1 \text{ if } \psi_{\min} < \psi < \psi_{\max}\\ 0 \text{ else} \end{cases}\) More... | |
struct | dg::Pupil |
\( f(\psi) = \begin{cases} 0 \text{ if } \psi > \psi_{\max} \\ 1 \text{ else} \end{cases}\) More... | |
struct | dg::PsiPupil |
\( f(\psi) = \begin{cases} \psi_{\max} \text{ if } \psi > \psi_{\max} \\ \psi \text{ else} \end{cases}\) More... | |
struct | dg::Heaviside |
\( f(x) = \begin{cases} 0 \text{ if } x < x_b \\ 1 \text{ else} \end{cases}\) More... | |
struct | dg::Distance |
\( f(x,y) = \sqrt{ (x-x_0)^2 + (y-y_0)^2} \) More... | |
struct | dg::Line |
\( f(x) = y_1\frac{x-x_0}{x_1-x_0} + y_0\frac{x-x_1}{x_0-x_1}\) More... | |
struct | dg::LinearX |
\( f(x) = f(x,y) = f(x,y,z) = ax+b \) More... | |
struct | dg::LinearY |
\( f(x,y) = f(x,y,z) = ay+b \) More... | |
struct | dg::LinearZ |
\( f(x,y,z) = az+b \) More... | |
struct | dg::Gaussian |
\( f(x,y) = Ae^{-\left(\frac{(x-x_0)^2}{2\sigma_x^2} + \frac{(y-y_0)^2}{2\sigma_y^2}\right)} \) More... | |
struct | dg::Cauchy |
\( f(x,y) = \begin{cases} Ae^{1 + \left(\frac{(x-x_0)^2}{\sigma_x^2} + \frac{(y-y_0)^2}{\sigma_y^2} - 1\right)^{-1}} \text{ if } \frac{(x-x_0)^2}{\sigma_x^2} + \frac{(y-y_0)^2}{\sigma_y^2} < 1\\ 0 \text{ else} \end{cases} \) More... | |
struct | dg::CauchyX |
\( f(x,y) = \begin{cases} Ae^{1 + \left(\frac{(x-x_0)^2}{\sigma_x^2} - 1\right)^{-1}} \text{ if } \frac{(x-x_0)^2}{\sigma_x^2} < 1\\ 0 \text{ else} \end{cases} \) More... | |
struct | dg::Gaussian3d |
\( f(x,y,z) = Ae^{-\left(\frac{(x-x_0)^2}{2\sigma_x^2} + \frac{(y-y_0)^2}{2\sigma_y^2} + \frac{(z-z_0)^2}{2\sigma_z^2}\right)} \) More... | |
struct | dg::GaussianX |
\( f(x,y) = Ae^{-\frac{(x-x_0)^2}{2\sigma_x^2} } \) More... | |
struct | dg::GaussianY |
\( f(x,y) = Ae^{-\frac{(y-y_0)^2}{2\sigma_y^2}} \) More... | |
struct | dg::GaussianZ |
\( f(x,y,z) = Ae^{-\frac{(z-z_0)^2}{2\sigma_z^2}} \) More... | |
struct | dg::IslandXY |
\( f(x,y) = \lambda \ln{(\cosh{(x/\lambda) } +\epsilon \cos(y/\lambda)) } \) More... | |
struct | dg::SinXSinY |
\( f(x,y) =B+ A \sin(k_x x) \sin(k_y y) \) More... | |
struct | dg::CosXCosY |
\( f(x,y) =B+ A \cos(k_x x) \cos(k_y y) \) More... | |
struct | dg::SinXCosY |
\( f(x,y) =B+ A \sin(k_x x) \cos(k_y y) \) More... | |
struct | dg::SinX |
\( f(x) = f(x,y) = f(x,y,z) =B+ A \sin(k_x x) \) More... | |
struct | dg::SinY |
\( f(x,y) =B+ A \sin(k_y y) \) More... | |
struct | dg::CosY |
\( f(x,y) =B+ A \cos(k_y y) \) More... | |
struct | dg::InvCoshXsq |
\( f(x,y) =A/\cosh^2(k_x x) \) More... | |
struct | dg::SinProfX |
\( f(x) = f(x,y) = f(x,y,z) = B + A(1 - \sin(k_xx )) \) More... | |
struct | dg::ExpProfX |
\( f(x) = f(x,y) = f(x,y,z) = A\exp(-x/L_n) + B \) More... | |
struct | dg::GaussianDamping |
\( f(\psi) = \begin{cases} 1 \text{ if } \psi < \psi_{\max}\\ 0 \text{ if } \psi > (\psi_{\max} + 4\alpha) \\ \exp\left( - \frac{(\psi - \psi_{\max})^2}{2\alpha^2}\right), \text{ else} \end{cases} \) More... | |
struct | dg::TanhProfX |
\( f(x) = B + 0.5 A(1+ \text{sign} \tanh((x-x_b)/\alpha ) ) \) More... | |
struct | dg::PolynomialHeaviside |
\( 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... | |
struct | dg::PolynomialRectangle |
\( 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... | |
struct | dg::IPolynomialHeaviside |
\( f(x) = \begin{cases} x_b \text{ if } x < x_b-a \\ x_b + ((35 a^3 - 47 a^2 (x - x_b) + 25 a (x - x_b)^2 - 5 (x - x_b)^3) (a + x - x_b)^5)/(256 a^7) \text{ if } |x-x_b| < a \\ x \text{ if } x > x_b + a \end{cases}\) The integral of PolynomialHeaviside approximates xH(x) More... | |
struct | dg::DPolynomialHeaviside |
\( f(x) = \begin{cases} 0 \text{ if } x < x_b-a || x > x_b+a \\ (35 (a + x - x_b)^3 (a - x + x_b)^3)/(32 a^7) \text{ if } |x-x_b| < a \end{cases}\) The derivative of PolynomialHeaviside approximates delta(x) More... | |
struct | dg::ExponentialFilter |
\( f(i) = \begin{cases} 1 \text{ if } \eta < \eta_c \\ \exp\left( -\alpha \left(\frac{\eta-\eta_c}{1-\eta_c} \right)^{2s}\right) \text { if } \eta \geq \eta_c \\ 0 \text{ else} \\ \eta=\frac{i}{1-n} \end{cases}\) More... | |
struct | dg::Lamb |
\( f(x,y) = \begin{cases} 2\lambda U J_1(\lambda r) / J_0(\gamma)\cos(\theta) \text{ for } r<R \\ 0 \text{ else} \end{cases} \) More... | |
struct | dg::Vortex |
\(f(x,y) =\begin{cases} \frac{u_d}{1.2965125} \left( r\left(1+\frac{\beta_i^2}{g_i^2}\right) - R \frac{\beta_i^2}{g_i^2} \frac{J_1(g_ir/R)}{J_1(g_i)}\right)\cos(\theta) \text{ if } r < R \\ \frac{u_d}{1.2965125} R \frac{K_1(\beta_i {r}/{R})}{K_1(\beta)} \cos(\theta) \text{ else } \end{cases} \) More... | |
struct | dg::BathRZ |
\(f(R,Z) = A B \sum_\vec{k} \sqrt{E_k} \alpha_k \cos{\left(k \kappa_k + \theta_k \right)} \) More... | |
struct | dg::Horner2d |
\( f(x,y) = \sum_{i=0}^{M-1} \sum_{j=0}^{N-1} c_{iN+j} x^i y^j \) More... | |
struct | dg::Histogram< container > |
Compute a histogram on a 1D grid. More... | |
struct | dg::Histogram2D< container > |
Compute a histogram on a 2D grid. More... | |
struct | dg::WallDistance |
Shortest Distance to a collection of vertical and horizontal lines. More... | |
Namespaces | |
namespace | dg |
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin library. | |
Macros | |
#define | M_PI 3.14159265358979323846 |
M_PI is non-standard ... so MSVC complains. More... | |
Functors to use in dg::evaluate or dg::blas1::transform functions
#define M_PI 3.14159265358979323846 |
M_PI is non-standard ... so MSVC complains.