WARPXM v1.10.0
Loading...
Searching...
No Matches
ndg.h
Go to the documentation of this file.
1#ifndef WXM_DFEM_SPATIALSOLVER_NDG_H
2#define WXM_DFEM_SPATIALSOLVER_NDG_H
3
4// STL libraries
5#include <algorithm>
6#include <fstream>
7#include <iostream>
8#include <list>
9#include <map>
10#include <vector>
11
12// Wm includes
15#include "dfem/tools/tools.h"
17
19
20class WmApplication;
21
22namespace wxm
23{
24namespace dfem
25{
26namespace solver
27{
28namespace dg
29{
30// /**
31// * \addtogroup spatialsolver
32// * @{
33// */
34
35// /**
36// * \addtogroup spatialsolver
37// * @{
38// */
39
46{
47public:
50
55 void setup(const WxCryptSet& wxc) override;
56
60 const std::shared_ptr<TimestepConstraint>
61 solve(const real time, const variables_type& input, variables_type& output) override;
62
66 const WxRange& element_interior_range() const override
67 {
69 }
70
74 const WxRange& element_periphery_range() const override
75 {
77 }
78
83 const WxRange& element_full_range() const override
84 {
85 return _element_flux._full;
86 }
87
88 size_t get_num_dof() const override
89 {
91 }
92
93protected:
95 bool add_definition(const WmApplication& app, const int key);
96
97 // void grad_q_approx(const WxRange& element_scope_range, const real time, const
98 // std::vector<wxm::array::patch_array_t*>& input,
99 // std::vector<std::vector<std::vector<real>>>);
100
101 const std::shared_ptr<TimestepConstraint>
102 ex_kernel(const WxRange& face_scope_range,
103 const real time,
104 const std::vector<wxm::array::patch_array_t*>& input);
105
106 const std::shared_ptr<TimestepConstraint>
107 exKernelBC(const WxRange& face_scope_range,
108 const real time,
109 const std::vector<wxm::array::patch_array_t*>& input);
110
111 // real in_kernel(const WxRange& element_scope_range, const real time,
112 // const std::vector<wxm::array::patch_array_t*>& input,
113 // std::vector<wxm::array::patch_array_t*>& output);
114
115 virtual const std::shared_ptr<TimestepConstraint>
116 in_kernel(const WxRange& element_scope_range,
117 const real time,
118 const std::vector<wxm::array::patch_array_t*>& input);
119
120 virtual void rhs_kernel(const WxRange& element_scope_range,
121 std::vector<wxm::array::patch_array_t*>& output);
122
123 void print_kernel(const WxRange& element_scope_range);
124
125 // void rhs_kernel_old(const WxRange& element_scope_range,
126 // std::vector<wxm::array::patch_array_t*>& output);
127
128 // TODO: this is only override because zero_fluxes isn't
129 // designed to take advantage of scopes yet. Need to fix in
130 // ndg_t
131 void zero_fluxes() override;
132
134
135 // Temporal solver
138
141
144
147
148 // Spatial basis set name
149 std::string _basisSetName;
150
151 // Spatial basis set
153
154 // Source quadrature style
156
157 // // Log Stream
158 // WxLogStream _debug_stream;
159
160 // WmUDGGeometry
161 std::unique_ptr<WmUDGGeometry> _dg_geometry;
162
163 // Fluxes
164 std::vector<std::vector<std::vector<real>>> _numerical_fluxes;
165 std::vector<std::vector<std::vector<std::vector<real>>>> _internal_fluxes;
166
167 // Sources
168 std::vector<std::vector<std::vector<real>>> _sources;
169
173 std::vector<std::vector<size_t>> app_to_rhs_idcs_num_flux;
174
178 std::vector<std::vector<size_t>> app_to_rhs_idcs_int_flux;
179
183 std::vector<std::vector<size_t>> app_to_rhs_idcs_source;
184
188 std::vector<std::vector<size_t>> _app_to_rhs_idcs_bc_num_flux;
189
192
195
200 std::vector<std::string> _numerical_flux_bc_boundaries;
201
207
208private:
210 ndg_t& operator=(const ndg_t& var) = delete;
211
213 ndg_t(const ndg_t& var) = delete;
214};
216} // namespace dg
217} // namespace solver
218} // namespace dfem
219} // namespace wxm
220
221#endif
Base Class for physics applications.
Definition: wmapplication.h:93
Definition: wmbasisarrayset.h:13
int getNumTotalNodes() const
Definition: wmbasisarrayset.h:47
WxCryptSet extends WxCrypt by providing, in addition to name-value pairs, an set of named WxCryptSets...
Definition: wxcryptset.h:35
WxRange represents a hyper-rectangular domain of an n-dimensional space of integers.
Definition: wxrange.h:23
The ndg_t class is used for solving the discontinuous Galerkin method.
Definition: ndg.h:46
real _penalty_beta
Definition: ndg.h:142
std::vector< std::vector< size_t > > app_to_rhs_idcs_int_flux
Cache for convert_to_rhs_indexes() for internal fluxes.
Definition: ndg.h:178
bool _sources_gq
Definition: ndg.h:140
std::vector< std::vector< std::vector< real > > > _sources
Definition: ndg.h:168
bool _has_fluxes
Definition: ndg.h:145
std::vector< std::vector< size_t > > app_to_rhs_idcs_num_flux
Cache for convert_to_rhs_indexes() for numerical fluxes.
Definition: ndg.h:173
bool _test_dt
Definition: ndg.h:137
WmBasisArraySet _basis_set
Definition: ndg.h:152
const std::shared_ptr< TimestepConstraint > exKernelBC(const WxRange &face_scope_range, const real time, const std::vector< wxm::array::patch_array_t * > &input)
std::unique_ptr< WmUDGGeometry > _dg_geometry
Definition: ndg.h:161
wxm::dfem::tools::scope_t _element_flux
Definition: ndg.h:190
wxm::dfem::tools::scope_t _face_flux
Definition: ndg.h:191
WxRange _chunk_size_face
Definition: ndg.h:194
std::string _source_quad_style
Definition: ndg.h:155
bool _sources_lgl
Definition: ndg.h:139
const std::shared_ptr< TimestepConstraint > ex_kernel(const WxRange &face_scope_range, const real time, const std::vector< wxm::array::patch_array_t * > &input)
std::vector< int > _numerical_flux_bc_boundary_global_face_indexes
vector of boundary face indexes on which to apply boundary conditions through numerical fluxes
Definition: ndg.h:206
const std::shared_ptr< TimestepConstraint > solve(const real time, const variables_type &input, variables_type &output) override
Computes the RHS.
void print_kernel(const WxRange &element_scope_range)
std::string _basisSetName
Definition: ndg.h:149
std::vector< std::vector< size_t > > _app_to_rhs_idcs_bc_num_flux
Cache for convert_to_rhs_indexes() for bc numerical fluxes.
Definition: ndg.h:188
size_t get_num_dof() const override
Gets the number of degrees of freedom per element per component.
Definition: ndg.h:88
real _cfl
Definition: ndg.h:136
std::vector< std::vector< size_t > > app_to_rhs_idcs_source
Cache for convert_to_rhs_indexes() for sources.
Definition: ndg.h:183
virtual const std::shared_ptr< TimestepConstraint > in_kernel(const WxRange &element_scope_range, const real time, const std::vector< wxm::array::patch_array_t * > &input)
virtual void rhs_kernel(const WxRange &element_scope_range, std::vector< wxm::array::patch_array_t * > &output)
std::vector< std::string > _numerical_flux_bc_boundaries
vector of boundaries on which to apply boundary conditions through numerical fluxes
Definition: ndg.h:200
real _penalty_eta
Definition: ndg.h:143
bool _has_sources
Definition: ndg.h:146
bool add_definition(const WmApplication &app, const int key)
std::vector< std::vector< std::vector< real > > > _numerical_fluxes
Definition: ndg.h:164
const WxRange & element_full_range() const override
Get a range of elements associated with the entire patch (periphery+interior)
Definition: ndg.h:83
std::vector< std::vector< std::vector< std::vector< real > > > > _internal_fluxes
Definition: ndg.h:165
const WxRange & element_periphery_range() const override
Get a range of elements associated with the interior.
Definition: ndg.h:74
void setup(const WxCryptSet &wxc) override
setup sets up the DG solver
WxRange _chunk_size_element
Definition: ndg.h:193
const WxRange & element_interior_range() const override
Get a range of elements associated with the interior.
Definition: ndg.h:66
The WmSpatialSolver class is a base class for spatial sovers.
Definition: spatial_solver.h:32
wxm::temporal_solver::variables_type variables_type
Definition: spatial_solver.h:46
Definition: tools.h:22
WxRange _interior
Definition: tools.h:40
WxRange _periphery
Definition: tools.h:41
WxRange _full
Definition: tools.h:42
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8
#define real
Definition: wmoclunstructuredreconstruction.h:11