-
Notifications
You must be signed in to change notification settings - Fork 0
/
mff.hpp
75 lines (51 loc) · 1.42 KB
/
mff.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef _MFF_HPP_
#define _MFF_HPP_
#include "rhyd.hpp"
#define MUSTA_K 24
const dtype CFLN = 0.3 ;
const bool FLUX_X = 1 ;
const bool FLUX_Y = 0 ;
class mff : public rhyd{
/**
* f_{i+1/2} flux.
*/
hyd fi_x, fi_y;
/**
* TMP variables for MUSTA method.
*/
std::vector<dtype> ql, qm, qr, fl, fm, fr;
/**
* Calculate fi with MUSTA FORCE K method.
*/
void iflux(void (rhyd::*)(std::vector<dtype>&, const dtype&, const dtype&, const dtype&, const dtype&));
/**
* Function forwarder and obj.
*/
std::vector<void*> call_context;
std::vector<void (*)(void*, const uint&, const uint&)> call_func;
/**
* Boundary condition.
*/
void boundary(const uint&, const uint&);
/**
* Find max of v.
*/
dtype vmax, kappamax;
bool mdirx;
void init_max();
void find_max(const uint&, const uint&);
void update_dt();
dtype navg(bool, const uint&, const uint&, const uint&);
public:
mff();
mff(const dtype&, const dtype&,const dtype&, hyd*);
/**
* Set variables.
*/
void set(const dtype& kappa){rhyd::set(kappa);}
void set(const dtype&, const dtype&,const dtype&, hyd*);
void add_callfunc(void*, void (*)(void*, const uint&, const uint&));
void step();
dtype get_flux(bool, const uint&, const uint&, const uint&);
};
#endif // _MFF_HPP_