|
HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
|
The TestCaseStefanPME class provides definition of test cases (exact solution, diffusion) for the Stefan and PME problems. More...
#include <TestCaseStefanPME.hpp>
Public Member Functions | |
| TestCaseStefanPME (const std::vector< int > iTCS) | |
| Initialise data. | |
| double | sol (const double x, const double y) |
| Returns the exact solution at the points x, y. | |
| Eigen::Vector2d | grad_sol (const double x, const double y, const Cell *cell) |
| Returns the gradient of the exact solution at the points x, y. | |
| Eigen::Matrix2d | hess_sol (const double x, const double y, const Cell *cell) |
| Returns the Hessian of the exact solution at the points x, y. | |
| Eigen::Matrix2d | diff (const double x, const double y, const Cell *cell) |
| Returns the diffusion matrix at the points x, y. | |
| Eigen::Vector2d | div_diff (const double x, const double y, const Cell *cell) |
| Returns the divergence by row of the diffusion matrix at the points x, y. | |
| double | source (const double x, const double y, const Cell *cell) |
| Returns the source term at the points 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) | |
| Eigen::Vector2d | translate (double x, double y) const |
| double | radial (const double x, const double y) const |
The TestCaseStefanPME class provides definition of test cases (exact solution, diffusion) for the Stefan and PME problems.
Initialise data.
| iTCS | The vector id of the test case: (id of solution, id of diffusion). For positive id of solutions, we take the solutions from TestCase.cpp. Otherwise, it's specific solutions for Stefan or PME. |
Returns the diffusion matrix at the points x, y.
iTCS[1]=1: Diff = Id
iTCS[1]=2: Diff = \(\left[\begin{array}{cc}y^2+1 & -xy\\ -xy & x^2+1\end{array}\right]\)
iTCS[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 iTCS[0]=2 ( \(\partial_x u\) must vanish along \(y=1/2\)).
iTCS[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\).
iTCS[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 |
Returns the divergence by row of the diffusion matrix at the points 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.
Returns the gradient of the exact solution at the points x, y.
| cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
Returns the Hessian of the exact solution at the points x, y.
| cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
Returns the exact solution at the points x, y.
iTCS[0]=-1, \(u=\cosh(\frac{x+y}{\sqrt{2}}-\gamma\) if \(\frac{x+y}{\sqrt{2}}>\gamma\).
iTCS[0]=-2, \(u=(\frac{x+y}{\sqrt{2}}-\frac12)^3\).
iTCS[0]=-3, \(u=max(\rho - r^2, 0)\) where \(r^2=(x-.5)^2+(y-.5)^2\).
Returns the source term at the points x, y.
| cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
| void TestCaseStefanPME::validate | ( | ) |
Check if the provided test cases are valid (within range, and combination of solution/diffusion valid)