Chi-Tech
lbs::SweepChunk Class Reference

#include <SweepChunk.h>

Inheritance diagram for lbs::SweepChunk:
chi_mesh::sweep_management::SweepChunk lbs::AAH_SweepChunk lbs::CBC_SweepChunk lbs::SweepChunkPWLRZ

Public Member Functions

 SweepChunk (std::vector< double > &destination_phi, std::vector< double > &destination_psi, const chi_mesh::MeshContinuum &grid, const chi_math::SpatialDiscretization &discretization, const std::vector< UnitCellMatrices > &unit_cell_matrices, std::vector< lbs::CellLBSView > &cell_transport_views, const std::vector< double > &source_moments, const LBSGroupset &groupset, const std::map< int, XSPtr > &xs, int num_moments, int max_num_cell_dofs, std::unique_ptr< SweepDependencyInterface > sweep_dependency_interface_ptr)
 
void KernelFEMVolumetricGradientTerm ()
 
void KernelFEMUpwindSurfaceIntegrals ()
 
void KernelFEMSTDMassTerms ()
 
void KernelPhiUpdate ()
 
void KernelPsiUpdate ()
 
- Public Member Functions inherited from chi_mesh::sweep_management::SweepChunk
 SweepChunk (std::vector< double > &in_destination_phi, std::vector< double > &in_destination_psi)
 
virtual void Sweep (AngleSet &angle_set)
 
virtual void SetAngleSet (AngleSet &angle_set)
 
virtual void SetCell (chi_mesh::Cell const *cell_ptr, chi_mesh::sweep_management::AngleSet &angle_set)
 
virtual void SetCells (const std::vector< const chi_mesh::Cell * > &cell_ptrs)
 
virtual ~SweepChunk ()=default
 

Protected Types

typedef std::function< void()> CallbackFunction
 

Protected Member Functions

void RegisterKernel (const std::string &name, CallbackFunction function)
 
CallbackFunction Kernel (const std::string &name) const
 
virtual void OutgoingSurfaceOperations ()
 
- Protected Member Functions inherited from chi_mesh::sweep_management::SweepChunk
void SetDestinationPhi (std::vector< double > &in_destination_phi)
 
void ZeroDestinationPhi ()
 
std::vector< double > & GetDestinationPhi ()
 
void SetDestinationPsi (std::vector< double > &in_destination_psi)
 
void ZeroDestinationPsi ()
 
std::vector< double > & GetDestinationPsi ()
 
void SetBoundarySourceActiveFlag (bool flag_value)
 
bool IsSurfaceSourceActive () const
 

Static Protected Member Functions

static void ExecuteKernels (const std::vector< CallbackFunction > &kernels)
 

Protected Attributes

const chi_mesh::MeshContinuumgrid_
 
const chi_math::SpatialDiscretizationgrid_fe_view_
 
const std::vector< UnitCellMatrices > & unit_cell_matrices_
 
std::vector< lbs::CellLBSView > & grid_transport_view_
 
const std::vector< double > & q_moments_
 
const LBSGroupsetgroupset_
 
const std::map< int, XSPtr > & xs_
 
const int num_moments_
 
const bool save_angular_flux_
 
std::unique_ptr< SweepDependencyInterfacesweep_dependency_interface_ptr_
 
SweepDependencyInterfacesweep_dependency_interface_
 
const size_t groupset_angle_group_stride_
 
const size_t groupset_group_stride_
 
size_t gs_ss_size_ = 0
 
size_t gs_ss_begin_ = 0
 
int gs_gi_ = 0
 
std::vector< std::vector< double > > Amat_
 
std::vector< std::vector< double > > Atemp_
 
std::vector< double > source_
 
std::vector< std::vector< double > > b_
 
uint64_t cell_local_id_ = 0
 
const chi_mesh::Cellcell_ = nullptr
 
const chi_math::CellMappingcell_mapping_ = nullptr
 
CellLBSViewcell_transport_view_ = nullptr
 
size_t cell_num_faces_ = 0
 
size_t cell_num_nodes_ = 0
 
const MatVec3G_ = nullptr
 
const MatDblM_ = nullptr
 
const std::vector< MatDbl > * M_surf_ = nullptr
 
const std::vector< VecDbl > * IntS_shapeI_ = nullptr
 
std::vector< CallbackFunctioncell_data_callbacks_
 
std::vector< double > face_mu_values_
 
size_t direction_num_ = 0
 
chi_mesh::Vector3 omega_
 
double direction_qweight_ = 0.0
 
std::vector< CallbackFunctiondirection_data_callbacks_and_kernels_
 
std::vector< CallbackFunctionsurface_integral_kernels_
 
size_t g_ = 0
 
size_t gsg_ = 0
 
double sigma_tg_ = 0.0
 
std::vector< CallbackFunctionmass_term_kernels_
 
std::vector< CallbackFunctionflux_update_kernels_
 
std::vector< CallbackFunctionpost_cell_dir_sweep_callbacks_
 

Private Attributes

std::map< std::string, CallbackFunctionkernels_
 

Additional Inherited Members

- Public Types inherited from chi_mesh::sweep_management::SweepChunk
typedef std::function< void(chi_mesh::sweep_management::SweepChunk *sweeper, chi_mesh::sweep_management::AngleSet *angle_set)> MomentCallbackF
 
- Data Fields inherited from chi_mesh::sweep_management::SweepChunk
std::vector< MomentCallbackFmoment_callbacks
 

Detailed Description

Base class for LBS sweepers

Definition at line 66 of file SweepChunk.h.

Member Typedef Documentation

◆ CallbackFunction

typedef std::function<void()> lbs::SweepChunk::CallbackFunction
protected

Definition at line 84 of file SweepChunk.h.

Constructor & Destructor Documentation

◆ SweepChunk()

lbs::SweepChunk::SweepChunk ( std::vector< double > &  destination_phi,
std::vector< double > &  destination_psi,
const chi_mesh::MeshContinuum grid,
const chi_math::SpatialDiscretization discretization,
const std::vector< UnitCellMatrices > &  unit_cell_matrices,
std::vector< lbs::CellLBSView > &  cell_transport_views,
const std::vector< double > &  source_moments,
const LBSGroupset groupset,
const std::map< int, XSPtr > &  xs,
int  num_moments,
int  max_num_cell_dofs,
std::unique_ptr< SweepDependencyInterface sweep_dependency_interface_ptr 
)

Definition at line 15 of file SweepChunk.cc.

Member Function Documentation

◆ ExecuteKernels()

void lbs::SweepChunk::ExecuteKernels ( const std::vector< CallbackFunction > &  kernels)
staticprotected

Executes the supplied kernels list.

Definition at line 78 of file SweepChunk.cc.

◆ Kernel()

SweepChunk::CallbackFunction lbs::SweepChunk::Kernel ( const std::string &  name) const
protected

Returns a kernel if the given name exists.

Definition at line 69 of file SweepChunk.cc.

◆ KernelFEMSTDMassTerms()

void lbs::SweepChunk::KernelFEMSTDMassTerms ( )

Assembles angular sources and applies the mass matrix terms.

Definition at line 160 of file SweepChunk.cc.

◆ KernelFEMUpwindSurfaceIntegrals()

void lbs::SweepChunk::KernelFEMUpwindSurfaceIntegrals ( )

Performs the integral over the surface of a face.

Definition at line 132 of file SweepChunk.cc.

◆ KernelFEMVolumetricGradientTerm()

void lbs::SweepChunk::KernelFEMVolumetricGradientTerm ( )

Assembles the volumetric gradient term.

Definition at line 121 of file SweepChunk.cc.

◆ KernelPhiUpdate()

void lbs::SweepChunk::KernelPhiUpdate ( )

Adds a single direction's contribution to the moment integrals.

Definition at line 196 of file SweepChunk.cc.

◆ KernelPsiUpdate()

void lbs::SweepChunk::KernelPsiUpdate ( )

