20 <<
"Estimating absorption from the transfer matrices.";
27 for (
size_t row = 0; row < S0.NumRows(); ++row)
29 const auto& cols = S0.rowI_indices_[row];
30 const auto& vals = S0.rowI_values_[row];
31 for (
size_t t = 0; t < cols.size(); ++t)
44 <<
"Negative absorption cross section encountered "
45 <<
"in group " << g <<
" when estimating from the "
46 <<
"transfer matrices";
55 if (diffusion_initialized_)
59 diffusion_coeff_.resize(num_groups_, 1.0);
60 sigma_s_gtog_.resize(num_groups_, 0.0);
61 sigma_removal_.resize(num_groups_, 0.1);
64 const auto& S = transfer_matrices_;
65 for (
unsigned int g = 0; g < num_groups_; ++g)
74 for (
unsigned int gp = 0; gp < num_groups_; ++gp)
76 const auto& cols = S[1].rowI_indices_[gp];
77 const auto& vals = S[1].rowI_values_[gp];
78 for (
size_t t = 0; t < cols.size(); ++t)
91 if (sig_1 >= sigma_t_[g])
95 <<
"Transport corrected diffusion coefficient failed for group "
96 << g <<
" in call to " << __FUNCTION__ <<
". "
97 <<
"sigma_t=" << sigma_t_[g] <<
" sigs_g_(m=1)=" << sig_1
98 <<
". Setting sigs_g_(m=1) to zero for this group.";
103 diffusion_coeff_[g] = std::fmin(1.0e12,
104 1.0 / 3.0 / (sigma_t_[g] - sig_1));
112 const auto& cols = S[0].rowI_indices_[g];
113 const auto& vals = S[0].rowI_values_[g];
114 for (
size_t t = 0; t < cols.size(); ++t)
117 sigma_s_gtog_[g] = vals[t];
126 sigma_removal_[g] = std::max(0.0, sigma_t_[g] - sigma_s_gtog_[g]);
129 diffusion_initialized_ =
true;
unsigned int num_groups_
Total number of groups.
std::vector< double > sigma_t_
Total cross section.
std::vector< chi_math::SparseMatrix > transfer_matrices_
void ComputeDiffusionParameters()
std::vector< double > sigma_a_
Absorption cross section.