WARPXM v1.10.0
Loading...
Searching...
No Matches
oedg_limiter.h
Go to the documentation of this file.
1#pragma once
2
4#include "dfem/tools/tools.h"
8#include "lib/wxobject.h"
9
10namespace wxm
11{
12namespace dfem
13{
14namespace variable_adjuster
15{
16namespace limiter
17{
18
20{
21 EULER = 0,
22 IMHD = 1,
23};
24
26 public WxObject
27{
28public:
29 oedg_limiter() = default;
30
31 virtual void setup(const WxCryptSet& wxc) override;
32
33 void solve(real time, variables_type& input, real dt) override;
34
35 void Barrier(const WxMsgBase& msg, const real time, variables_type& input) override;
36
37protected:
38 void allocate();
39
40 void zero();
41
42 real& derivative_face_jump_sum_at(unsigned int comp_index,
43 unsigned int face_index,
44 unsigned int m);
45
46 real element_volume(unsigned int element);
47
48 // Computes dst = A * x, assuming row-major storage of NpxNp matrices.
49 void matvec_Np(const real* A, real* x, real* dst);
50
59 void compute_multiderivatives(unsigned int element);
60
65 void store_multiderivatives_to_global_nodes(unsigned int comp_index,
66 unsigned int element);
67
68 real sum_over_face_integrals(unsigned int comp_index,
69 unsigned int global_face_index,
70 unsigned int m);
71
72 real estimate_wavespeed_normal_to_face(unsigned int element_index,
73 unsigned int face_index,
74 std::vector<wxm::array::patch_array_t*> input);
75
76 void
77 filter_orthogonal_polynomial_modes(unsigned int comp_index,
78 unsigned int element_index,
79 real dt,
80 std::vector<wxm::array::patch_array_t*> input);
81
82private:
83 std::string _basisSetName;
84 WmBasisArraySet _basis_set;
85
86 std::unique_ptr<WmUDGGeometry> _dg_geometry;
87
88 unsigned int _N_dims;
89
90 // The number of components being limited
91 unsigned int _N_comps;
92
93 // Total number of faces in the mesh
94 unsigned int _N_global_faces;
95
96 unsigned int _N_elements;
97
98 // Faces per element
99 unsigned int N_f;
100
101 // Nodes per element
102 unsigned int N_p;
103
104 // Nodes per face
105 unsigned int N_fp;
106
107 // The greatest total degree of polynomials in the approximation space.
108 unsigned int _N_poly_degree;
109
110 unsigned int _N_multiindices;
111
112 wxm::dfem::tools::scope_t _element_scope;
113 wxm::dfem::tools::scope_t _limiting_scope;
114 wxm::dfem::tools::scope_t _faces_scope;
115
116 OEDG_WAVESPEED_ESTIMATOR_STRATEGY wavespeed_estimator_strategy;
117
122 real _global_volume_sum;
123 std::vector<real> _global_sums;
124 std::vector<real> _global_averages;
125 std::vector<real> _global_mins;
126 std::vector<real> _global_maxs;
127
128 real patch_global_volume_sum;
129 std::vector<real> patch_global_sums;
130 std::vector<real> patch_global_averages;
131 std::vector<real> patch_global_mins;
132 std::vector<real> patch_global_maxs;
133
140 std::vector<real> _nodal_derivative_values_scratch;
141
146 std::vector<real> derivative_face_values;
147
148 std::vector<real> multiderivative_nodal_values;
149
154 std::vector<real> derivative_face_jump_integrals;
155
169 std::vector<real> derivative_face_jump_sums;
170
174 std::vector<real> delta_m_Ks;
175
179 std::vector<real> modes;
180 std::vector<real> filtered_modes;
181 std::vector<real> values;
182 std::vector<real> filtered_values;
183
184 real gas_gamma;
185};
186
187} // namespace limiter
188} // namespace variable_adjuster
189
190} // namespace dfem
191} // namespace wxm
Definition: wmbasisarrayset.h:14
WxCryptSet extends WxCrypt by providing, in addition to name-value pairs, an set of named WxCryptSets...
Definition: wxcryptset.h:35
Provides an abstract interface for message based communication between different processes.
Definition: wxmsgbase.h:22
WxObject is a base class for WarpX classes which need to go through a creation/destruction cycle with...
Definition: wxobject.h:54
Definition: tools.h:22
void compute_multiderivatives(unsigned int element)
Compute the list of all partial derivatives by repeated multiplication with the D_x,...
void solve(real time, variables_type &input, real dt) override
applies the variable adjuster to input
real & derivative_face_jump_sum_at(unsigned int comp_index, unsigned int face_index, unsigned int m)
void filter_orthogonal_polynomial_modes(unsigned int comp_index, unsigned int element_index, real dt, std::vector< wxm::array::patch_array_t * > input)
real estimate_wavespeed_normal_to_face(unsigned int element_index, unsigned int face_index, std::vector< wxm::array::patch_array_t * > input)
void matvec_Np(const real *A, real *x, real *dst)
virtual void setup(const WxCryptSet &wxc) override
Setup object using supplied crypset.
real sum_over_face_integrals(unsigned int comp_index, unsigned int global_face_index, unsigned int m)
void store_multiderivatives_to_global_nodes(unsigned int comp_index, unsigned int element)
Extract the values of the partial derivatives at face nodes and store them to another intermediate ar...
void Barrier(const WxMsgBase &msg, const real time, variables_type &input) override
An opportunity for the variable adjuster to perform any MPI operations it needs to after solve is cal...
The WmVariableAdjuster class is a base class for variable adjusters.
Definition: variable_adjuster.h:31
wxm::temporal_solver::variables_type variables_type
Definition: variable_adjuster.h:41
OEDG_WAVESPEED_ESTIMATOR_STRATEGY
Definition: oedg_limiter.h:20
@ IMHD
Definition: oedg_limiter.h:22
@ EULER
Definition: oedg_limiter.h:21
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8
#define real
Definition: wmoclunstructuredreconstruction.h:11