Flow123d
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Pade_approximant Class Reference

#include <pade_approximant.hh>

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

Public Member Functions

 Pade_approximant (Mesh &mesh, Input::Record in_rec)
 
 ~Pade_approximant (void)
 
void zero_time_step () override
 
double ** compute_reaction (double **concentrations, int loc_el) override
 
double ** modify_reaction_matrix (void) override
 
void evaluate_matrix_polynomial (Mat *Polynomial, Mat *Reaction_matrix, PetscScalar *coef)
 
- Public Member Functions inherited from Linear_reaction
 Linear_reaction (Mesh &init_mesh, Input::Record in_rec)
 
 ~Linear_reaction (void)
 
void update_solution (void) override
 
- Public Member Functions inherited from ReactionTerm
 ReactionTerm (Mesh &init_mesh, Input::Record in_rec)
 Constructor. More...
 
 ~ReactionTerm (void)
 Destructor. More...
 
virtual void output_data (void)
 Output method. More...
 
void choose_next_time (void) override
 Disable changes in TimeGovernor by empty method. More...
 
ReactionTermnames (const std::vector< string > &names)
 Sets the names of substances considered in transport. More...
 
ReactionTermoutput_stream (OutputTime &ostream)
 Sets the output stream which is given from transport class. More...
 
ReactionTermconcentration_matrix (double **concentration, Distribution *conc_distr, int *el_4_loc, int *row_4_el)
 
- Public Member Functions inherited from EquationBase
 EquationBase ()
 
 EquationBase (Mesh &mesh, const Input::Record in_rec)
 
virtual ~EquationBase ()
 
virtual void initialize ()
 Initialize fields. More...
 
virtual void set_time_upper_constraint (double dt)
 
virtual void set_time_lower_constraint (double dt)
 
TimeGovernor const & time ()
 
virtual void set_time_governor (TimeGovernor &time)
 
double planned_time ()
 
double solved_time ()
 
Meshmesh ()
 
TimeMark::Type mark_type ()
 
FieldSetdata ()
 
virtual void get_solution_vector (double *&vector, unsigned int &size)
 
virtual void get_parallel_solution_vector (Vec &vector)
 

Static Public Attributes

static Input::Type::Record input_type
 
static Input::Type::Record input_type_one_decay_substep
 
- Static Public Attributes inherited from Linear_reaction
static Input::Type::Record input_type
 
static Input::Type::Record input_type_one_decay_substep
 
- Static Public Attributes inherited from ReactionTerm
static Input::Type::AbstractRecord input_type = AbstractRecord("ReactionTerm", "Equation for reading information about simple chemical reactions.")
 
static Input::Type::Record input_type_output_record
 Specification of the output record. More...
 

Protected Member Functions

int factorial (int k)
 
double ** allocate_reaction_matrix (void)
 
- Protected Member Functions inherited from Linear_reaction
double ** allocate_reaction_matrix (void)
 
 Linear_reaction ()
 
virtual void init_from_input (Input::Record in_rec) override
 
void print_reaction_matrix (void)
 
void print_indices (int dec_nr, int n_subst)
 
void release_reaction_matrix ()
 
void print_half_lives (int n_subst)
 
unsigned int find_subst_name (const std::string &name)
 
- Protected Member Functions inherited from ReactionTerm
virtual void output_vector_gather (void)
 

Protected Attributes

int nom_pol_deg
 
int den_pol_deg
 
Mat Reaction_matrix
 
- Protected Attributes inherited from Linear_reaction
double ** reaction_matrix
 
double * prev_conc
 
vector< double > half_lives
 
vector< vector< unsigned int > > substance_ids
 
std::vector< std::vector
< double > > 
bifurcation
 
- Protected Attributes inherited from ReactionTerm
double ** concentration_matrix_
 
int * el_4_loc
 Indices of elements belonging to local dofs. More...
 
int * row_4_el
 Indices of rows belonging to elements. More...
 
Distributiondistribution
 Pointer to reference to distribution of elements between processors. More...
 
vector< string > names_
 Names belonging to substances. More...
 
OutputTimeoutput_stream_
 Pointer to a transport output stream. More...
 
- Protected Attributes inherited from EquationBase
bool equation_empty_
 flag is true if only default constructor was called More...
 
Meshmesh_
 
TimeGovernortime_
 
Input::Record input_record_
 
FieldSeteq_data_
 

Detailed Description

Definition at line 24 of file pade_approximant.hh.

Constructor & Destructor Documentation

Pade_approximant::Pade_approximant ( Mesh mesh,
Input::Record  in_rec 
)

Constructor with parameter for initialization of a new declared class member TODO: parameter description

