Flow123d  release_3.0.0-859-g84487d0
Classes | Protected Attributes | List of all members
InterpolantImplicit Class Reference

#include <interpolant.hh>

Inheritance diagram for InterpolantImplicit:
Inheritance graph
[legend]
Collaboration diagram for InterpolantImplicit:
Collaboration graph
[legend]

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...
 
Interpolantexplicit_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 $(a,b)$. 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 $ L_p $ and $ W_p^1 $ 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...
 

Detailed Description

Definition at line 426 of file interpolant.hh.

Constructor & Destructor Documentation

InterpolantImplicit::InterpolantImplicit ( )

constructor

Definition at line 537 of file interpolant.cc.

template<template< class > class Func, class Type >
InterpolantImplicit::InterpolantImplicit ( Func< Type > *  func,
bool  interpolate_derivative = false 
)

Constructor with functor setting.

Parameters
funcis the pointer to functor
interpolate_derivativeis true when derivate is also interpolated
Template Parameters
Funcis the functor type
Typeis the template type of the functor (e.g. double)

Definition at line 372 of file interpolant_impl.hh.

InterpolantImplicit::~InterpolantImplicit ( void  )
virtual

destructor

Definition at line 549 of file interpolant.cc.

Member Function Documentation

DiffValue InterpolantImplicit::diff ( double  u)
inline

Returns interpolated value of the derivation.

Parameters
uis 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.

Parameters
xis function variable.
yis 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.

Parameters
uis the point at which we evaluate the original functor
nis the order of the derivative we want
double InterpolantImplicit::f_val ( double  x,
double  y 
)

Returns interpolated value of the derivation.

Parameters
xis the point at which we evaluate the interpolationReturns value of the original functor.
xis function variable.
yis function variable.
double InterpolantImplicit::f_val ( double  u)

Returns value of the original functor when one of the variables is fixed.

Parameters
uis 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.

Parameters
fixis the chosen variable (no_fix, fix_x or fix_y)
valueis the fixed value

Definition at line 557 of file interpolant.cc.

int InterpolantImplicit::interpolate ( )
virtual

Creates piecewise interpolation with polynomials of selected degree.

Implements InterpolantBase.

Definition at line 570 of file interpolant.cc.

void InterpolantImplicit::interpolate_p1 ( )
protected

Creates piecewise linear interpolation.

Definition at line 595 of file interpolant.cc.

template<template< class > class Func, class Type >
void InterpolantImplicit::set_functor ( Func< Type > *  func,
bool  interpolate_derivative = false 
)

Sets the implicit functor.

Parameters
funcis the pointer to implicit functor.
Template Parameters
Funcis the functor class.
Typeis the template type of the functor (e.g. double)

Definition at line 357 of file interpolant_impl.hh.

double InterpolantImplicit::val ( double  u)
inline

Returns interpolated value.

Parameters
uis the point at which we evaluate the interpolation

Definition at line 421 of file interpolant_impl.hh.

Here is the caller graph for this function:

Member Data Documentation

Interpolant* InterpolantImplicit::explicit_interpolant
protected

Definition at line 531 of file interpolant.hh.

IFixVariable::Type InterpolantImplicit::fix_
protected

Definition at line 533 of file interpolant.hh.

double InterpolantImplicit::fix_val
protected

Definition at line 534 of file interpolant.hh.

IFunctorBase<double>* InterpolantImplicit::func
protected

Definition at line 525 of file interpolant.hh.

IFunctorBase<B<double> >* InterpolantImplicit::func_diff
protected

Definition at line 526 of file interpolant.hh.

IFunctorBase<T<double> >* InterpolantImplicit::func_diffn
protected

Definition at line 527 of file interpolant.hh.

FuncExplicit<double>* InterpolantImplicit::func_u
protected

Definition at line 522 of file interpolant.hh.

bool InterpolantImplicit::interpolate_derivative
protected

Is true if we want to interpolate the derivative too.

Definition at line 529 of file interpolant.hh.


The documentation for this class was generated from the following files: