The TestCaseStefanPME class provides definition of test cases (exact solution, diffusion) for the Stefan and PME problems.
More...
#include <TestCaseStefanPME.hpp>
|
| 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.
◆ TestCaseStefanPME()
TestCaseStefanPME::TestCaseStefanPME |
( |
const std::vector< int > |
iTCS | ) |
|
Initialise data.
- Parameters
-
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. |
◆ diff()
Eigen::Matrix2d TestCaseStefanPME::diff |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const Cell * |
cell |
|
) |
| |
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]\).
- Parameters
-
cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
◆ div_diff()
Eigen::Vector2d TestCaseStefanPME::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.
- Parameters
-
cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
◆ get_deg_diff()
size_t TestCaseStefanPME::get_deg_diff |
( |
| ) |
|
|
inline |
Returns the degree of the diffusion tensor (useful to set up quadrature rules of proper degree)
◆ get_lambda()
double TestCaseStefanPME::get_lambda |
( |
| ) |
|
|
inline |
Returns the value of the parameter lambda.
◆ grad_sol()
Eigen::Vector2d TestCaseStefanPME::grad_sol |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const Cell * |
cell |
|
) |
| |
Returns the gradient of the exact solution at the points x, y.
- Parameters
-
cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
◆ hess_sol()
Eigen::Matrix2d TestCaseStefanPME::hess_sol |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const Cell * |
cell |
|
) |
| |
Returns the Hessian of the exact solution at the points x, y.
- Parameters
-
cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
◆ radial()
double TestCaseStefanPME::radial |
( |
const double |
x, |
|
|
const double |
y |
|
) |
| const |
|
inline |
◆ sol()
double TestCaseStefanPME::sol |
( |
const double |
x, |
|
|
const double |
y |
|
) |
| |
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\).
◆ source()
double TestCaseStefanPME::source |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const Cell * |
cell |
|
) |
| |
Returns the source term at the points x, y.
- Parameters
-
cell | In case of discontinuity, we need to know the cell we're in to select the correct formula |
◆ translate()
Eigen::Vector2d TestCaseStefanPME::translate |
( |
double |
x, |
|
|
double |
y |
|
) |
| const |
|
inline |
◆ validate()
void TestCaseStefanPME::validate |
( |
| ) |
|
Check if the provided test cases are valid (within range, and combination of solution/diffusion valid)
The documentation for this class was generated from the following files: