6#define scint static_cast<int>
14 const std::vector<UnitCellMatrices>& unit_cell_matrices,
15 std::vector<lbs::CellLBSView>& cell_transport_views,
16 std::vector<double>& destination_phi,
17 std::vector<double>& destination_psi,
18 const std::vector<double>& source_moments,
20 const std::map<int, XSPtr>& xs,
22 int max_num_cell_dofs)
71 int deploc_face_counter = -1;
72 int preloc_face_counter = -1;
79 auto& aah_sweep_depinterf =
81 aah_sweep_depinterf.
fluds_ =
86 const auto& spds = angle_set.
GetSPDS();
88 const size_t num_spls = spls.size();
89 for (
size_t spls_index = 0; spls_index < num_spls; ++spls_index)
99 const auto& face_orientations = spds.CellFaceOrientations()[
cell_local_id_];
105 aah_sweep_depinterf.spls_index = spls_index;
109 G_ = &fe_intgrl_values.G_matrix;
110 M_ = &fe_intgrl_values.M_matrix;
111 M_surf_ = &fe_intgrl_values.face_M_matrices;
118 const int ni_deploc_face_counter = deploc_face_counter;
119 const int ni_preloc_face_counter = preloc_face_counter;
123 const std::vector<size_t>& as_angle_indices = angle_set.
GetAngleIndices();
124 const size_t as_num_angles = as_angle_indices.size();
125 for (
size_t as_ss_idx = 0; as_ss_idx < as_num_angles; ++as_ss_idx)
134 deploc_face_counter = ni_deploc_face_counter;
135 preloc_face_counter = ni_preloc_face_counter;
144 aah_sweep_depinterf.in_face_counter = 0;
145 aah_sweep_depinterf.preloc_face_counter = 0;
146 aah_sweep_depinterf.out_face_counter = 0;
147 aah_sweep_depinterf.deploc_face_counter = 0;
155 int in_face_counter = -1;
160 if (face_orientations[f] != FaceOrientation::INCOMING)
continue;
163 const bool boundary = not face.has_neighbor_;
165 if (local) ++in_face_counter;
166 else if (not boundary)
167 ++preloc_face_counter;
176 aah_sweep_depinterf.in_face_counter = in_face_counter;
177 aah_sweep_depinterf.preloc_face_counter = preloc_face_counter;
202 int out_face_counter = -1;
205 if (face_orientations[f] != FaceOrientation::OUTGOING)
continue;
211 const bool boundary = not face.has_neighbor_;
214 if (not boundary and not local) ++deploc_face_counter;
224 aah_sweep_depinterf.out_face_counter = out_face_counter;
225 aah_sweep_depinterf.deploc_face_counter = deploc_face_counter;
size_t NumFaceNodes(size_t face_index) const
const CellMapping & GetCellMapping(const chi_mesh::Cell &cell) const
std::vector< CellFace > faces_
LocalCellHandler local_cells
double * NLOutgoingPsi(int outb_face_count, int face_dof, int n)
double * OutgoingPsi(int cell_so_index, int outb_face_counter, int face_dof, int n)
double * UpwindPsi(int cell_so_index, int inc_face_counter, int face_dof, int g, int n)
double * NLUpwindPsi(int nonl_inc_face_counter, int face_dof, int g, int n)
virtual const double * PsiBndry(uint64_t bndry_map, unsigned int angle_num, uint64_t cell_local_id, unsigned int face_num, unsigned int fi, int g, size_t gs_ss_begin, bool surface_source_active)=0
const std::vector< size_t > & GetAngleIndices() const
size_t GetRefGroupSubset() const
virtual double * ReflectingPsiOutBoundBndry(uint64_t bndry_map, unsigned int angle_num, uint64_t cell_local_id, unsigned int face_num, unsigned int fi, size_t gs_ss_begin)=0
const SPDS & GetSPDS() const
const SPLS & GetSPLS() const
bool IsSurfaceSourceActive() const
AAH_SweepChunk(const chi_mesh::MeshContinuum &grid, const chi_math::SpatialDiscretization &discretization, const std::vector< UnitCellMatrices > &unit_cell_matrices, std::vector< lbs::CellLBSView > &cell_transport_views, std::vector< double > &destination_phi, std::vector< double > &destination_psi, const std::vector< double > &source_moments, const LBSGroupset &groupset, const std::map< int, XSPtr > &xs, int num_moments, int max_num_cell_dofs)
void Sweep(chi_mesh::sweep_management::AngleSet &angle_set) override
int FaceLocality(int f) const
bool IsFaceLocal(int f) const
std::vector< chi::SubSetInfo > grp_subset_infos_
std::shared_ptr< chi_math::AngularQuadrature > quadrature_
std::vector< LBSGroup > groups_
std::vector< std::vector< double > > Atemp_
std::vector< CallbackFunction > surface_integral_kernels_
const std::vector< VecDbl > * IntS_shapeI_
std::vector< CallbackFunction > flux_update_kernels_
void KernelFEMSTDMassTerms()
void RegisterKernel(const std::string &name, CallbackFunction function)
double direction_qweight_
const std::vector< UnitCellMatrices > & unit_cell_matrices_
std::vector< double > face_mu_values_
const std::vector< MatDbl > * M_surf_
const std::map< int, XSPtr > & xs_
CellLBSView * cell_transport_view_
std::vector< CallbackFunction > mass_term_kernels_
const LBSGroupset & groupset_
std::vector< CallbackFunction > direction_data_callbacks_and_kernels_
const chi_math::SpatialDiscretization & grid_fe_view_
CallbackFunction Kernel(const std::string &name) const
SweepDependencyInterface & sweep_dependency_interface_
void KernelFEMVolumetricGradientTerm()
virtual void OutgoingSurfaceOperations()
static void ExecuteKernels(const std::vector< CallbackFunction > &kernels)
const chi_mesh::Cell * cell_
std::vector< std::vector< double > > b_
std::vector< CallbackFunction > post_cell_dir_sweep_callbacks_
std::vector< CallbackFunction > cell_data_callbacks_
const chi_mesh::MeshContinuum & grid_
void KernelFEMUpwindSurfaceIntegrals()
const chi_math::CellMapping * cell_mapping_
std::vector< lbs::CellLBSView > & grid_transport_view_
void GaussElimination(MatDbl &A, VecDbl &b, int n)
Vector3 Dot(const chi_mesh::TensorRank2Dim3 &that) const
std::vector< int > item_id
const double * GetUpwindPsi(int face_node_local_idx) const override
double * GetDownwindPsi(int face_node_local_idx) const override
chi_mesh::sweep_management::AAH_FLUDS * fluds_
bool surface_source_active_
bool is_reflecting_bndry_
virtual void SetupOutgoingFace(int face_id, size_t num_face_nodes, uint64_t neighbor_id, bool on_local_face, bool on_boundary, int locality)
const chi_mesh::Cell * cell_ptr_
virtual void SetupIncomingFace(int face_id, size_t num_face_nodes, uint64_t neighbor_id, bool on_local_face, bool on_boundary)
chi_mesh::sweep_management::AngleSet * angle_set_