WARPXM v1.10.0
Loading...
Searching...
No Matches
wmimplicitrkscheme.h
Go to the documentation of this file.
1#ifndef WMIMPLICITRKSCHEME_H
2#define WMIMPLICITRKSCHEME_H
3
4#include "warpxm/warpxm_config.h"
5
6#include "array/array.h"
7
9
10#include <petscvec.h>
11
12// STL includes
13#include <vector>
14
16
17namespace wxm
18{
19namespace variable
20{
21class distributed_variable_t;
22}
23
24namespace temporal
25{
26
27class implicit;
28
33{
46 std::vector<Vec> stages_;
47
55 bool extra_accumulator_;
56
62 std::vector<std::pair<size_t, size_t>> copy_ranges_;
63
64 implicit* ts_ = nullptr;
65
66 struct pimpl;
67
68 pimpl* impl_;
69
70public:
71 // pair of variable/component
72 typedef std::vector<std::pair<wxm::variable::distributed_variable_t*, size_t>>
74
75 ImplicitRKScheme(int num_stages,
76 std::vector<real> time_updates,
77 std::vector<real> multipliers,
78 bool extra_accumulator);
79
81
83
84 int getNumStages() const
85 {
86 return _numStages;
87 }
88 real getTimeUpdate(const int rkStage) const
89 {
90 return timeUpdates_[rkStage];
91 }
93 {
94 return _cfl_max;
95 }
96
100 void allocate(MPI_Comm comm,
101 const std::vector<wxm::temporal_solver::temporal_var>& temporal_vars,
102 implicit& ts);
103
112 calc_stage(int stage,
113 const std::vector<wxm::temporal_solver::temporal_var>& temporal_vars,
114 std::vector<variables_type>& vars,
115 real dt);
116
117 void print_stage_definition(int stage) const;
118
119protected:
120 int stage_offset(int stage) const
121 {
122 return ((stage + 1) * (stage + 2) >> 1) - 1;
123 }
124
127 std::vector<real> timeUpdates_;
128 std::vector<real> multipliers_;
129};
130} // namespace temporal
131} // namespace wxm
132
133#endif
Definition: wmunstructuredpatch.h:22
Represents important parameters for the efficacy of a completing simulation step.
Definition: wxstepperstatus.h:19
Handles basic singly implicit RK time integration.
Definition: wmimplicitrkscheme.h:33
real getTimeUpdate(const int rkStage) const
Definition: wmimplicitrkscheme.h:88
ImplicitRKScheme(int num_stages, std::vector< real > time_updates, std::vector< real > multipliers, bool extra_accumulator)
int stage_offset(int stage) const
Definition: wmimplicitrkscheme.h:120
void allocate(MPI_Comm comm, const std::vector< wxm::temporal_solver::temporal_var > &temporal_vars, implicit &ts)
Allocates internal buffers for interfacing with non-linear solvers.
std::vector< real > timeUpdates_
Definition: wmimplicitrkscheme.h:127
std::vector< real > multipliers_
Definition: wmimplicitrkscheme.h:128
int getNumStages() const
Definition: wmimplicitrkscheme.h:84
real getCFLLimit() const
Definition: wmimplicitrkscheme.h:92
ImplicitRKScheme(const ImplicitRKScheme &)=delete
real _cfl_max
Definition: wmimplicitrkscheme.h:125
void print_stage_definition(int stage) const
std::vector< std::pair< wxm::variable::distributed_variable_t *, size_t > > variables_type
Definition: wmimplicitrkscheme.h:73
int _numStages
Definition: wmimplicitrkscheme.h:126
WxStepperStatus calc_stage(int stage, const std::vector< wxm::temporal_solver::temporal_var > &temporal_vars, std::vector< variables_type > &vars, real dt)
Computes u^*(stage)
Fully implicit temporal solver.
Definition: implicit.h:19
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8
#define real
Definition: wmoclunstructuredreconstruction.h:11