Flow123d
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 <vector>
12 #include <input/input_type.hh>
13 #include <input/accessors.hh>
14 
15 #include "petscvec.h"
16 #include "petscmat.h"
17 #include "petscksp.h"
18 
19 
20 class Mesh;
21 class Distribution;
22 class Linear_reaction;
23 
25 {
26  public:
27  /*
28  * Static variable for new input data types input
29  */
31  /*
32  * Static variable gets information about particular decay step
33  */
35  /**
36  * Constructor with parameter for initialization of a new declared class member
37  * TODO: parameter description
38  */
40 
41  /**
42  * Destructor.
43  */
44  ~Pade_approximant(void);
45 
46  void zero_time_step() override;
47 
48  /**
49  * For simulation of chemical reaction in just one element either inside of MOBILE or IMMOBILE pores.
50  */
51  double **compute_reaction(double **concentrations, int loc_el) override;
52 
53  /**
54  * Evaluates Pade approximant from Reaction_matrix.
55  */
56  double **modify_reaction_matrix(void) override;
57  /**
58  * It enables to evaluate matrix nominator and denominator present in Pade approximant.
59  */
60  void evaluate_matrix_polynomial(Mat *Polynomial, Mat *Reaction_matrix, PetscScalar *coef);
61 
62  protected:
63  /**
64  * Enables to compute factorial k!.
65  */
66  int factorial(int k);
67 
68 
69  /**
70  * This method reads a sequence of numbers defining an order of substances in decay chain. The string section defines where too look for indices inside of ini-file, whereas n_subst is a number of isotopes in described decay chain.
71  */
72  //int *set_indeces(char *section, int n_subst);
73  /**
74  * This method reads an information about a number of isotopes in a decay chain described inside of ini-file in section given as an argument. This method is used for radioactive decay simulation.
75  */
76  //void set_nr_of_isotopes(char* section);
77  /**
78  * This method sets number of isotopes for the case of first order reaction. The value should be always 2.
79  */
80  //void set_nr_of_isotopes(int Nr_of_isotopes);
81  /**
82  * This method reads a sequence of (nr_of_isotopes - 1) halflives belonging to separate decay chain step. This information is placed in ini-file in a block starting with a string section.
83  */
84  //double *set_half_lives(char *section);
85  /**
86  * This method reads form ini-file an information for construction of a matrix describing bifurcation of every single decay chain on one row of the reaction matrix. Informations about bifurcation are placed in a block starting with a string section. dec_nr identifies which one decay chain is handled and which row of twodimensional bifurcation matrix (double **array)should be affected.
87  */
88  //void set_bifurcation(char *section, int dec_nr);
89  /**
90  * This method reads from ini-file an information if the bifurcation for a current decay chain is switched on in a block starting with a string section. Initialy bifurcation is switched of.
91  */
92  //void set_bifurcation_on(char *section);
93  /**
94  * This method reads from ini-file an information if first order reactions simulation is switched on.
95  */
96  //void set_For_on(void);
97  /**
98  * This method reads from ini-file an information if a radioactive decay simulation is switched on.
99  */
100  //void set_decay_on(void);
101  /**
102  * This method reads from ini-file an information and prepares a vector (onedimensional double *array) containing kinetic constants of every single first order reactions. Those informations are placed in a block with a string section at the beginning. From those constants half-lives belonging to first order reactions are computed.
103  */
104  //void set_kinetic_constants(char *section, int reaction_nr);
105  /**
106  *
107  */
108  double **allocate_reaction_matrix(void);
109  /**
110  * This method modificates reaction matrix as described in ini-file a single section [Decay_i] or [FoReact_i]. It is used when bifurcation is switched off.
111  */
112  //double **modify_reaction_matrix(void);
113  /**
114  * For control printing of a matrix describing simple chemical reactions.
115  */
116  //void print_reaction_matrix(void);
117  /**
118  * For printing nr_of_isotopes identifies of isotopes in a current decay chain.
119  */
120  //void print_indeces(int n_subst);
121  /**
122  * Following method releases reaction matrix to make it possible to set a new time step for chemistry.
123  */
124  //void release_reaction_matrix();
125  /**
126  * For printing (nr_of_isotopes - 1) doubles containing half-lives belonging to particular isotopes on screen.
127  */
128  //void print_half_lives(int n_subst);
129  /**
130  * Small (nr_of_species x nr_of_species) square matrix for realization of radioactive decay and first order reactions simulation.
131  */
132  //double **reaction_matrix;
133  //std::vector<double> half_lives; ///< alternative to following row
134  /**
135  * Sequence of (nr_of_isotopes - 1) doubles containing half-lives belonging to particular isotopes.
136  */
137  //double *half_lives;
138  /**
139  * Sequence of integers describing an order of isotopes in decay chain or first order reaction.
140  */
141  //int *substance_ids;
142  /**
143  * Informs about the number of isotopes in a current decay chain.
144  */
145  //int nr_of_isotopes;
146  /**
147  * Two dimensional array contains mass percentage of every single decay bifurcation on every single row.
148  */
149  //std::vector<std::vector<double> > bifurcation;
150  /**
151  * One dimensional array of kinetic constants belonging to considered reactions.
152  */
153  //std::vector<double> kinetic_constant;
154  /**
155  * Boolean which enables to turn on branching of considered decay chain.
156  */
157  //bool bifurcation_on;
158  /**
159  * Integer which informs about the order of a polynomial term in nominator of Pade approximant rational term.
160  */
162  /**
163  * Integer which informs about the order of a polynomial term in denominator of Pade approximant rational term.
164  */
166  /**
167  *
168  */
169  //void modify_reaction_matrix(void);
170  /**
171  *
172  */
173  //double **allocate_reaction_matrix(void);
174  /**
175  *
176  */
177  //double **modify_reaction_matrix(int dec_nr);
178  /**
179  * PETSC format of a matrix describing linear chemical reaction.
180  */
182 };
183 
184 #endif /* PADE_APPROXIMANT_H_ */