15 lbs_solver_(lbs_solver)
32 std::vector<double> &destination_q,
33 const std::vector<double> &phi_local,
49 gs_i_ =
static_cast<size_t>(groupset.
groups_.front().id_);
50 gs_f_ =
static_cast<size_t>(groupset.
groups_.back().id_);
63 const auto& m_to_ell_em_map =
64 groupset.
quadrature_->GetMomentToHarmonicsIndexMap();
69 for (
const auto& cell : grid.local_cells)
71 auto& transport_view = cell_transport_views[cell.local_id_];
75 const auto& xs = transport_view.XS();
77 std::shared_ptr<chi_physics::IsotropicMultiGrpSource> P0_src =
nullptr;
78 if (matid_to_src_map.count(cell.material_id_) > 0)
79 P0_src = matid_to_src_map.at(cell.material_id_);
81 const auto& S = xs.TransferMatrices();
82 const auto& F = xs.ProductionMatrix();
83 const auto& precursors = xs.Precursors();
84 const auto& nu_delayed_sigma_f = xs.NuDelayedSigmaF();
87 const int num_nodes = transport_view.NumNodes();
88 for (
int i = 0; i < num_nodes; ++i)
91 for (
int m = 0; m < static_cast<int>(num_moments); ++m)
93 unsigned int ell = m_to_ell_em_map[m].ell;
95 size_t uk_map = transport_view.MapDOF(i, m, 0);
97 const double* phi = &phi_local[uk_map];
100 if (P0_src and ell == 0)
121 const auto& S_ell = S[ell];
124 for (
const auto& [_, gp, sigma_sm] : S_ell.Row(g))
125 if (gp < gs_i_ or gp >
gs_f_)
126 rhs += sigma_sm * phi[gp];
130 for (
const auto& [_, gp, sigma_sm] : S_ell.Row(g))
134 rhs += sigma_sm * phi[gp];
139 const bool fission_avail = ell == 0 and xs.IsFissionable();
143 const auto& F_g = F[g];
146 if (gp < gs_i_ or gp >
gs_f_)
147 rhs += F_g[gp] * phi[gp];
151 rhs += F_g[gp] * phi[gp];
155 precursors, nu_delayed_sigma_f, &phi_local[uk_map]);
159 destination_q[uk_map + g] += rhs;
181 const std::vector<double> &nu_delayed_sigma_f,
182 const double *phi)
const
187 if (gp < gs_i_ or gp >
gs_f_)
188 for (
const auto& precursor : precursors)
189 value += precursor.emission_spectrum[
g_] *
190 precursor.fractional_yield *
191 nu_delayed_sigma_f[gp] * phi[gp];
195 for (
const auto& precursor : precursors)
196 value += precursor.emission_spectrum[
g_] *
197 precursor.fractional_yield *
198 nu_delayed_sigma_f[gp] * phi[gp];
208 std::vector<double> &destination_q,
209 const std::vector<double>&,
216 const auto gs_i =
static_cast<size_t>(groupset.
groups_.front().id_);
217 const auto gs_f =
static_cast<size_t>(groupset.
groups_.back().id_);
223 const auto& info_list = point_source.ContainingCellsInfo();
224 for (
const auto& info : info_list)
226 auto& transport_view = cell_transport_views[info.cell_local_id];
228 const auto& strength = point_source.Strength();
229 const auto& node_weights = info.node_weights;
230 const double vol_w = info.volume_weight;
232 const int num_nodes = transport_view.NumNodes();
233 for (
int i = 0; i < num_nodes; ++i)
235 const size_t uk_map = transport_view.MapDOF(i, 0, 0);
236 for (
size_t g = gs_i; g <= gs_f; ++g)
237 destination_q[uk_map + g] += strength[g] * node_weights[i] * vol_w;
@ EVENT_BEGIN
Signals the begin of an event.
@ EVENT_END
Signals the end of an event.
void LogEvent(size_t ev_tag, EventType ev_type, const std::shared_ptr< EventInfo > &ev_info)
std::shared_ptr< chi_math::AngularQuadrature > quadrature_
std::vector< LBSGroup > groups_
const std::vector< PointSource > & PointSources() const
const std::vector< lbs::CellLBSView > & GetCellTransportViews() const
const std::vector< LBSGroup > & Groups() const
std::vector< double > & ExtSrcMomentsLocal()
const chi_mesh::MeshContinuum & Grid() const
size_t NumMoments() const
const std::map< int, IsotropicSrcPtr > & GetMatID2IsoSrcMap() const
size_t GetSourceEventTag() const
bool apply_ags_fission_src_
std::vector< chi_physics::MultiGroupXS::Precursor > PrecursorList
virtual double AddDelayedFission(const PrecursorList &precursors, const std::vector< double > &nu_delayed_sigma_f, const double *phi) const
const LBSSolver & lbs_solver_
bool suppress_wg_scatter_src_
SourceFunction(const LBSSolver &lbs_solver)
bool apply_wgs_fission_src_
bool apply_wgs_scatter_src_
virtual void operator()(LBSGroupset &groupset, std::vector< double > &destination_q, const std::vector< double > &phi, SourceFlags source_flags)
const double * fixed_src_moments_
virtual double AddSourceMoments() const
std::vector< double > default_zero_src_
bool apply_ags_scatter_src_
virtual void AddAdditionalSources(LBSGroupset &groupset, std::vector< double > &destination_q, const std::vector< double > &phi, SourceFlags source_flags)
void AddPointSources(LBSGroupset &groupset, std::vector< double > &destination_q, const std::vector< double > &phi, SourceFlags source_flags)
@ APPLY_AGS_FISSION_SOURCES
@ APPLY_WGS_FISSION_SOURCES
@ APPLY_WGS_SCATTER_SOURCES
@ APPLY_AGS_SCATTER_SOURCES