WARPXM v1.10.0
Loading...
Searching...
No Matches
wxm::dfem::solver::dg::NDGKinetic Class Reference

The NDGKinetic class is used for solving the discontinuous Galerkin method for kinetic problems. More...

#include <ndg_kinetic.h>

Inheritance diagram for wxm::dfem::solver::dg::NDGKinetic:
wxm::dfem::solver::spatial_solver_t WmPatchProcess

Detailed Description

The NDGKinetic class is used for solving the discontinuous Galerkin method for kinetic problems.

Public Member Functions

 NDGKinetic ()
 Constructor.
 
void setup (const WxCryptSet &wxc) override
 setup sets up the DG solver
 
const std::shared_ptr< TimestepConstraintsolve (const real time, const variables_type &input, variables_type &output) override
 Computes the RHS.
 
const WxRangeelement_interior_range () const override
 Get a range of elements associated with the interior.
 
const WxRangeelement_periphery_range () const override
 Get a range of elements associated with the interior.
 
const WxRangeelement_full_range () const override
 Get a range of elements associated with the entire patch (periphery+interior)
 
- Public Member Functions inherited from wxm::dfem::solver::spatial_solver_t
 spatial_solver_t ()=default
 
 ~spatial_solver_t () override=default
 
void setup (const WxCryptSet &wxc) override
 Setup the spatial solver using the cryptset.
 
virtual const std::shared_ptr< TimestepConstraintsolve (const real time, const variables_type &input, variables_type &output)=0
 Solves the spatial system.
 
virtual void Barrier (const WxMsgBase &msg, const real time, variables_type &output)
 
std::vector< wxm::array::patch_array_t * > get_patch_arrays (const variables_type &in) const
 
virtual const WxRangeelement_periphery_range () const =0
 Get a range of elements associated with the periphery.
 
virtual const WxRangeelement_interior_range () const =0
 Get a range of elements associated with the interior.
 
virtual const WxRangeelement_full_range () const =0
 Get a range of elements associated with the entire patch (periphery+interior)
 
virtual void zero_fluxes ()=0
 
const std::vector< size_t > & get_output_indices () const
 
std::vector< size_t > convert_to_rhs_indexes (const std::vector< int > &indexes) const
 Converts a vector of indexes to RHS indexes TODO: probably can remove at some point in the future?
 
virtual size_t get_num_dof () const =0
 Gets the number of degrees of freedom per element per component.
 
void process () override
 
- 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

size_t get_num_dof () const override
 This will give the number of nodes in each "super element" (dof = num nodes)
 
void zero_fluxes () override
 Must be implemented as required by spatial solver parent however in this solver I am not storing internal/numerical fluxes and sources in arrays to be zeroed so this will be an empty method.
 
const std::shared_ptr< TimestepConstraintcalcElementInternalFluxCSRFormat (const std::vector< wxm::array::patch_array_t * > &input, const int physical_element_index, const int velocity_space_element_indexes[3], const std::vector< std::vector< real > > &J_inv_lm, solverVariables_t *element_pSV, std::vector< std::vector< real > > &internal_flux_ij, std::vector< std::vector< real > > &allocation, std::vector< real > &theta_ilk, std::vector< real > &F_mik, std::vector< real > &q, std::vector< real > &aux) const
 Calculates internal_flux_ij = A_mjk F_imk for a particular phase space element.
 
const std::shared_ptr< TimestepConstraintcalcElementSourceTerm (const std::vector< wxm::array::patch_array_t * > &input, const int physical_element_index, const int velocity_space_element_indexes[3], solverVariables_t *element_pSV, std::vector< std::vector< real > > &source_term_ij, std::vector< real > &source_allocation, std::vector< real > &q, std::vector< real > &aux) const
 Calculates source_ij for a particular phase space element.
 
const std::shared_ptr< TimestepConstraintcalcElementNumericalFluxCSRFormat (const std::vector< wxm::array::patch_array_t * > &input, const int physical_element_index, const int velocity_space_element_indexes[3], const std::vector< std::vector< real > > &inverse_jacobian_phase_space, solverVariables_t *face_pSV, std::vector< std::vector< real > > &numerical_flux_ij, std::vector< real > &allocation, std::vector< real > &F_ik, std::vector< real > &q_in, std::vector< real > &q_out, std::vector< real > &aux_in, std::vector< real > &aux_out, std::vector< real > &a) const
 Calculates numerical_flux_ij = -sum over faces (G^-1_face Xi_jk^face tilde{F}_ik^face) where tilde{F}_i^face = n_m F_im^face where n is the normal This is for particular phase space element.
 

Additional Inherited Members

- Public Types inherited from wxm::dfem::solver::spatial_solver_t
typedef wxm::temporal_solver::variables_type variables_type
 
- Public Attributes inherited from wxm::dfem::solver::spatial_solver_t
bool test_dt = true
 True if this special solver should compute a stability-based recommended time step.
 
std::vector< std::unique_ptr< WmApplication > > _apps
 
- Protected Attributes inherited from wxm::dfem::solver::spatial_solver_t
std::vector< size_t > rhs_idcs_
 
std::vector< size_t > all_idcs_
 
- 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
 

Constructor & Destructor Documentation

◆ NDGKinetic()

wxm::dfem::solver::dg::NDGKinetic::NDGKinetic ( )

