Chi-Tech
lbsDO_00_constrdestraccesors.cc
Go to the documentation of this file.
2
3#include "ChiObjectFactory.h"
4
5namespace lbs
6{
8}
9
11 const std::string& text_name)
12 : LBSSolver(text_name)
13{
14}
15
17{
19
20 params.SetClassName("DiscreteOrdinatesSolver");
21 params.SetDocGroup("lbs__LBSSolver");
22
23 params.ChangeExistingParamToOptional("name", "LBSDiscreteOrdinatesSolver");
24
26 "directions_sweep_order_to_print",
27 std::vector<size_t>(),
28 "List of direction id's for which sweep ordering info is to be printed.");
29
31 "sweep_type", "AAH", "The sweep type to use for sweep operatorations.");
32
33 using namespace chi_data_types;
34 params.ConstrainParameterRange("sweep_type",
35 AllowableRangeList::New({"AAH", "CBC"}));
36
37 return params;
38}
39
40/**Static registration based constructor.*/
42 const chi::InputParameters& params)
43 : LBSSolver(params),
44 verbose_sweep_angles_(
45 params.GetParamVectorValue<size_t>("directions_sweep_order_to_print")),
46 sweep_type_(params.GetParamValue<std::string>("sweep_type"))
47{
48}
49
50/**Destructor for LBS*/
52{
53 for (auto& groupset : groupsets_)
54 {
55 CleanUpWGDSA(groupset);
56 CleanUpTGDSA(groupset);
57
58 ResetSweepOrderings(groupset);
59 }
60}
61
62/**Gets the local and global number of iterative unknowns. This normally is
63 * only the flux moments, however, the sweep based solvers might include
64 * delayed angular fluxes in this number.*/
65std::pair<size_t, size_t>
67{
68 const auto& sdm = *discretization_;
69 const size_t num_local_phi_dofs = sdm.GetNumLocalDOFs(flux_moments_uk_man_);
70 const size_t num_globl_phi_dofs = sdm.GetNumGlobalDOFs(flux_moments_uk_man_);
71
72 size_t num_local_psi_dofs = 0;
73 size_t num_globl_psi_dofs = 0;
74 for (auto& groupset : groupsets_)
75 {
76 const auto num_delayed_psi_info =
77 groupset.angle_agg_->GetNumDelayedAngularDOFs();
78 num_local_psi_dofs += num_delayed_psi_info.first;
79 num_globl_psi_dofs += num_delayed_psi_info.second;
80 }
81
82 const size_t num_local_dofs = num_local_phi_dofs + num_local_psi_dofs;
83 const size_t num_globl_dofs = num_globl_phi_dofs + num_globl_psi_dofs;
84
85 return {num_local_dofs, num_globl_dofs};
86}
void SetDocGroup(const std::string &doc_group)
void ConstrainParameterRange(const std::string &param_name, AllowableRangePtr allowable_range)
void AddOptionalParameter(const std::string &name, T value, const std::string &doc_string)
void SetClassName(const std::string &class_name)
void AddOptionalParameterArray(const std::string &name, const std::vector< T > &array, const std::string &doc_string)
void ChangeExistingParamToOptional(const std::string &name, T value, const std::string &doc_string="")
std::pair< size_t, size_t > GetNumPhiIterativeUnknowns() override
DiscreteOrdinatesSolver(const chi::InputParameters &params)
static chi::InputParameters GetInputParameters()
static chi::InputParameters GetInputParameters()
RegisterChiObject(lbs, DiffusionDFEMSolver)