16 const std::vector<lbs::UnitCellMatrices>& unit_cell_matrices,
17 const std::vector<lbs::UnitCellMatrices>& secondary_unit_cell_matrices,
18 std::vector<lbs::CellLBSView>& cell_transport_views,
19 std::vector<double>& destination_phi,
20 std::vector<double>& destination_psi,
21 const std::vector<double>& source_moments,
23 const std::map<int, lbs::XSPtr>& xs,
25 int max_num_cell_dofs)
27 discretization_primary,
37 secondary_unit_cell_matrices_(secondary_unit_cell_matrices),
40 normal_vector_boundary_()
42 const auto curvilinear_product_quadrature =
43 std::dynamic_pointer_cast<chi_math::CurvilinearAngularQuadrature>(
46 if (!curvilinear_product_quadrature)
47 throw std::invalid_argument(
48 "D_DO_RZ_SteadyState::SweepChunkPWL::SweepChunkPWL : "
49 "invalid angular quadrature");
52 const size_t dir_map_size =
53 curvilinear_product_quadrature->GetDirectionMap().size();
54 for (
size_t m = 0; m < dir_map_size; ++m)
59 const unsigned int n_dof =
64 for (
const auto& dir_set : curvilinear_product_quadrature->GetDirectionMap())
65 for (
const auto& dir_idx : dir_set.second)
84 Kernel(
"FEMRZVolumetricGradTerm")};
100 const auto& fe_intgrl_values_secondary =
103 Maux_ = &fe_intgrl_values_secondary.M_matrix;
111 const auto curvilinear_product_quadrature =
112 std::dynamic_pointer_cast<chi_math::CurvilinearAngularQuadrature>(
116 "Failure to cast angular quadrature to "
117 "chi_math::CurvilinearAngularQuadrature");
130 const auto f1 = f0 - 1;
145 const auto& Maux = *
Maux_;
166 const auto& face_normal =
cell_->
faces_[f].normal_;
177 const bool incident_on_symmetric_boundary =
179 if (incident_on_symmetric_boundary)
return;
182 const auto& M_surf_f = (*M_surf_)[f];
185 for (
int fi = 0; fi < num_face_nodes; ++fi)
188 for (
int fj = 0; fj < num_face_nodes; ++fj)
194 const double mu_Nij = -mu * M_surf_f[i][j];
195 Amat_[i][j] += mu_Nij;
197 b_[gsg][i] += psi[gsg] * mu_Nij;
#define ChiLogicalErrorIf(condition, message)
int MapFaceNode(size_t face_index, size_t face_node_index) const
size_t NumFaceNodes(size_t face_index) const
size_t GetNumLocalDOFs(const UnknownManager &unknown_manager) const
virtual int64_t MapDOFLocal(const chi_mesh::Cell &cell, unsigned int node, const UnknownManager &unknown_manager, unsigned int unknown_id, unsigned int component) const =0
unsigned int AddUnknown(UnknownType unk_type, unsigned int dimension=0)
std::vector< CellFace > faces_
MeshAttributes Attributes() const
std::shared_ptr< chi_math::AngularQuadrature > quadrature_
std::vector< LBSGroup > groups_
std::vector< CallbackFunction > surface_integral_kernels_
void RegisterKernel(const std::string &name, CallbackFunction function)
std::vector< double > face_mu_values_
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_
const chi_mesh::Cell * cell_
std::vector< std::vector< double > > b_
std::vector< std::vector< double > > Amat_
std::vector< CallbackFunction > post_cell_dir_sweep_callbacks_
std::vector< CallbackFunction > cell_data_callbacks_
const chi_mesh::MeshContinuum & grid_
const chi_math::CellMapping * cell_mapping_
unsigned int polar_level_
double fac_diamond_difference_
void KernelFEMRZUpwindSurfaceIntegrals()
void PostCellDirSweepCallback()
SweepChunkPWLRZ(const chi_mesh::MeshContinuum &grid, const chi_math::SpatialDiscretization &discretization_primary, const std::vector< lbs::UnitCellMatrices > &unit_cell_matrices, const std::vector< lbs::UnitCellMatrices > &secondary_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, lbs::LBSGroupset &groupset, const std::map< int, lbs::XSPtr > &xs, int num_moments, int max_num_cell_dofs)
void KernelFEMRZVolumetricGradientTerm()
chi_mesh::Vector3 normal_vector_boundary_
chi_math::UnknownManager unknown_manager_
void DirectionDataCallback()
const std::vector< lbs::UnitCellMatrices > & secondary_unit_cell_matrices_
std::map< unsigned int, unsigned int > map_polar_level_
std::vector< double > psi_sweep_
double fac_streaming_operator_
Vector3 Dot(const chi_mesh::TensorRank2Dim3 &that) const
virtual const double * GetUpwindPsi(int face_node_local_idx) const =0