Chi-Tech
adjoint_mgxs.h
Go to the documentation of this file.
1#ifndef ADJOINT_MGXS_H
2#define ADJOINT_MGXS_H
3
4#include "multigroup_xs.h"
5
6
7namespace chi_physics
8{
9
10/**
11 * A wrapper class for obtaining multi-group cross section data for
12 * adjoint simulations.
13 *
14 * In adjoint simulations, the transfer and production matrices are transposed.
15 * While the respective matrices could be queried by simply flipping the
16 * indices, access attempts in this fashion are quite costly. Rather, this
17 * class precomputes and stores these transpose operators. Along with this, a
18 * reference to an instance of MultiGroupXS is stored. In this class, accessors
19 * for vector data call the respective accessor from MultiGroupXS and accessors
20 * for transfer and production matrices access the respective transposed data
21 * stored in this class.
22 */
24{
25private:
27 std::vector<chi_math::SparseMatrix> transposed_transfer_matrices_;
28 std::vector<std::vector<double>> transposed_production_matrices_;
29
30public:
31 AdjointMGXS() = delete;
32 AdjointMGXS(const AdjointMGXS&) = delete;
34
35 explicit AdjointMGXS(const MultiGroupXS& xs);
36
37 //Accessors
38 const unsigned int NumGroups() const override { return xs_.NumGroups(); }
39
40 const unsigned int ScatteringOrder() const override
41 { return xs_.ScatteringOrder(); }
42
43 const unsigned int NumPrecursors() const override
44 { return xs_.NumPrecursors(); }
45
46 const bool IsFissionable() const override { return xs_.IsFissionable(); }
47
48 const bool DiffusionInitialized() const override
49 { return xs_.DiffusionInitialized(); }
50
51 const bool ScatteringInitialized() const override
52 { return xs_.ScatteringInitialized(); }
53
54 const std::vector<double>& SigmaTotal() const override
55 { return xs_.SigmaTotal(); }
56
57 const std::vector<double>& SigmaAbsorption() const override
58 { return xs_.SigmaAbsorption(); }
59
60 const std::vector<double>& SigmaFission() const override
61 { return xs_.SigmaFission(); }
62
63 const std::vector<double>& NuSigmaF() const override
64 { return xs_.NuSigmaF(); }
65
66 const std::vector<double>& NuPromptSigmaF() const override
67 { return xs_.NuPromptSigmaF(); }
68
69 const std::vector<double>& NuDelayedSigmaF() const override
70 { return xs_.NuDelayedSigmaF(); }
71
72 const std::vector<double>& InverseVelocity() const override
73 { return xs_.InverseVelocity(); }
74
75 const std::vector<chi_math::SparseMatrix>& TransferMatrices() const override
77
78 const chi_math::SparseMatrix& TransferMatrix(unsigned int ell) const override
79 { return transposed_transfer_matrices_.at(ell); }
80
81 const std::vector<std::vector<double>> ProductionMatrix() const override
83
84 const std::vector<Precursor>& Precursors() const override
85 { return xs_.Precursors(); }
86
87 const std::vector<double>& DiffusionCoefficient() const override
88 { return xs_.DiffusionCoefficient(); }
89
90 std::vector<double> SigmaTransport() const override
91 { return xs_.SigmaTransport();}
92
93 const std::vector<double>& SigmaRemoval() const override
94 { return xs_.SigmaRemoval(); }
95
96 const std::vector<double>& SigmaSGtoG() const override
97 { return xs_.SigmaSGtoG(); }
98
99};
100
101}
102
103#endif //ADJOINT_MGXS_H
const std::vector< std::vector< double > > ProductionMatrix() const override
Definition: adjoint_mgxs.h:81
const std::vector< double > & DiffusionCoefficient() const override
Definition: adjoint_mgxs.h:87
const std::vector< double > & SigmaSGtoG() const override
Definition: adjoint_mgxs.h:96
const chi_math::SparseMatrix & TransferMatrix(unsigned int ell) const override
Definition: adjoint_mgxs.h:78
const bool IsFissionable() const override
Definition: adjoint_mgxs.h:46
const std::vector< double > & SigmaTotal() const override
Definition: adjoint_mgxs.h:54
std::vector< chi_math::SparseMatrix > transposed_transfer_matrices_
Definition: adjoint_mgxs.h:27
const std::vector< double > & InverseVelocity() const override
Definition: adjoint_mgxs.h:72
std::vector< std::vector< double > > transposed_production_matrices_
Definition: adjoint_mgxs.h:28
const std::vector< double > & NuPromptSigmaF() const override
Definition: adjoint_mgxs.h:66
const unsigned int ScatteringOrder() const override
Definition: adjoint_mgxs.h:40
const std::vector< chi_math::SparseMatrix > & TransferMatrices() const override
Definition: adjoint_mgxs.h:75
AdjointMGXS(AdjointMGXS &&)=delete
const bool DiffusionInitialized() const override
Definition: adjoint_mgxs.h:48
const std::vector< double > & SigmaFission() const override
Definition: adjoint_mgxs.h:60
const std::vector< double > & NuDelayedSigmaF() const override
Definition: adjoint_mgxs.h:69
std::vector< double > SigmaTransport() const override
Definition: adjoint_mgxs.h:90
const bool ScatteringInitialized() const override
Definition: adjoint_mgxs.h:51
const MultiGroupXS & xs_
Definition: adjoint_mgxs.h:26
const std::vector< double > & SigmaRemoval() const override
Definition: adjoint_mgxs.h:93
const unsigned int NumGroups() const override
Definition: adjoint_mgxs.h:38
const unsigned int NumPrecursors() const override
Definition: adjoint_mgxs.h:43
AdjointMGXS(const AdjointMGXS &)=delete
const std::vector< double > & SigmaAbsorption() const override
Definition: adjoint_mgxs.h:57
const std::vector< Precursor > & Precursors() const override
Definition: adjoint_mgxs.h:84
const std::vector< double > & NuSigmaF() const override
Definition: adjoint_mgxs.h:63
virtual const unsigned int NumGroups() const =0
virtual const std::vector< Precursor > & Precursors() const =0
virtual const unsigned int NumPrecursors() const =0
virtual const std::vector< double > & InverseVelocity() const =0
virtual const bool DiffusionInitialized() const =0
virtual const std::vector< double > & NuDelayedSigmaF() const =0
virtual const std::vector< double > & SigmaTotal() const =0
virtual const std::vector< double > & SigmaAbsorption() const =0
virtual std::vector< double > SigmaTransport() const =0
virtual const std::vector< double > & SigmaFission() const =0
virtual const unsigned int ScatteringOrder() const =0
virtual const std::vector< double > & SigmaRemoval() const =0
virtual const std::vector< double > & NuSigmaF() const =0
virtual const bool IsFissionable() const =0
virtual const std::vector< double > & NuPromptSigmaF() const =0
virtual const bool ScatteringInitialized() const =0
virtual const std::vector< double > & SigmaSGtoG() const =0
virtual const std::vector< double > & DiffusionCoefficient() const =0