Chi-Tech
lbsadj_solver_02_main_execute.cc
Go to the documentation of this file.
1#include "lbsadj_solver.h"
2
4
6
7#include "chi_runtime.h"
8#include "chi_log.h"
9
10/**Main execution function.*/
12{
13 const std::string fname = __FUNCTION__;
14
15 primary_ags_solver_->Setup();
16 primary_ags_solver_->Solve();
17
18 //============================================= Apply post processing
19 Chi::log.Log() << "LBAdjointSolver: post-processing.";
20 std::set<int> set_group_numbers;
21 for (const auto& groupset : groupsets_)
22 for (const auto& group : groupset.groups_)
23 set_group_numbers.insert(group.id_);
24
25 const auto& m_to_ell_em_map =
26 groupsets_.front().quadrature_->GetMomentToHarmonicsIndexMap();
27
28 //============================================= Reorient phi-moments for reverse
29 // angle
30 for (const auto& cell : grid_ptr_->local_cells)
31 {
32 const auto& cell_view = cell_transport_views_[cell.local_id_];
33 const int num_nodes = cell_view.NumNodes();
34
35 for (int i = 0; i < num_nodes; ++i)
36 {
37 for (int m = 0; m < num_moments_; ++m)
38 {
39 const auto& ell = m_to_ell_em_map[m].ell;
40
41 size_t dof_map_g0 = cell_view.MapDOF(i, m, 0); //unknown map
42
43 for (int g : set_group_numbers)
44 phi_old_local_[dof_map_g0 + g] *= pow(-1.0, ell);
45 }//for moment
46 }//node i
47 }//for cell
48
50
51}
static chi::ChiLog & log
Definition: chi_runtime.h:81
LogStream Log(LOG_LVL level=LOG_0)
Definition: chi_log.cc:35
chi_mesh::MeshContinuumPtr grid_ptr_
Definition: lbs_solver.h:75
std::vector< lbs::CellLBSView > cell_transport_views_
Definition: lbs_solver.h:83
std::vector< double > phi_old_local_
Definition: lbs_solver.h:95
std::vector< LBSGroupset > groupsets_
Definition: lbs_solver.h:68
AGSLinSolverPtr primary_ags_solver_
Definition: lbs_solver.h:103
size_t num_moments_
Definition: lbs_solver.h:62