WARPXM v1.10.0
Loading...
Searching...
No Matches
wxm::dfem::variable_adjuster::gradient::gradient Class Reference

The WmVariableAdjusterGradient class is a gradient adjuster. More...

#include <gradient.h>

Inheritance diagram for wxm::dfem::variable_adjuster::gradient::gradient:
wxm::dfem::variable_adjuster::variable_adjuster_t WmPatchProcess

Detailed Description

The WmVariableAdjusterGradient class is a gradient adjuster.

Public Member Functions

 gradient ()=default
 
void setup (const WxCryptSet &wxc) override
 Setup the spatial solver using the cryptset.
 
void solve (real time, variables_type &input) override
 Solves the spatial system and puts result in _rhs.
 
- Public Member Functions inherited from wxm::dfem::variable_adjuster::variable_adjuster_t
 variable_adjuster_t ()
 Constructor.
 
void setup (const WxCryptSet &wxc) override
 Setup the spatial solver using the cryptset.
 
virtual void solve (real time, variables_type &input)=0
 applies the variable adjuster to input
 
std::vector< wxm::array::patch_array_t * > get_patch_arrays (const variables_type &in)
 
void process () override
 
virtual const std::vector< size_t > & get_input_indices () const
 
int priority () const
 Getter function for priority.
 
virtual void Barrier (const WxMsgBase &msg, const real time, variables_type &input)
 An opportunity for the variable adjuster to perform any MPI operations it needs to after solve is called.
 
- Public Member Functions inherited from WmPatchProcess
 WmPatchProcess ()
 
virtual ~WmPatchProcess ()=default
 
void step ()
 
virtual void process ()=0
 
void setPatch (const WmUnstructuredPatch *patch)
 
void setParentTaskProcessor (WmPatchProcessor *taskProcessor)
 
virtual std::string name (std::string prefix="patchedProcessor.") const
 
virtual void setup (const WxCryptSet &wxc)
 
void setParentSolver (const WmSolverBase *solver)
 
void setDt (WxStepper::time_t dt)
 
void setTime (WxStepper::time_t time)
 
WxStepper::time_t getSuggestedDt () const
 
const WmUnstructuredPatchget_patch () const
 
const WmSolverget_solver () const
 

Protected Member Functions

void alloc_fluxes ()
 
void zero_fluxes ()
 
void ex_kernel (const WxRange &face_scope_range, std::vector< wxm::array::patch_array_t * > &input)
 
void ldg_scheme (const int faceIndex, const int local_face_node_index, const int global_node_index_in, const int global_node_index_out, solverVariables_t *pSV, std::vector< wxm::array::patch_array_t * > &input)
 
void ip_scheme (const int faceIndex, const int local_face_node_index, const int global_node_index_in, const int global_node_index_out, solverVariables_t *pSV, std::vector< wxm::array::patch_array_t * > &input)
 
void in_kernel (const WxRange &element_scope_range, std::vector< wxm::array::patch_array_t * > &input)
 
void co_kernel (const WxRange &element_scope_range, std::vector< wxm::array::patch_array_t * > &input)
 

Protected Attributes

std::vector< size_t > _gradient_input_indexes
 
std::vector< size_t > _gradient_output_indexes
 
std::string _gradient_method
 
real _penalty_beta
 
real _penalty_eta
 
std::string _basisSetName
 
WmBasisArraySet _basis_set
 
std::unique_ptr< WmUDGGeometry_dg_geometry
 
std::vector< std::vector< std::vector< std::vector< real > > > > _numerical_fluxes
 
std::vector< std::vector< std::vector< real > > > _internal_fluxes
 
wxm::dfem::tools::scope_t _element_flux
 
wxm::dfem::tools::scope_t _face_flux
 
WxRange _chunk_size_element
 
WxRange _chunk_size_face
 
bool _standard_ldg_flux_alternation
 "Standard" refers to the sign when adding the beta penalty for LDG, the u*_h numerical flux value as given in Table 7.3 in Hesthaven & Warburton, Nodal Discontinuous Galerkin Methods, 2008.
 
- Protected Attributes inherited from wxm::dfem::variable_adjuster::variable_adjuster_t
std::vector< size_t > _var_idcs
 
std::vector< std::unique_ptr< WmApplication > > _apps
 
bool _grab_all = false
 
int _priority
 
- Protected Attributes inherited from WmPatchProcess
std::string _ppName
 
WmPatchProcessor_parentTaskProcessor
 
const WmUnstructuredPatch_patch
 
std::vector< std::string > _onSubdomains
 
WxStepper::time_t _time
 
WxStepper::time_t _dt
 
WxStepper::time_t _suggested_dt
 
WxLogStream _debStrm = WxLogger::get("warpx-root.console")->getDebugStream()
 
const WmSolverBase_parentSolver = nullptr
 

Additional Inherited Members

- Public Types inherited from wxm::dfem::variable_adjuster::variable_adjuster_t
typedef wxm::temporal_solver::variables_type variables_type
 

Constructor & Destructor Documentation

◆ gradient()

wxm::dfem::variable_adjuster::gradient::gradient::gradient ( )
default

Member Function Documentation

◆ alloc_fluxes()

void wxm::dfem::variable_adjuster::gradient::gradient::alloc_fluxes ( )
protected

◆ co_kernel()

void wxm::dfem::variable_adjuster::gradient::gradient::co_kernel ( const WxRange element_scope_range,
std::vector< wxm::array::patch_array_t * > &  input 
)
protected

◆ ex_kernel()

