Flow123d  jenkins-Flow123d-windows32-release-multijob-51
pade_approximant.hh
Go to the documentation of this file.
1 /*
2  * pade_approximant.h
3  *
4  * Created on: Apr 2, 2012
5  * Author: lukas
6  */
7 
8 #ifndef PADE_APPROXIMANT_H_
9 #define PADE_APPROXIMANT_H_
10 
11 #include <input/input_type.hh>
12 #include "armadillo"
13 
14 using namespace arma;
15 
16 class Mesh;
17 class LinearReaction;
18 
20 {
21 public:
22  /**
23  * Input record for class PadeApproximant.
24  */
26  /**
27  * Input record which defines particular decay step.
28  */
30 
31  /// Constructor.
32  PadeApproximant(Mesh &mesh, Input::Record in_rec);
33 
34  /// Destructor.
35  ~PadeApproximant(void);
36 
37  void initialize() override;
38  void zero_time_step() override;
39 
40 protected:
41  /**
42  * Evaluates Pade approximant from Reaction_matrix.
43  */
44  void modify_reaction_matrix(void) override;
45 
46  /// Evaluates nominator and denominator coeficients of PadeApproximant for exponencial function.
47  /** @param nominator_degree is the degree of polynomial in the nominator
48  * @param denominator_degree is the degree of polynomial in the denominator
49  * @param nominator_coefs is the vector of coeficients of the polynomial in the nominator
50  * @param denominator_coefs is the vector of coeficients of the polynomial in the denominator
51  */
52  void compute_exp_coefs(unsigned int nominator_degree, unsigned int denominator_degree,
53  std::vector<double> &nominator_coefs, std::vector<double> &denominator_coefs);
54 
55  /// Evaluates the matrix polynomial by Horner scheme.
56  /** @param polynomial_matrix is the output matrix
57  * @param reaction_matrix is the reaction matrix (with elements -kt)
58  * @param coefs is the vector of coeficients of the polynomial
59  */
60  void evaluate_matrix_polynomial(mat &polynomial_matrix,
61  const mat &reaction_matrix,
62  const std::vector<double> &coefs);
63 
64  int nominator_degree_; ///< Degree of the polynomial in the nominator.
65  int denominator_degree_; ///< Degree of the polynomial in the denominator.
66 };
67 
68 #endif // PADE_APPROXIMANT_H_
int nominator_degree_
Degree of the polynomial in the nominator.
static Input::Type::Record input_type
Definition: mesh.h:108
int denominator_degree_
Degree of the polynomial in the denominator.
Accessor to the data with type Type::Record.
Definition: accessors.hh:308
static Input::Type::Record input_type_one_decay_substep
Record type proxy class.
Definition: type_record.hh:161