Flow123d
3.9.0-c2ae2d0a8
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
w
Variables
Typedefs
Enumerations
Enumerator
a
b
c
d
f
g
h
i
m
n
o
p
r
s
u
w
y
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
z
Enumerations
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
_
a
c
d
f
i
k
l
m
n
o
p
r
s
t
v
Variables
_
a
c
d
g
m
n
p
q
s
u
v
Typedefs
_
a
d
e
f
g
i
j
l
m
o
q
r
s
t
u
v
Enumerations
Enumerator
a
b
c
d
e
f
i
m
n
o
p
r
s
u
v
w
Macros
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
w
z
src
reaction
linear_ode_solver.cc
Go to the documentation of this file.
1
/*!
2
*
3
* Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4
*
5
* This program is free software; you can redistribute it and/or modify it under
6
* the terms of the GNU General Public License version 3 as published by the
7
* Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
*
13
*
14
* @file linear_ode_solver.cc
15
* @brief
16
*/
17
18
#include "
reaction/linear_ode_solver.hh
"
19
20
#include "armadillo"
21
#include "
input/accessors.hh
"
22
23
using namespace
Input::Type
;
24
25
26
LinearODESolver::LinearODESolver
()
27
: step_(0), step_changed_(true),
28
system_matrix_changed_(false)
29
{
30
}
31
32
LinearODESolver::~LinearODESolver
()
33
{
34
}
35
36
void
LinearODESolver::set_system_matrix
(
const
arma::mat
& matrix)
37
{
38
system_matrix_
= matrix;
39
system_matrix_changed_
=
true
;
40
}
41
42
void
LinearODESolver::set_step
(
double
step)
43
{
44
step_
= step;
45
step_changed_
=
true
;
46
}
47
48
void
LinearODESolver::update_solution
(
arma::vec
& init_vector,
arma::vec
& output_vec)
49
{
50
if
(
step_changed_
||
system_matrix_changed_
)
51
{
52
solution_matrix_
= arma::expmat(
system_matrix_
*
step_
);
//coefficients multiplied by time
53
step_changed_
=
false
;
54
system_matrix_changed_
=
false
;
55
}
56
57
output_vec =
solution_matrix_
* init_vector;
58
}
59
60
LinearODESolver::system_matrix_changed_
bool system_matrix_changed_
Indicates that the system_matrix_ was recently updated.
Definition:
linear_ode_solver.hh:60
Armor::vec
ArmaVec< double, N > vec
Definition:
armor.hh:885
LinearODESolver::step_
double step_
the step of the numerical method
Definition:
linear_ode_solver.hh:58
linear_ode_solver.hh
LinearODESolver::set_step
void set_step(double step)
Sets the step of the numerical method.
Definition:
linear_ode_solver.cc:42
LinearODESolver::system_matrix_
arma::mat system_matrix_
the square matrix of ODE system
Definition:
linear_ode_solver.hh:55
LinearODESolver::set_system_matrix
void set_system_matrix(const arma::mat &matrix)
Sets the matrix of ODE system.
Definition:
linear_ode_solver.cc:36
Armor::mat
ArmaMat< double, N, M > mat
Definition:
armor.hh:888
accessors.hh
LinearODESolver::~LinearODESolver
~LinearODESolver()
Definition:
linear_ode_solver.cc:32
Input::Type
Definition:
balance.hh:41
LinearODESolver::update_solution
void update_solution(arma::vec &init_vec, arma::vec &output_vec)
Updates solution of the ODEs system.
Definition:
linear_ode_solver.cc:48
LinearODESolver::step_changed_
bool step_changed_
flag is true if the step has been changed
Definition:
linear_ode_solver.hh:59
LinearODESolver::solution_matrix_
arma::mat solution_matrix_
the square solution matrix (exponential of system matrix)
Definition:
linear_ode_solver.hh:56
LinearODESolver::LinearODESolver
LinearODESolver()
Definition:
linear_ode_solver.cc:26
Generated by
1.8.17