Updates angular fluxes.

Definition at line 216 of file SweepChunk.cc.

◆ OutgoingSurfaceOperations()

void lbs::SweepChunk::OutgoingSurfaceOperations ( )
protectedvirtual

Operations when outgoing fluxes are handled including passing face angular fluxes downstream and computing balance parameters (i.e. outflow)

Definition at line 89 of file SweepChunk.cc.

◆ RegisterKernel()

void lbs::SweepChunk::RegisterKernel ( const std::string &  name,
CallbackFunction  function 
)
protected

Registers a kernel as a named callback function

Definition at line 57 of file SweepChunk.cc.

Field Documentation

◆ Amat_

std::vector<std::vector<double> > lbs::SweepChunk::Amat_
protected

Definition at line 107 of file SweepChunk.h.

◆ Atemp_

std::vector<std::vector<double> > lbs::SweepChunk::Atemp_
protected

Definition at line 108 of file SweepChunk.h.

◆ b_

std::vector<std::vector<double> > lbs::SweepChunk::b_
protected

Definition at line 110 of file SweepChunk.h.

◆ cell_

const chi_mesh::Cell* lbs::SweepChunk::cell_ = nullptr
protected

Definition at line 114 of file SweepChunk.h.

◆ cell_data_callbacks_

std::vector<CallbackFunction> lbs::SweepChunk::cell_data_callbacks_
protected

Callbacks at phase 1 : cell data established

Definition at line 125 of file SweepChunk.h.

◆ cell_local_id_

uint64_t lbs::SweepChunk::cell_local_id_ = 0
protected

Definition at line 113 of file SweepChunk.h.

◆ cell_mapping_

const chi_math::CellMapping* lbs::SweepChunk::cell_mapping_ = nullptr
protected

Definition at line 115 of file SweepChunk.h.

◆ cell_num_faces_

size_t lbs::SweepChunk::cell_num_faces_ = 0
protected

Definition at line 117 of file SweepChunk.h.

◆ cell_num_nodes_

size_t lbs::SweepChunk::cell_num_nodes_ = 0
protected

Definition at line 118 of file SweepChunk.h.

◆ cell_transport_view_

CellLBSView* lbs::SweepChunk::cell_transport_view_ = nullptr
protected

Definition at line 116 of file SweepChunk.h.

◆ direction_data_callbacks_and_kernels_

std::vector<CallbackFunction> lbs::SweepChunk::direction_data_callbacks_and_kernels_
protected

Callbacks at phase 2 : direction data established

Definition at line 133 of file SweepChunk.h.

◆ direction_num_

size_t lbs::SweepChunk::direction_num_ = 0
protected

Definition at line 128 of file SweepChunk.h.

◆ direction_qweight_

double lbs::SweepChunk::direction_qweight_ = 0.0
protected

Definition at line 130 of file SweepChunk.h.

◆ face_mu_values_

std::vector<double> lbs::SweepChunk::face_mu_values_
protected

Definition at line 127 of file SweepChunk.h.

◆ flux_update_kernels_

std::vector<CallbackFunction> lbs::SweepChunk::flux_update_kernels_
protected

Callbacks at phase 5 : flux updates

Definition at line 146 of file SweepChunk.h.

◆ G_

const MatVec3* lbs::SweepChunk::G_ = nullptr
protected

Definition at line 119 of file SweepChunk.h.

◆ g_

size_t lbs::SweepChunk::g_ = 0
protected

Definition at line 138 of file SweepChunk.h.

◆ grid_

const chi_mesh::MeshContinuum& lbs::SweepChunk::grid_
protected

Definition at line 86 of file SweepChunk.h.

◆ grid_fe_view_

const chi_math::SpatialDiscretization& lbs::SweepChunk::grid_fe_view_
protected

Definition at line 87 of file SweepChunk.h.

◆ grid_transport_view_

std::vector<lbs::CellLBSView>& lbs::SweepChunk::grid_transport_view_
protected

Definition at line 89 of file SweepChunk.h.

◆ groupset_

