Chi-Tech
source_function.h
Go to the documentation of this file.
1#ifndef CHITECH_LBS_SOURCE_FUNCTION_H
2#define CHITECH_LBS_SOURCE_FUNCTION_H
3
5
7
8#include <memory>
9#include <utility>
10
11namespace lbs
12{
13class LBSSolver;
14class LBSGroupset;
15
16//###################################################################
17/**Implements a customizable source function using virtual methods.
18 * This base class will function well for steady simulations and kEigenvalue
19 * simulations. It needs some customization for adjoint and transient.*/
21{
22protected:
24
25 bool apply_fixed_src_ = false;
31
32 size_t gs_i_ = 0;
33 size_t gs_f_ = 0;
34 size_t first_grp_ = 0;
35 size_t last_grp_ = 0;
36
37 double cell_volume_ = 0.0;
38 size_t g_ = 0;
39 const double* fixed_src_moments_ = nullptr;
40 std::vector<double> default_zero_src_;
41
42public:
43 explicit
44 SourceFunction(const LBSSolver& lbs_solver);
45 virtual ~SourceFunction() = default;
46
47 virtual void operator()(LBSGroupset& groupset,
48 std::vector<double>& destination_q,
49 const std::vector<double>& phi,
50 SourceFlags source_flags);
51
52 virtual double AddSourceMoments() const;
53
54 typedef std::vector<chi_physics::MultiGroupXS::Precursor> PrecursorList;
55 virtual
56 double AddDelayedFission(const PrecursorList& precursors,
57 const std::vector<double>& nu_delayed_sigma_f,
58 const double* phi) const;
59
60 virtual void AddAdditionalSources(LBSGroupset& groupset,
61 std::vector<double>& destination_q,
62 const std::vector<double>& phi,
63 SourceFlags source_flags)
64 {
65 AddPointSources(groupset, destination_q, phi, source_flags);
66 }
67
68 void AddPointSources(LBSGroupset& groupset,
69 std::vector<double>& destination_q,
70 const std::vector<double>& phi,
71 SourceFlags source_flags);
72};
73
74}//namespace lbs
75
76#endif //CHITECH_LBS_SOURCE_FUNCTION_H
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_
SourceFunction(const LBSSolver &lbs_solver)
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_
virtual ~SourceFunction()=default
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)
SourceFlags
Definition: lbs_structs.h:88