Flow123d
release_3.0.0-890-gfc7e296
|
#include <interpolant.hh>
Classes | |
class | FuncExplicit |
class FuncExplicit. More... | |
Public Member Functions | |
Construction. | |
InterpolantImplicit () | |
constructor More... | |
template<template< class > class Func, class Type > | |
InterpolantImplicit (Func< Type > *func, bool interpolate_derivative=false) | |
Constructor with functor setting. More... | |
virtual | ~InterpolantImplicit (void) |
destructor More... | |
template<template< class > class Func, class Type > | |
void | set_functor (Func< Type > *func, bool interpolate_derivative=false) |
Sets the implicit functor. More... | |
Evaluation. | |
void | fix_variable (IFixVariable::Type fix, double value) |
double | val (double u) |
Returns interpolated value. More... | |
DiffValue | diff (double u) |
Returns interpolated value of the derivation. More... | |
double | f_val (double x, double y) |
Returns interpolated value of the derivation. More... | |
double | f_val (double u) |
Returns value of the original functor when one of the variables is fixed. More... | |
DiffValue | f_diff (double x, double y) |
Returns 1st derivative of original functor using FADBAD. More... | |
double | f_diffn (double u, unsigned int n) |
Public Member Functions inherited from InterpolantBase | |
InterpolantBase () | |
Default constructor. More... | |
virtual | ~InterpolantBase () |
Destructor. More... | |
double | error () |
Returns error of the interpolation. More... | |
double | bound_a () const |
Returns left boundary of the interval. More... | |
double | bound_b () const |
Returns right boundary of the interval. More... | |
unsigned int | size () const |
Returns the size of the interpolation table. More... | |
void | set_interval (double bound_a, double bound_b) |
Sets the interpolation interval boundaries. More... | |
void | set_size (unsigned int size) |
Sets size of the interpolation table. It is also equal to the number of intervals. More... | |
void | set_norm (ErrorNorm::Type norm_type=ErrorNorm::max, double p=2) |
Sets the type of norm used for computing estimate of the error of the interpolation. More... | |
void | set_size_automatic (double user_tol, unsigned int init_size, unsigned int max_size=default_max_size) |
Sets automatic choice of the size of the table. More... | |
void | set_extrapolation (Extrapolation::Type extrapolation) |
Sets the type of extrapolation. Functor type is default. More... | |
EvalStatistics | statistics () const |
Returns structure with evaluation statistics. More... | |
void | reset_stat () |
Resets all measured statistics. More... | |
void | check_stats_and_reinterpolate (double percentage=0.3) |
Can be called to check automatically the evaluation statistics and possibly reinterpolate. More... | |
Protected Attributes | |
FuncExplicit< double > * | func_u |
IFunctorBase< double > * | func |
IFunctorBase< B< double > > * | func_diff |
IFunctorBase< T< double > > * | func_diffn |
bool | interpolate_derivative |
Is true if we want to interpolate the derivative too. More... | |
Interpolant * | explicit_interpolant |
IFixVariable::Type | fix_ |
double | fix_val |
Protected Attributes inherited from InterpolantBase | |
double | bound_a_ |
Left interval boundary. More... | |
double | bound_b_ |
Right interval boundary. More... | |
double | step |
Chosen interpolation step. More... | |
double | a_div_step |
bound_ divided by step - precomputed value for evaluation More... | |
unsigned int | size_ |
Number of dividing intervals. More... | |
unsigned int | n_nodes |
Number of nodes in the interval . More... | |
double | user_tol |
User set tolerance which is used during automatic step choice. More... | |
unsigned int | max_size |
Maximal size of the interpolation table. More... | |
bool | automatic_size |
Is true if step/size should be chosen automatically. More... | |
ErrorNorm::Type | norm_type |
Type of norm used to compute error of the interpolation. More... | |
double | p |
Exponent used in norms and when computing error. More... | |
double | error_ |
Error of the interpolation. More... | |
Extrapolation::Type | extrapolation |
EvalStatistics | stats |
Structure which keeps evaluation statistics. See InterpolantBase::eval_statistics. More... | |
std::vector< bool > | checks |
Vector of boolean values telling us which parameters are set or not. More... | |
Interpolation. | |
virtual int | interpolate () |
Creates piecewise interpolation with polynomials of selected degree. More... | |
void | interpolate_p1 () |
Creates piecewise linear interpolation. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from InterpolantBase | |
long | fact (long x) |
Recursive factorial function (used in Taylor row expansion in n-th derivative computation). More... | |
void | check_all () |
Checks that the parameters are set before interpolation. More... | |
Static Protected Attributes inherited from InterpolantBase | |
static const unsigned int | n_derivatives = 10 |
Defines how many derivatives we allow to be returned from Taylor's coeficients. More... | |
static const unsigned int | default_max_size = 10*1000 |
Default maximal size of the interpolation table. More... | |
static const double | simpson_tolerance = 1e-10 |
Tolerance in Adaptive Simpson intergration. More... | |
Definition at line 426 of file interpolant.hh.
InterpolantImplicit::InterpolantImplicit | ( | ) |
constructor
Definition at line 537 of file interpolant.cc.
InterpolantImplicit::InterpolantImplicit | ( | Func< Type > * | func, |
bool | interpolate_derivative = false |
||
) |
Constructor with functor setting.
func | is the pointer to functor |
interpolate_derivative | is true when derivate is also interpolated |
Func | is the functor type |
Type | is the template type of the functor (e.g. double) |
Definition at line 372 of file interpolant_impl.hh.
|
virtual |
destructor
Definition at line 549 of file interpolant.cc.
|
inline |
Returns interpolated value of the derivation.
u | is the point at which we evaluate the interpolation |
Definition at line 426 of file interpolant_impl.hh.
DiffValue InterpolantImplicit::f_diff | ( | double | x, |
double | y | ||
) |
Returns 1st derivative of original functor using FADBAD.
x | is function variable. |
y | is function variable. |
double InterpolantImplicit::f_diffn | ( | double | u, |
unsigned int | n | ||
) |
Returns n-th derivative of original functor using FADBAD. Uses coeficients in Taylor's row.
u | is the point at which we evaluate the original functor |
n | is the order of the derivative we want |
double InterpolantImplicit::f_val | ( | double | x, |
double | y | ||
) |
Returns interpolated value of the derivation.
x | is the point at which we evaluate the interpolationReturns value of the original functor. |
x | is function variable. |
y | is function variable. |
double InterpolantImplicit::f_val | ( | double | u | ) |
Returns value of the original functor when one of the variables is fixed.
u | is function variable (the one not fixed). |
Definition at line 564 of file interpolant.cc.
void InterpolantImplicit::fix_variable | ( | IFixVariable::Type | fix, |
double | value | ||
) |
Fixes the chosen variable and sets its fixed value.
fix | is the chosen variable (no_fix, fix_x or fix_y) |
value | is the fixed value |
Definition at line 557 of file interpolant.cc.
|
virtual |
Creates piecewise interpolation with polynomials of selected degree.
Implements InterpolantBase.
Definition at line 570 of file interpolant.cc.
|
protected |
Creates piecewise linear interpolation.
Definition at line 595 of file interpolant.cc.
void InterpolantImplicit::set_functor | ( | Func< Type > * | func, |
bool | interpolate_derivative = false |
||
) |
Sets the implicit functor.
func | is the pointer to implicit functor. |
Func | is the functor class. |
Type | is the template type of the functor (e.g. double) |
Definition at line 357 of file interpolant_impl.hh.
|
inline |
Returns interpolated value.
u | is the point at which we evaluate the interpolation |
Definition at line 421 of file interpolant_impl.hh.
|
protected |
Definition at line 531 of file interpolant.hh.
|
protected |
Definition at line 533 of file interpolant.hh.
|
protected |
Definition at line 534 of file interpolant.hh.
|
protected |
Definition at line 525 of file interpolant.hh.
|
protected |
Definition at line 526 of file interpolant.hh.
|
protected |
Definition at line 527 of file interpolant.hh.
|
protected |
Definition at line 522 of file interpolant.hh.
|
protected |
Is true if we want to interpolate the derivative too.
Definition at line 529 of file interpolant.hh.