const LBSGroupset& lbs::SweepChunk::groupset_
protected

Definition at line 91 of file SweepChunk.h.

◆ groupset_angle_group_stride_

const size_t lbs::SweepChunk::groupset_angle_group_stride_
protected

Definition at line 99 of file SweepChunk.h.

◆ groupset_group_stride_

const size_t lbs::SweepChunk::groupset_group_stride_
protected

Definition at line 100 of file SweepChunk.h.

◆ gs_gi_

int lbs::SweepChunk::gs_gi_ = 0
protected

Definition at line 105 of file SweepChunk.h.

◆ gs_ss_begin_

size_t lbs::SweepChunk::gs_ss_begin_ = 0
protected

Definition at line 104 of file SweepChunk.h.

◆ gs_ss_size_

size_t lbs::SweepChunk::gs_ss_size_ = 0
protected

Definition at line 103 of file SweepChunk.h.

◆ gsg_

size_t lbs::SweepChunk::gsg_ = 0
protected

Definition at line 139 of file SweepChunk.h.

◆ IntS_shapeI_

const std::vector<VecDbl>* lbs::SweepChunk::IntS_shapeI_ = nullptr
protected

Definition at line 122 of file SweepChunk.h.

◆ kernels_

std::map<std::string, CallbackFunction> lbs::SweepChunk::kernels_
private

Definition at line 169 of file SweepChunk.h.

◆ M_

const MatDbl* lbs::SweepChunk::M_ = nullptr
protected

Definition at line 120 of file SweepChunk.h.

◆ M_surf_

const std::vector<MatDbl>* lbs::SweepChunk::M_surf_ = nullptr
protected

Definition at line 121 of file SweepChunk.h.

◆ mass_term_kernels_

std::vector<CallbackFunction> lbs::SweepChunk::mass_term_kernels_
protected

Callbacks at phase 4 : group by group mass terms

Definition at line 143 of file SweepChunk.h.

◆ num_moments_

const int lbs::SweepChunk::num_moments_
protected

Definition at line 93 of file SweepChunk.h.

◆ omega_

chi_mesh::Vector3 lbs::SweepChunk::omega_
protected

Definition at line 129 of file SweepChunk.h.

◆ post_cell_dir_sweep_callbacks_

std::vector<CallbackFunction> lbs::SweepChunk::post_cell_dir_sweep_callbacks_
protected

Callbacks at phase 6 : Post cell-dir sweep

Definition at line 149 of file SweepChunk.h.

◆ q_moments_

const std::vector<double>& lbs::SweepChunk::q_moments_
protected

Definition at line 90 of file SweepChunk.h.

◆ save_angular_flux_

const bool lbs::SweepChunk::save_angular_flux_
protected

Definition at line 94 of file SweepChunk.h.

◆ sigma_tg_

double lbs::SweepChunk::sigma_tg_ = 0.0
protected

Definition at line 140 of file SweepChunk.h.

◆ source_

std::vector<double> lbs::SweepChunk::source_
protected

Definition at line 109 of file SweepChunk.h.

◆ surface_integral_kernels_

std::vector<CallbackFunction> lbs::SweepChunk::surface_integral_kernels_
protected

Callbacks at phase 3 : Surface integrals

Definition at line 136 of file SweepChunk.h.

◆ sweep_dependency_interface_

SweepDependencyInterface& lbs::SweepChunk::sweep_dependency_interface_
protected

Definition at line 97 of file SweepChunk.h.

◆ sweep_dependency_interface_ptr_

std::unique_ptr<SweepDependencyInterface> lbs::SweepChunk::sweep_dependency_interface_ptr_
protected

Definition at line 96 of file SweepChunk.h.

◆ unit_cell_matrices_

const std::vector<UnitCellMatrices>& lbs::SweepChunk::unit_cell_matrices_
protected

Definition at line 88 of file SweepChunk.h.

◆ xs_

const std::map<int, XSPtr>& lbs::SweepChunk::xs_
protected

Definition at line 92 of file SweepChunk.h.


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