Definition at line 47 of file pade_approximant.cc.

Here is the caller graph for this function:

Pade_approximant::~Pade_approximant ( void  )

Destructor.

Definition at line 52 of file pade_approximant.cc.

Member Function Documentation

double ** Pade_approximant::allocate_reaction_matrix ( void  )
protected

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. 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. This method sets number of isotopes for the case of first order reaction. The value should be always 2. 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. 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. 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. This method reads from ini-file an information if first order reactions simulation is switched on. This method reads from ini-file an information if a radioactive decay simulation is switched on. 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.

Definition at line 85 of file pade_approximant.cc.

double ** Pade_approximant::compute_reaction ( double **  concentrations,
int  loc_el 
)
overridevirtual

For simulation of chemical reaction in just one element either inside of MOBILE or IMMOBILE pores.

Reimplemented from Linear_reaction.

Definition at line 273 of file pade_approximant.cc.

void Pade_approximant::evaluate_matrix_polynomial ( Mat *  Polynomial,
Mat *  Reaction_matrix,
PetscScalar *  coef 
)

It enables to evaluate matrix nominator and denominator present in Pade approximant.

Definition at line 247 of file pade_approximant.cc.

Here is the caller graph for this function:

int Pade_approximant::factorial ( int  k)
protected

Enables to compute factorial k!.

Definition at line 295 of file pade_approximant.cc.

Here is the caller graph for this function:

double ** Pade_approximant::modify_reaction_matrix ( void  )
overridevirtual

Evaluates Pade approximant from Reaction_matrix.

Reimplemented from Linear_reaction.

Definition at line 103 of file pade_approximant.cc.

void Pade_approximant::zero_time_step ( )
overridevirtual

Initialization of the solution in the zero time. There is lot of things that can not be done in the constructor since we have not fully initialized fields yet. Fields coming from coupling has to be set after the constructor and before zero_time_step.

Reimplemented from Linear_reaction.

Definition at line 71 of file pade_approximant.cc.

Member Data Documentation

int Pade_approximant::den_pol_deg
protected

Integer which informs about the order of a polynomial term in denominator of Pade approximant rational term.

Definition at line 165 of file pade_approximant.hh.

Record Pade_approximant::input_type
static
Initial value:
= Record("PadeApproximant", "Abstract record with an information about pade approximant parameters.")
.derive_from( ReactionTerm::input_type )
.declare_key("decays", Array( Pade_approximant::input_type_one_decay_substep ), Default::obligatory(),
"Description of particular decay chain substeps.")
.declare_key("nom_pol_deg", Integer(), Default("2"),
"Polynomial degree of the nominator of Pade approximant.")
.declare_key("den_pol_deg", Integer(), Default("2"),
"Polynomial degree of the nominator of Pade approximant")

Definition at line 30 of file pade_approximant.hh.

Record Pade_approximant::input_type_one_decay_substep
static
Initial value:
= Record("Substep", "Equation for reading information about radioactive decays.")
.declare_key("parent", String(), Default::obligatory(),
"Identifier of an isotope.")
.declare_key("half_life", Double(), Default::optional(),
"Half life of the parent substance.")
.declare_key("kinetic", Double(), Default::optional(),
"Kinetic constants describing first order reactions.")
.declare_key("products", Array(String()), Default::obligatory(),
"Identifies isotopes which decays parental atom to.")
.declare_key("branch_ratios", Array(Double()), Default("1.0"),
"Decay chain branching percentage.")

Definition at line 34 of file pade_approximant.hh.

int Pade_approximant::nom_pol_deg
protected

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. For control printing of a matrix describing simple chemical reactions. For printing nr_of_isotopes identifies of isotopes in a current decay chain. Following method releases reaction matrix to make it possible to set a new time step for chemistry. For printing (nr_of_isotopes - 1) doubles containing half-lives belonging to particular isotopes on screen. Small (nr_of_species x nr_of_species) square matrix for realization of radioactive decay and first order reactions simulation. Sequence of (nr_of_isotopes - 1) doubles containing half-lives belonging to particular isotopes. Sequence of integers describing an order of isotopes in decay chain or first order reaction. Informs about the number of isotopes in a current decay chain. Two dimensional array contains mass percentage of every single decay bifurcation on every single row. One dimensional array of kinetic constants belonging to considered reactions. Boolean which enables to turn on branching of considered decay chain. Integer which informs about the order of a polynomial term in nominator of Pade approximant rational term.

Definition at line 161 of file pade_approximant.hh.

Mat Pade_approximant::Reaction_matrix
protected

PETSC format of a matrix describing linear chemical reaction.

Definition at line 181 of file pade_approximant.hh.


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