Chi-Tech
adjoint_mgxs.cc
Go to the documentation of this file.
1#include "adjoint_mgxs.h"
2
3
5AdjointMGXS(const MultiGroupXS& xs) : xs_(xs)
6{
7 // transpose transfer matrices
8 for (unsigned int ell = 0; ell <= xs_.ScatteringOrder(); ++ell)
9 {
10 const auto& S_ell = xs_.TransferMatrix(ell);
11 chi_math::SparseMatrix S_ell_transpose(xs_.NumGroups(), xs_.NumGroups());
12 for (size_t g = 0; g < xs_.NumGroups(); ++g)
13 {
14 const size_t row_len = S_ell.rowI_indices_[g].size();
15 const size_t* col_ptr = S_ell.rowI_indices_[g].data();
16 const double* val_ptr = S_ell.rowI_values_[g].data();
17
18 for (size_t j = 0; j < row_len; ++j)
19 S_ell_transpose.Insert(*col_ptr++, g, *val_ptr++);
20 }
21 transposed_transfer_matrices_.push_back(S_ell_transpose);
22 }//for ell
23
24 // transpose production matrices
25 if (xs_.IsFissionable())
26 {
27 const auto& F = xs_.ProductionMatrix();
28 for (size_t g = 0; g < xs_.NumGroups(); ++g)
29 {
30 std::vector<double> F_g_transpose;
31 for (size_t gp = 0; gp < xs_.NumGroups(); ++gp)
32 F_g_transpose.emplace_back(F[gp][g]);
33 transposed_production_matrices_.push_back(F_g_transpose);
34 }
35 }
36}
void Insert(size_t i, size_t j, double value)
std::vector< chi_math::SparseMatrix > transposed_transfer_matrices_
Definition: adjoint_mgxs.h:27
std::vector< std::vector< double > > transposed_production_matrices_
Definition: adjoint_mgxs.h:28
const MultiGroupXS & xs_
Definition: adjoint_mgxs.h:26
virtual const unsigned int NumGroups() const =0
virtual const chi_math::SparseMatrix & TransferMatrix(unsigned int ell) const =0
virtual const std::vector< std::vector< double > > ProductionMatrix() const =0
virtual const unsigned int ScatteringOrder() const =0
virtual const bool IsFissionable() const =0