-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathriemann.hpp
48 lines (35 loc) · 845 Bytes
/
riemann.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <cstddef>
#include <functional>
namespace riemann {
using real = double;
using integer = size_t;
struct gas_state {
real density;
real velocity;
real pressure;
};
struct gas_discontinuity {
gas_state left;
gas_state right;
real gamma;
};
using gas_state_function = std::function<gas_state(real t, real x)>;
class solver {
public:
explicit solver(gas_discontinuity discontinuity);
gas_state_function solve();
private:
gas_state_function solve_configuarion_a();
gas_state_function solve_configuarion_b();
gas_state_function solve_configuarion_c();
gas_state left_;
gas_state right_;
real gamma_;
real plus_gamma_fraction_;
real minus_gamma_fraction_;
real gamma_fraction_;
real left_sound_velocity_;
real right_sound_velocity_;
};
}