HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
|
The TestCaseNonLinearity class provides definition of a nonlinear function, and related functions. More...
#include <TestCaseNonLinearity.hpp>
Public Types | |
using | nonlinearity_function_type = std::function< double(double, std::string)> |
type for nonlinear function | |
Public Member Functions | |
TestCaseNonLinearity (const int iTCNL, const double m=1.0) | |
Initialise data. | |
double | nonlinearity (const double s, const std::string type) |
Nonlinearity. | |
The TestCaseNonLinearity class provides definition of a nonlinear function, and related functions.
using TestCaseNonLinearity::nonlinearity_function_type = std::function<double(double,std::string)> |
type for nonlinear function
TestCaseNonLinearity::TestCaseNonLinearity | ( | const int | iTCNL, |
const double | m = 1.0 |
||
) |
Initialise data.
iTCNL | The id of the test case |
m | Optional, power of the porous medium non-linearity |
double TestCaseNonLinearity::nonlinearity | ( | const double | s, |
const std::string | type | ||
) |
Nonlinearity.
iTCR[0]=-1: \(f(u)=0\)
iTCR[0]=1: \(f(u)=u\)
iTCR[0]=2: \(f(u)=|u|^{m-1}u = |u|^m sign(u)\)
iTCR[0]=3: \(f(u)=max(u,0)^2\)
iTCR[0]=4: \(f(u)=(u+th)^+-th + eps u\)
iTCR[0]=5: \(f(u)=u\) truncated at 0 and th
iTCR[0]=6: Classical Stefan \(f(s)=s\) if \(s<0\), \(f(s)=0\) if \(0\le s\le 1\), \(f(s)=s-1\) if \(s>1\).
type | "type" = "fct" for the function itself, "nlin" for the nonlinear part gamma such that fct(u) = gamma(u) u, "der" for derivative, "hess" for 2nd derivative |