9#include "wxm_boost/math/constants/constants.hpp"
16namespace variable_adjuster
20namespace positivity_enforcing
37 std::vector<real>& B_x_bar,
38 std::vector<real>& B_y_bar,
39 std::vector<real>& B_z_bar,
43 int num_pp_quad_nodes,
44 int num_lagrange_nodes,
46 : euler_helper(euler_helper),
54 _B_x_pp_quad_node_values = std::vector<real>(num_pp_quad_nodes);
55 _B_y_pp_quad_node_values = std::vector<real>(num_pp_quad_nodes);
56 _B_z_pp_quad_node_values = std::vector<real>(num_pp_quad_nodes);
98 bool include_gaussian_quad_nodes,
99 bool include_interior_lgl_nodes);
123 std::vector<real>& _B_x_bar;
124 std::vector<real>& _B_y_bar;
125 std::vector<real>& _B_z_bar;
127 std::vector<real> _B_x_pp_quad_node_values;
128 std::vector<real> _B_y_pp_quad_node_values;
129 std::vector<real> _B_z_pp_quad_node_values;
Definition: wmbasisarrayset.h:13
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 patch_array_t class defines a dataset associated with a patch of the domain This class will be us...
Definition: patch_array.h:31
Helper class for the NDGEulerPositivityPreservingLimiter.
Definition: ndg_euler_positivity_enforcing_limiter.h:33
Helper class for the NDGMHDPositivityPreservingLimiter.
Definition: ndg_mhd_positivity_enforcing_limiter.h:34
real calculateThetaE(int element_index, real internal_energy_bar, real eps_p)
void convertElementLagrangeToPPQuadNodes(WmBasisArraySet &basis_set, int element_start, bool include_gaussian_quad_nodes, bool include_interior_lgl_nodes)
Perform the conversion of Lagrange nodal to Positivity-preserving quadrature nodal values,...
real internalEnergyOfCellAverage(int element_index)
Compute the internal energy of the cell average, e_bar - |rho_u_bar|^2 / (2*rho_bar) - |B_bar|^2/2.
void scaleByThetaRhoAndThetaE(int element_index, real theta_rho, real theta_e)
Complete the scaling by theta_rho and theta_e, overwriting the given element's data in _rho_array,...
static real internal_energy(real rho, real rho_ux, real rho_uy, real rho_uz, real E, real B_x, real B_y, real B_z, int ndims)
Compute the internal energy, E - |rho_u|^2/(2*rho) - |B|^2/2.
void take_elementwise_averages(WmBasisArraySet &basis_set, WxRange &_element_range, int ndims)
Take elementwise averages over the given element range, and write them to the _bar suffixed instance ...
real calculateAndScalePPQuadNodesByThetaRho(int element_index, real eps_rho)
Perform the scaling by theta_rho.
MHDLimiterHelper(EulerLimiterHelper euler_helper, std::vector< real > &B_x_bar, std::vector< real > &B_y_bar, std::vector< real > &B_z_bar, wxm::array::patch_array_t *B_x, wxm::array::patch_array_t *B_y, wxm::array::patch_array_t *B_z, int num_pp_quad_nodes, int num_lagrange_nodes, int ndims)
Definition: ndg_mhd_positivity_enforcing_limiter.h:36
Simple scaling limiter which enforces positivity of density and pressure while preserving cell averag...
Definition: ndg_mhd_positivity_enforcing_limiter.h:152
real _eps_rho
The minimum allowable value of density.
Definition: ndg_mhd_positivity_enforcing_limiter.h:173
bool _include_gaussian_quad_nodes
Whether the basis's GQ nodes should be included in the set of positivity nodes.
Definition: ndg_mhd_positivity_enforcing_limiter.h:184
std::vector< real > _rho_uy_bar
Definition: ndg_mhd_positivity_enforcing_limiter.h:202
void solve(real time, variables_type &input) override
Applies the limiter to input by modifying it in place.
std::vector< real > _rho_ux_bar
Definition: ndg_mhd_positivity_enforcing_limiter.h:201
std::vector< real > _B_z_bar
Definition: ndg_mhd_positivity_enforcing_limiter.h:207
WxRange _element_range
Definition: ndg_mhd_positivity_enforcing_limiter.h:198
std::vector< real > _e_bar
Definition: ndg_mhd_positivity_enforcing_limiter.h:204
WmBasisArraySet _basis_set
Definition: ndg_mhd_positivity_enforcing_limiter.h:168
std::vector< real > _B_x_bar
Definition: ndg_mhd_positivity_enforcing_limiter.h:205
virtual void setup(const WxCryptSet &wxc) override
Setup the spatial solver using the cryptset.
bool _include_interior_lgl_nodes
Whether the basis's interior LGL nodes should be included in the set of positivity nodes.
Definition: ndg_mhd_positivity_enforcing_limiter.h:196
std::vector< real > _rho_uz_bar
Definition: ndg_mhd_positivity_enforcing_limiter.h:203
real _eps_p
The minimum allowable value of density.
Definition: ndg_mhd_positivity_enforcing_limiter.h:176
std::vector< real > _rho_bar
Definition: ndg_mhd_positivity_enforcing_limiter.h:200
NDGMHDPositivityPreservingLimiter()=default
std::unique_ptr< WmUDGGeometry > _dg_geometry
Definition: ndg_mhd_positivity_enforcing_limiter.h:170
std::vector< real > _B_y_bar
Definition: ndg_mhd_positivity_enforcing_limiter.h:206
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
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8
#define real
Definition: wmoclunstructuredreconstruction.h:11