Chi-Tech
acceleration.h
Go to the documentation of this file.
1#ifndef CHI_LBS_ACCELERATION_H
2#define CHI_LBS_ACCELERATION_H
3
4#include <vector>
5#include <map>
6#include <memory>
7#include <array>
8
9// ################################################################### Fwd decls
11{
12class SweepBoundary;
13}
14namespace chi_physics
15{
16class MultiGroupXS;
17}
18
19namespace lbs::acceleration
20{
21
22/**Boundary condition type. We essentially only support two
23 * types: Dirichlet and Reflecting, the latter is covered under
24 * the ROBIN-type boundary condition.*/
25enum class BCType
26{
27 DIRICHLET = 1,
28 ROBIN = 2
29};
30
31/**Simple data structure to specify boundary conditions. Its stores the
32 * BC-type in `type` and an array of 3 values in `values`. For a
33 * Dirichlet-BC only `values[0]` is used to specify the value of the BC.
34 * For a robin boundary condition we use all 3 values in the form
35\f[
36a\phi + b \mathbf{n} \frac{\partial \phi}{\partial \mathbf{x}} = f
37\f]
38where \f$ a \f$, \f$ b \f$ and \f$ f \f$ map to `values[0]`, `values[1]` and
39`values[2]`, respectively.
40*/
42{
44 std::array<double, 3> values = {0, 0, 0};
45};
46
47/**For both WGDSA and TGDSA use, we define this
48 * simplified data structure to hold multigroup diffusion coefficients and
49 * removal cross sections only for the relevant groups. E.g., for WGDSA it
50 * will only hold the cross sections for the groupset, and for TGDSA there will
51 * only be one group (All groups collapsed into 1).*/
53{
54 std::vector<double> Dg;
55 std::vector<double> sigR;
56};
57
59{
60 JFULL = 1, ///< Jacobi with full conv. of within-group scattering
61 JPARTIAL = 2, ///< Jacobi with partially conv. of within-group scattering
62};
63
65{
66 double collapsed_D = 0.0;
67 double collapsed_sig_a = 0.0;
68 std::vector<double> spectrum;
69};
70
74
75typedef std::shared_ptr<chi_mesh::sweep_management::SweepBoundary> SwpBndryPtr;
76
77/**Translates sweep boundary conditions to that used in diffusion acceleration
78 * methods.*/
79std::map<uint64_t, BoundaryCondition>
80TranslateBCs(const std::map<uint64_t, SwpBndryPtr>& sweep_boundaries,
81 bool vaccum_bcs_are_dirichlet = true);
82
83typedef std::shared_ptr<chi_physics::MultiGroupXS> MGXSPtr;
84
85/**Makes a packaged set of XSs, suitable for diffusion, for a particular
86 * set of groups.*/
87std::map<int, Multigroup_D_and_sigR>
88PackGroupsetXS(const std::map<int, MGXSPtr>& matid_to_xs_map,
89 int first_grp_index,
90 int last_group_index);
91
92} // namespace lbs::acceleration
93
94#endif // CHI_LBS_ACCELERATION_H
std::shared_ptr< chi_physics::MultiGroupXS > MGXSPtr
Definition: acceleration.h:83
std::map< int, Multigroup_D_and_sigR > PackGroupsetXS(const std::map< int, MGXSPtr > &matid_to_xs_map, int first_grp_index, int last_group_index)
Definition: acceleration.cc:37
std::map< uint64_t, BoundaryCondition > TranslateBCs(const std::map< uint64_t, SwpBndryPtr > &sweep_boundaries, bool vaccum_bcs_are_dirichlet)
Definition: acceleration.cc:12
@ JFULL
Jacobi with full conv. of within-group scattering.
@ JPARTIAL
Jacobi with partially conv. of within-group scattering.
std::shared_ptr< chi_mesh::sweep_management::SweepBoundary > SwpBndryPtr
Definition: acceleration.h:75
TwoGridCollapsedInfo MakeTwoGridCollapsedInfo(const chi_physics::MultiGroupXS &xs, EnergyCollapseScheme scheme)
std::array< double, 3 > values
Definition: acceleration.h:44