HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
|
The TestCaseTransient class provides definition of test cases. More...
#include <TestCaseTransient.hpp>
Public Member Functions | |
TestCaseTransient (const std::vector< int > iTC, const double mPME) | |
Initialise data. | |
std::function< double(const double &, const VectorRd &)> | solution () |
Returns the exact solution at time t and point p. | |
std::function< VectorRd(const double &, const VectorRd &, const Cell *)> | grad_solution () |
std::function< Eigen::Matrix2d(const double &, const VectorRd &, const Cell *)> | hess_solution () |
Note: the Hessian for the Barenblatt solution is NOT computed (left at 0) as it is not useful to compute the source term. | |
std::function< double(const double &, const VectorRd &)> | delt_solution () |
Returns the time derivative of the exact solution at time t and point p. | |
Eigen::Matrix2d | diff (const double x, const double y, const Cell *cell) |
Returns the diffusion matrix at the point x, y (not depending on time for the moment) | |
Eigen::Vector2d | div_diff (const double x, const double y, const Cell *cell) |
Returns the divergence by row of the diffusion matrix at the point x, y. | |
double | minus_div_diff_grad (const double t, const double x, const double y, const Cell *cell) |
Returns -div(diff \nabla) of the exact solution at the point t, x, y. | |
double | get_lambda () |
Returns the value of the parameter lambda. | |
void | validate () |
Check if the provided test cases are valid (within range, and combination of solution/diffusion valid) | |
size_t | get_deg_diff () |
Returns the degree of the diffusion tensor (useful to set up quadrature rules of proper degree) | |
The TestCaseTransient class provides definition of test cases.
TestCaseTransient::TestCaseTransient | ( | const std::vector< int > | iTC, |
const double | mPME | ||
) |
Initialise data.
iTC | The vector id of the test case: (id of solution, id of diffusion) |
mPME | PME power, for the Barenblatt solution |
std::function< double(const double &, const VectorRd &)> TestCaseTransient::delt_solution | ( | ) |
Returns the time derivative of the exact solution at time t and point p.
Eigen::Matrix2d TestCaseTransient::diff | ( | const double | x, |
const double | y, | ||
const Cell * | cell | ||
) |
Returns the diffusion matrix at the point x, y (not depending on time for the moment)
iTC[1]=1: Diff = Id
iTC[1]=2: Diff = \(\left[\begin{array}{cc}y^2+1 & -xy\\ -xy & x^2+1\end{array}\right]\)
iTC[1]=3: Diff= \(\left[\begin{array}{cc}\lambda & 0\\ 0 & 1\end{array}\right]\) if \(y<1/2\), Diff=Id if \(y\ge 1/2\). Only valid with iTC[0]=2 ( \(\partial_x u\) must vanish along \(y=1/2\)).
iTC[1]=4: rotating diffusion. Diff= \(\left[\begin{array}{cc}\epsilon \bar{x}^2 + \bar{y}^2 & (\epsilon-1)\bar{x}\bar{y}\\ (\epsilon-1)\bar{x}\bar{y} & \bar{x}^2+\epsilon \bar{y}^2\end{array}\right]\), where \(\bar{x}=x+0.1\) and \(\bar{y}=y+0.1\).
iTC[1]=5: Diff= \(\left[\begin{array}{cc}\lambda & 0\\ 0 & 1\end{array}\right]\).
cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
Eigen::Vector2d TestCaseTransient::div_diff | ( | const double | x, |
const double | y, | ||
const Cell * | cell | ||
) |
Returns the divergence by row of the diffusion matrix at the point x, y.
cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
|
inline |
Returns the degree of the diffusion tensor (useful to set up quadrature rules of proper degree)
|
inline |
Returns the value of the parameter lambda.
std::function< VectorRd(const double &, const VectorRd &, const Cell *)> TestCaseTransient::grad_solution | ( | ) |
Returns the gradient of the exact solution at time t and point p In case of discontinuity, we need to know the cell we're in to select the correct formula Note: the gradient for the Barenblatt solution is NOT computed (left at 0) as it is not useful to compute the source term
std::function< Eigen::Matrix2d(const double &, const VectorRd &, const Cell *)> TestCaseTransient::hess_solution | ( | ) |
Note: the Hessian for the Barenblatt solution is NOT computed (left at 0) as it is not useful to compute the source term.
Returns the Hessian of the exact solution at time t and point p
double TestCaseTransient::minus_div_diff_grad | ( | const double | t, |
const double | x, | ||
const double | y, | ||
const Cell * | cell | ||
) |
Returns -div(diff \nabla) of the exact solution at the point t, x, y.
cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
std::function< double(const double &, const VectorRd &)> TestCaseTransient::solution | ( | ) |
Returns the exact solution at time t and point p.
iTC[0]=1: \(u(x,y)=cos(t) sin(\pi x) sin(\pi y)\)
iTC[0]=2: \(u(x,y)=cos(t) cos(\pi x) cos(\pi y)\)
iTC[0]=3: \(u(x,y)= (1-t) x\)
iTC[0]=4: Barenblatt solution (with offset)
void TestCaseTransient::validate | ( | ) |
Check if the provided test cases are valid (within range, and combination of solution/diffusion valid)