Constructor.

Member Function Documentation

◆ calcElementInternalFluxCSRFormat()

const std::shared_ptr< TimestepConstraint > wxm::dfem::solver::dg::NDGKinetic::calcElementInternalFluxCSRFormat ( const std::vector< wxm::array::patch_array_t * > &  input,
const int  physical_element_index,
const int  velocity_space_element_indexes[3],
const std::vector< std::vector< real > > &  J_inv_lm,
solverVariables_t element_pSV,
std::vector< std::vector< real > > &  internal_flux_ij,
std::vector< std::vector< real > > &  allocation,
std::vector< real > &  theta_ilk,
std::vector< real > &  F_mik,
std::vector< real > &  q,
std::vector< real > &  aux 
) const
protected

Calculates internal_flux_ij = A_mjk F_imk for a particular phase space element.

Parameters
inputpatch array input (q)
physical_element_index
velocity_space_element_indexes(vx_element_index, vy_element_index, vz_element_index)
A_jkm
element_PSVthe x and v gets set in here at each k node for F_imk calculation so it is not constant
internal_flux_ijthis is what is written into
Returns
timestep

◆ calcElementNumericalFluxCSRFormat()

const std::shared_ptr< TimestepConstraint > wxm::dfem::solver::dg::NDGKinetic::calcElementNumericalFluxCSRFormat ( const std::vector< wxm::array::patch_array_t * > &  input,
const int  physical_element_index,
const int  velocity_space_element_indexes[3],
const std::vector< std::vector< real > > &  inverse_jacobian_phase_space,
solverVariables_t face_pSV,
std::vector< std::vector< real > > &  numerical_flux_ij,
std::vector< real > &  allocation,
std::vector< real > &  F_ik,
std::vector< real > &  q_in,
std::vector< real > &  q_out,
std::vector< real > &  aux_in,
std::vector< real > &  aux_out,
std::vector< real > &  a 
) const
protected

Calculates numerical_flux_ij = -sum over faces (G^-1_face Xi_jk^face tilde{F}_ik^face) where tilde{F}_i^face = n_m F_im^face where n is the normal This is for particular phase space element.

Parameters
inputpatch array input (q)
physical_element_index
velocity_space_element_indexes(vx_element_index, vy_element_index, vz_element_index)
inverse_jacobian_phase_space
face_PSVthe x and v gets set in here at each k node for tilde{F}_ik^face calculation so it is not constant
numerical_flux_ijthis is what is written into
Returns
timestep

◆ calcElementSourceTerm()

const std::shared_ptr< TimestepConstraint > wxm::dfem::solver::dg::NDGKinetic::calcElementSourceTerm ( const std::vector< wxm::array::patch_array_t * > &  input,
const int  physical_element_index,
const int  velocity_space_element_indexes[3],
solverVariables_t element_pSV,
std::vector< std::vector< real > > &  source_term_ij,
std::vector< real > &  source_allocation,
std::vector< real > &  q,
std::vector< real > &  aux 
) const
protected

Calculates source_ij for a particular phase space element.

Parameters
inputpatch array input (q)
physical_element_index
velocity_space_element_indexes(vx_element_index, vy_element_index, vz_element_index)
element_PSVthe x and v gets set in here at each j node S_ij calculation so it is not constant
source_term_ijthis is what is written into
Returns
timestep

◆ element_full_range()

const WxRange & wxm::dfem::solver::dg::NDGKinetic::element_full_range ( ) const
inlineoverridevirtual

Get a range of elements associated with the entire patch (periphery+interior)

Implements wxm::dfem::solver::spatial_solver_t.

◆ element_interior_range()

const WxRange & wxm::dfem::solver::dg::NDGKinetic::element_interior_range ( ) const
inlineoverridevirtual

Get a range of elements associated with the interior.

Implements wxm::dfem::solver::spatial_solver_t.

◆ element_periphery_range()

const WxRange & wxm::dfem::solver::dg::NDGKinetic::element_periphery_range ( ) const
inlineoverridevirtual

Get a range of elements associated with the interior.

Implements wxm::dfem::solver::spatial_solver_t.

◆ get_num_dof()

size_t wxm::dfem::solver::dg::NDGKinetic::get_num_dof ( ) const
inlineoverrideprotectedvirtual

This will give the number of nodes in each "super element" (dof = num nodes)

Implements wxm::dfem::solver::spatial_solver_t.

◆ setup()

void wxm::dfem::solver::dg::NDGKinetic::setup ( const WxCryptSet wxc)
overridevirtual

setup sets up the DG solver

Parameters
wxc

Reimplemented from WmPatchProcess.

◆ solve()

const std::shared_ptr< TimestepConstraint > wxm::dfem::solver::dg::NDGKinetic::solve ( const real  time,
const variables_type input,
variables_type output 
)
overridevirtual

Computes the RHS.

Implements wxm::dfem::solver::spatial_solver_t.

◆ zero_fluxes()

void wxm::dfem::solver::dg::NDGKinetic::zero_fluxes ( )
overrideprotectedvirtual

Must be implemented as required by spatial solver parent however in this solver I am not storing internal/numerical fluxes and sources in arrays to be zeroed so this will be an empty method.

Implements wxm::dfem::solver::spatial_solver_t.


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