void wxm::dfem::variable_adjuster::gradient::gradient::ex_kernel ( const WxRange face_scope_range,
std::vector< wxm::array::patch_array_t * > &  input 
)
protected

◆ in_kernel()

void wxm::dfem::variable_adjuster::gradient::gradient::in_kernel ( const WxRange element_scope_range,
std::vector< wxm::array::patch_array_t * > &  input 
)
protected

◆ ip_scheme()

void wxm::dfem::variable_adjuster::gradient::gradient::ip_scheme ( const int  faceIndex,
const int  local_face_node_index,
const int  global_node_index_in,
const int  global_node_index_out,
solverVariables_t pSV,
std::vector< wxm::array::patch_array_t * > &  input 
)
protected

◆ ldg_scheme()

void wxm::dfem::variable_adjuster::gradient::gradient::ldg_scheme ( const int  faceIndex,
const int  local_face_node_index,
const int  global_node_index_in,
const int  global_node_index_out,
solverVariables_t pSV,
std::vector< wxm::array::patch_array_t * > &  input 
)
protected

◆ setup()

void wxm::dfem::variable_adjuster::gradient::gradient::setup ( const WxCryptSet wxc)
overridevirtual

Setup the spatial solver using the cryptset.

Parameters
wxcThe cryptset

Reimplemented from WmPatchProcess.

◆ solve()

void wxm::dfem::variable_adjuster::gradient::gradient::solve ( real  time,
variables_type input 
)
overridevirtual

Solves the spatial system and puts result in _rhs.

Implements wxm::dfem::variable_adjuster::variable_adjuster_t.

◆ zero_fluxes()

void wxm::dfem::variable_adjuster::gradient::gradient::zero_fluxes ( )
protected

Member Data Documentation

◆ _basis_set

WmBasisArraySet wxm::dfem::variable_adjuster::gradient::gradient::_basis_set
protected

◆ _basisSetName

std::string wxm::dfem::variable_adjuster::gradient::gradient::_basisSetName
protected

◆ _chunk_size_element

WxRange wxm::dfem::variable_adjuster::gradient::gradient::_chunk_size_element
protected

◆ _chunk_size_face

WxRange wxm::dfem::variable_adjuster::gradient::gradient::_chunk_size_face
protected

◆ _dg_geometry

std::unique_ptr<WmUDGGeometry> wxm::dfem::variable_adjuster::gradient::gradient::_dg_geometry
protected

◆ _element_flux

wxm::dfem::tools::scope_t wxm::dfem::variable_adjuster::gradient::gradient::_element_flux
protected

◆ _face_flux

wxm::dfem::tools::scope_t wxm::dfem::variable_adjuster::gradient::gradient::_face_flux
protected

◆ _gradient_input_indexes

std::vector<size_t> wxm::dfem::variable_adjuster::gradient::gradient::_gradient_input_indexes
protected

◆ _gradient_method

std::string wxm::dfem::variable_adjuster::gradient::gradient::_gradient_method
protected

◆ _gradient_output_indexes

std::vector<size_t> wxm::dfem::variable_adjuster::gradient::gradient::_gradient_output_indexes
protected

◆ _internal_fluxes

std::vector<std::vector<std::vector<real> > > wxm::dfem::variable_adjuster::gradient::gradient::_internal_fluxes
protected

◆ _numerical_fluxes

std::vector<std::vector<std::vector<std::vector<real> > > > wxm::dfem::variable_adjuster::gradient::gradient::_numerical_fluxes
protected

◆ _penalty_beta

real wxm::dfem::variable_adjuster::gradient::gradient::_penalty_beta
protected

◆ _penalty_eta

real wxm::dfem::variable_adjuster::gradient::gradient::_penalty_eta
protected

◆ _standard_ldg_flux_alternation

bool wxm::dfem::variable_adjuster::gradient::gradient::_standard_ldg_flux_alternation
protected

"Standard" refers to the sign when adding the beta penalty for LDG, the u*_h numerical flux value as given in Table 7.3 in Hesthaven & Warburton, Nodal Discontinuous Galerkin Methods, 2008.

For gradients when using LDG, you should use the "alternating principle", where the sign for adding the beta penalty alternates when calculating the numerical flux for the gradient and the time-advance equation. If you have a higher order derivative, you might want to keeep alternating, so if you use this gradient solver successively for multiple gradients, you might need to switch each one with _standard_ldg_flux_alternation = True / False / True, etc., for example. Note that when calculating the numerical flux for the time-advance equation (using the q*_h value for the numerical flux in Table 7.3), you have to make the consistent choice of sign on beta in accordance to the alternating principle. Typically, beta should be either -0.5, +0.5, or 0. If you choose beta = 0, you are reverting to using "central flux" where you are no longer alternating flux directions when calculating numerical fluxes for the gradient and solving the time-advance equation, which seems to work for parabolic equations, though if you were to use it to solve elliptic equations, it might be unstable; See: Arnold, Siam J. Numer. Anal., Vol. 39, No. 5, pp. 1749-1779, 2002 (Unified Analysis of Discontinuous Galerkin Methods for Elliptic Problems). Also see Xu & Shu, Commun. Comput. Phys., Vol. 7, No. 1, pp. 1-46, 2010 (Local Discontinuous Methods for High-Order Time-Dependent Partial Differential Equations) as well as Hesthaven Ch. 7 for more on LDG, the alternating principle, and examples of solved equations. Datta Dissertation 2021, Ch. 3, also has a description LDG and interior penalty as implemented here.


The documentation for this class was generated from the following file: