Flow123d
jenkins-Flow123d-linux-release-multijob-282
|
This class implements the Pade approximation of exponential function. More...
#include <pade_approximant.hh>
Public Member Functions | |
PadeApproximant (Input::Record in_rec) | |
Constructor from input record. More... | |
PadeApproximant (unsigned int nominator_degree, unsigned int denominator_degree) | |
Constructor. More... | |
~PadeApproximant (void) | |
Destructor. More... | |
void | update_solution (arma::vec &init_vector, arma::vec &output_vec) override |
Updates solution of the ODEs system. More... | |
Public Member Functions inherited from LinearODESolver< PadeApproximant > | |
LinearODESolver () | |
virtual | ~LinearODESolver () |
virtual void | update_solution (arma::mat &init_vecs, arma::mat &output_vecs, const std::vector< unsigned int > &mask=std::vector< unsigned int >(0)) override |
Updates solution of the system with different initial vectors. More... | |
Public Member Functions inherited from LinearODESolverBase | |
LinearODESolverBase () | |
virtual | ~LinearODESolverBase () |
void | set_system_matrix (const arma::mat &matrix) |
Sets the matrix of ODE system. More... | |
void | set_step (double step) |
Sets the step of the numerical method. More... | |
Static Public Attributes | |
static Input::Type::Record | input_type |
Static Public Attributes inherited from LinearODESolverBase | |
static Input::Type::AbstractRecord | input_type = AbstractRecord("LinearODESolver", "Solver of a linear system of ODEs.") |
Protected Member Functions | |
PadeApproximant () | |
Hide default constructor. More... | |
void | approximate_matrix (arma::mat &matrix) |
void | compute_exp_coefs (unsigned int nominator_degree, unsigned int denominator_degree, std::vector< double > &nominator_coefs, std::vector< double > &denominator_coefs) |
Evaluates nominator and denominator coeficients of PadeApproximant for exponencial function. More... | |
void | evaluate_matrix_polynomial (arma::mat &polynomial_matrix, const arma::mat &input_matrix, const std::vector< double > &coefs) |
Evaluates the matrix polynomial by Horner scheme. More... | |
Protected Attributes | |
int | nominator_degree_ |
Degree of the polynomial in the nominator. More... | |
int | denominator_degree_ |
Degree of the polynomial in the denominator. More... | |
arma::mat | solution_matrix_ |
Solution matrix . More... | |
Protected Attributes inherited from LinearODESolverBase | |
arma::mat | system_matrix_ |
the square matrix of ODE system More... | |
arma::vec | rhs_ |
the column vector of RHS values (not used currently) More... | |
double | step_ |
the step of the numerical method More... | |
bool | step_changed_ |
flag is true if the step has been changed More... | |
This class implements the Pade approximation of exponential function.
The exponential function is considered in the form where is a constant matrix. It is then approximated by a fraction of polynomials
where the degrees of polynomials in nominator and denominator, and , are set from the input record.
Definition at line 23 of file pade_approximant.hh.
PadeApproximant::PadeApproximant | ( | Input::Record | in_rec | ) |
Constructor from input record.
Definition at line 22 of file pade_approximant.cc.
PadeApproximant::PadeApproximant | ( | unsigned int | nominator_degree, |
unsigned int | denominator_degree | ||
) |
Constructor.
Definition at line 29 of file pade_approximant.cc.
PadeApproximant::~PadeApproximant | ( | void | ) |
Destructor.
Definition at line 34 of file pade_approximant.cc.
|
inlineprotected |
Hide default constructor.
Definition at line 44 of file pade_approximant.hh.
|
protected |
Approximate the matrix function.
Definition at line 51 of file pade_approximant.cc.
|
protected |
Evaluates nominator and denominator coeficients of PadeApproximant for exponencial function.
nominator_degree | is the degree of polynomial in the nominator |
denominator_degree | is the degree of polynomial in the denominator |
nominator_coefs | is the vector of coeficients of the polynomial in the nominator |
denominator_coefs | is the vector of coeficients of the polynomial in the denominator |
Definition at line 78 of file pade_approximant.cc.
|
protected |
Evaluates the matrix polynomial by Horner scheme.
polynomial_matrix | is the output matrix |
input_matrix | is the input matrix (with elements -kt) |
coefs | is the vector of coeficients of the polynomial |
Horner scheme for evaluating polynomial a0 + [a1 + [a2 + [a3 +...]*R(t)]*R(t)]*R(t)
Definition at line 107 of file pade_approximant.cc.
|
overridevirtual |
Updates solution of the ODEs system.
init_vec | is the column initial vector |
output_vec | is the column output vector containing the result |
Implements LinearODESolverBase.
Definition at line 38 of file pade_approximant.cc.
|
protected |
Degree of the polynomial in the denominator.
Definition at line 70 of file pade_approximant.hh.
|
static |
Input record for class PadeApproximant.
Definition at line 29 of file pade_approximant.hh.
|
protected |
Degree of the polynomial in the nominator.
Definition at line 69 of file pade_approximant.hh.
|
protected |
Solution matrix .
Definition at line 72 of file pade_approximant.hh.