21 const double fission_scaling )
const
23 Chi::log.
Log() <<
"Exporting transport cross section to file: " << file_name;
30 auto Print1DXS = [](std::ofstream& ofile,
31 const std::string& prefix,
32 const std::vector<double>& xs,
33 double min_value=-1.0)
50 ofile << prefix <<
"_BEGIN\n";
57 ofile << prefix <<
"_END\n";
64 std::ofstream ofile(file_name);
70 std::vector<double> nu, nu_prompt, nu_delayed;
75 for (
unsigned int g = 0; g <
NumGroups(); ++g)
79 nu_prompt.push_back(nu_prompt_sigma_f[g] / sigma_f[g]);
80 nu_delayed.push_back(nu_delayed_sigma_f[g] / sigma_f[g]);
82 nu.push_back(nu_sigma_f[g] / sigma_f[g]);
85 std::vector<double> decay_constants, fractional_yields;
88 decay_constants.push_back(precursor.decay_constant);
89 fractional_yields.push_back(precursor.fractional_yield);
94 ofile <<
"# Exported cross section from ChiTech\n";
96 ofile <<
"NUM_GROUPS " <<
NumGroups() <<
"\n";
102 Print1DXS(ofile,
"SIGMA_T",
SigmaTotal(), 1.0e-20);
109 if (fission_scaling != 1.0)
111 for (
auto& val: scaled_sigma_f)
112 val *= fission_scaling;
115 Print1DXS(ofile,
"SIGMA_F", scaled_sigma_f, 1.0e-20);
118 Print1DXS(ofile,
"NU_PROMPT", nu_prompt, 1.0e-20);
119 Print1DXS(ofile,
"NU_DELAYED", nu_delayed, 1.0e-20);
122 ofile <<
"\nCHI_DELAYED_BEGIN\n";
125 for (
unsigned int g = 0; g <
NumGroups(); ++g)
126 ofile <<
"G_PRECURSOR_VAL"
129 <<
" " << precursors[j].emission_spectrum[g]
131 ofile <<
"CHI_DELAYED_END\n";
133 Print1DXS(ofile,
"PRECURSOR_DECAY_CONSTANTS",
134 decay_constants, 1.0e-20);
135 Print1DXS(ofile,
"PRECURSOR_FRACTIONAL_YIELDS",
136 fractional_yields, 1.0e-20);
141 Print1DXS(ofile,
"NU", nu, 1.0e-20);
154 ofile <<
"TRANSFER_MOMENTS_BEGIN\n";
157 if (ell ==0 ) ofile <<
"#Zeroth moment (l=0)\n";
158 else ofile <<
"#(l=" << ell <<
")\n";
162 for (
size_t g = 0; g < matrix.rowI_values_.size(); ++g)
164 const auto& col_indices = matrix.rowI_indices_[g];
165 const auto& col_values = matrix.rowI_values_[g];
167 for (
size_t k=0; k<col_indices.size(); ++k)
168 ofile <<
"M_GPRIME_G_VAL "
170 << col_indices[k] <<
" "
172 << col_values[k] <<
"\n";
177 ofile <<
"TRANSFER_MOMENTS_END\n";
185 ofile <<
"PRODUCTION_MATRIX_BEGIN\n";
186 for (
unsigned int g = 0; g <
NumGroups(); ++g)
188 const auto& prod = F[g];
189 for (
unsigned int gp = 0; gp <
NumGroups(); ++gp)
192 fission_scaling != 1.0 ?
193 prod[gp] * fission_scaling : prod[gp];
195 ofile <<
"G_GPRIME_VAL "
206 "cross section to file: " << file_name;
LogStream Log(LOG_LVL level=LOG_0)
static std::string GetLocalDateTimeString()
virtual const unsigned int NumGroups() const =0
virtual const std::vector< Precursor > & Precursors() const =0
virtual const unsigned int NumPrecursors() const =0
virtual const chi_math::SparseMatrix & TransferMatrix(unsigned int ell) const =0
virtual const std::vector< double > & InverseVelocity() const =0
virtual const std::vector< double > & NuDelayedSigmaF() const =0
virtual const std::vector< std::vector< double > > ProductionMatrix() const =0
virtual const std::vector< double > & SigmaTotal() const =0
virtual const std::vector< double > & SigmaAbsorption() const =0
void ExportToChiXSFile(const std::string &file_name, const double fission_scaling=1.0) const
virtual const std::vector< double > & SigmaFission() const =0
virtual const unsigned int ScatteringOrder() const =0
virtual const std::vector< double > & NuSigmaF() const =0
virtual const std::vector< double > & NuPromptSigmaF() const =0
virtual const std::vector< chi_math::SparseMatrix > & TransferMatrices() const =0