WARPXM v1.10.0
Loading...
Searching...
No Matches
wmexplicitrungekuttascheme.h
Go to the documentation of this file.
1#ifndef WMEXPLICITRUNGEKUTTASCHEME_H
2#define WMEXPLICITRUNGEKUTTASCHEME_H
3
4#include "warpxm/warpxm_config.h"
5
6#include "array/array.h"
7
9
10// STL includes
11#include <vector>
12
14
15namespace wxm
16{
17namespace variable
18{
19class distributed_variable_t;
20}
21} // namespace wxm
22
29
31{
32public:
33 // pair of variable/component
34 typedef std::vector<std::pair<wxm::variable::distributed_variable_t*, size_t>>
36
38
39 virtual ~WmExplicitRungeKuttaScheme() = default;
40
41 int getNumStages() const
42 {
43 return _numStages;
44 }
45 real getTimeUpdate(const int rkStage) const
46 {
47 return timeUpdates_[rkStage];
48 }
50 {
51 return _cfl_max;
52 }
53
57 virtual void
58 calc_stage(int stage,
59 const std::vector<wxm::temporal_solver::temporal_var>& temporal_vars,
60 std::vector<variables_type>& vars,
61 real dt) const;
62
63 void print_stage_definition(int stage) const;
64
65protected:
66 int stage_offset(int stage) const
67 {
68 return ((stage + 1) * (stage + 2) >> 1) - 1;
69 }
70
73 std::vector<real> timeUpdates_;
74 std::vector<real> multipliers_;
75};
76
77#endif // WMEXPLICITRUNGEKUTTASCHEME_H
The WmExplicitRungeKuttaScheme class.
Definition: wmexplicitrungekuttascheme.h:31
std::vector< std::pair< wxm::variable::distributed_variable_t *, size_t > > variables_type
Definition: wmexplicitrungekuttascheme.h:35
real getTimeUpdate(const int rkStage) const
Definition: wmexplicitrungekuttascheme.h:45
std::vector< real > timeUpdates_
Definition: wmexplicitrungekuttascheme.h:73
real getCFLLimit() const
Definition: wmexplicitrungekuttascheme.h:49
WmExplicitRungeKuttaScheme()=default
int getNumStages() const
Definition: wmexplicitrungekuttascheme.h:41
real _cfl_max
Definition: wmexplicitrungekuttascheme.h:71
virtual ~WmExplicitRungeKuttaScheme()=default
int stage_offset(int stage) const
Definition: wmexplicitrungekuttascheme.h:66
void print_stage_definition(int stage) const
int _numStages
Definition: wmexplicitrungekuttascheme.h:72
std::vector< real > multipliers_
Definition: wmexplicitrungekuttascheme.h:74
virtual void calc_stage(int stage, const std::vector< wxm::temporal_solver::temporal_var > &temporal_vars, std::vector< variables_type > &vars, real dt) const
Computes u^*(stage)
Definition: wmunstructuredpatch.h:22
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8
#define real
Definition: wmoclunstructuredreconstruction.h:11