Chi-Tech
lbsDO_01_main_initialize.cc
Go to the documentation of this file.
2
6
7#include "chi_runtime.h"
8#include "chi_log.h"
9
11
12//###################################################################
13/** Initialize the solver.*/
15{
17
18 auto src_function = std::make_shared<SourceFunction>(*this);
19
20 // Initialize source func
21 using namespace std::placeholders;
23 std::bind(&SourceFunction::operator(), src_function, _1, _2, _3, _4);
24
25 //================================================== Initialize groupsets for
26 // sweeping
28 for (auto& groupset : groupsets_)
29 {
30 InitFluxDataStructures(groupset);
31
32 InitWGDSA(groupset);
33 InitTGDSA(groupset);
34 }
35
38}
39
40/**Initializes Within-GroupSet solvers.*/
42{
43 wgs_solvers_.clear(); //this is required
44 for (auto& groupset : groupsets_)
45 {
46 std::shared_ptr<SweepChunk> sweep_chunk = SetSweepChunk(groupset);
47
48 auto sweep_wgs_context_ptr =
49 std::make_shared<SweepWGSContext<Mat, Vec, KSP>>(
50 *this, groupset,
51 active_set_source_function_,
54 APPLY_AGS_FISSION_SOURCES, //rhs_scope
55 options_.verbose_inner_iterations,
56 sweep_chunk);
57
58 auto wgs_solver =
59 std::make_shared<WGSLinearSolver<Mat,Vec,KSP>>(sweep_wgs_context_ptr);
60
61 wgs_solvers_.push_back(wgs_solver);
62 }//for groupset
63
64}
static chi::ChiLog & log
Definition: chi_runtime.h:81
size_t GetRepeatingEventTag(std::string event_name)
Definition: chi_log.cc:176
void InitFluxDataStructures(LBSGroupset &groupset)
void InitWGDSA(LBSGroupset &groupset, bool vaccum_bcs_are_dirichlet=true)
void InitTGDSA(LBSGroupset &groupset)
size_t source_event_tag_
Definition: lbs_solver.h:58
void Initialize() override
std::vector< LBSGroupset > groupsets_
Definition: lbs_solver.h:68
virtual void InitializeSolverSchemes()
SetSourceFunction active_set_source_function_
Definition: lbs_solver.h:99
chi_mesh::sweep_management::SweepChunk SweepChunk
@ APPLY_AGS_FISSION_SOURCES
Definition: lbs_structs.h:94
@ APPLY_WGS_FISSION_SOURCES
Definition: lbs_structs.h:93
@ APPLY_FIXED_SOURCES
Definition: lbs_structs.h:90
@ APPLY_WGS_SCATTER_SOURCES
Definition: lbs_structs.h:91
@ APPLY_AGS_SCATTER_SOURCES
Definition: lbs_structs.h:92