#include <Solver_matrex.h>

MATREX solver class satisfying Origen::solver. More...
INTERFACE<<Origen::Solver>> | |
See Origen::Solver for details. | |
void | set_continuous_loss (Vec_Dbl *lambda) |
void | set_transition_matrix (TransitionMatrixP *trx) |
void | set_source (Vec_Dbl *src) |
void | get_defaults (ScaleUtils::IO::DB &dc, bool force=false) |
bool | check_opts (ScaleUtils::IO::DB &dc, bool allow_missing=true) |
void | set_opts (const ScaleUtils::IO::DB &opts) |
bool | solve (const Vec_Dbl &in, double flux, double dt, Vec_Dbl *out) |
const ScaleUtils::IO::DB & | status () const |
void | clear () |
Public Member Functions | |
Solver_matrex () | |
virtual | ~Solver_matrex () |
Static Public Member Functions | |
static void | get_defaults_static (ScaleUtils::IO::DB &dc, const bool force) |
static bool | check_opts_static (ScaleUtils::IO::DB &opts, bool allow_missing) |
Private Member Functions | |
void | set_continuous_loss_impl (Vec_Dbl *lambda) |
void | set_transition_matrix_impl (TransitionMatrixP *trx) |
void | set_source_impl (Vec_Dbl *src) |
void | get_defaults_impl (ScaleUtils::IO::DB &dc, bool force) |
bool | check_opts_impl (ScaleUtils::IO::DB &opts, bool allow_missing) |
void | set_opts_impl (const ScaleUtils::IO::DB &dc) |
bool | solve_impl (const Vec_Dbl &in, double flux, double dt, Vec_Dbl *out) |
const ScaleUtils::IO::DB & | status_impl () const |
void | clear_impl () |
Private Attributes | |
Vec_Dbl * | d_lambda |
Vec_Dbl * | d_src |
TransitionMatrixP * | d_trx |
ScaleUtils::IO::UP_DB | d_opts |
int | d_matrex_nterm |
int | d_matrex_nshrt |
int | d_is_adjoint |
Detailed Description
MATREX solver class satisfying Origen::solver.
- See also
- Origen::Solver, kernel_matrex()
The options for the MATREX solver are:
- "matrexNterm" (int)
- Minimum number of terms in the matrix power series expansion.
- Must be a positive integer.
- Default: 21.
- "materxNshrt" (int)
- Maximum number of nuclides in a decay chain of short-lived nuclides.
- Must be a positive integer.
- Default: 100.
- "matrexSubsteps" (int)
- Number of equidistant substeps to divide the step to.
- Must be a positive integer.
- Default: 1
- "isAdjoint" (bool)
- Is this an adjoint calculation?
- Must be false (MATREX cannot handle adjoint).
- Default: false.
- "solver" (string)
- Which solver are the options for? Used for some consistency checks.
- Must be "matrex".
- Default: "matrex".
- "matrexResultsCutoff" (double)
- Concentrations below cutoff*sum(abs(n_final)) are returned as zero.
- Must be non-negative.
- Default: 0.0
- "tallyEnergyReleased" (bool)
- Whether to add a tally nuclide to collect the amount of energy released during the depletion step.
- With non zero flux, uses the reaction kappas that include decay
- With zero flux, uses decay q-values.
- Note that if you sum depletion and subsequent decay steps, the decay energy will be counted twice (as it was already rolled to the reaction kappas),
- The result is found in status()->get<double>("energyReleased") and is in [MeV]/[units of n0]
- Default: false.
- THERE MIGHT BE CASES/DATA WHERE THIS FAILS WITH MATREX (use CRAM if you need to be sure)
- "tallyNumFissions" (bool)
- Whether to add a tally nuclide to collect the number of neutron induced fissions.
- The result is found in status()->get<double>("numFissions") and is in the units of n0.
- Default: false.
- THERE MIGHT BE CASES/DATA WHERE THIS FAILS WITH MATREX (use CRAM if you need to be sure)
- "tallyNumCaptures" (bool)
- Whether to add a tally nuclide to collect the total number of neutron induced removal reactions (including fissions).
- The result is found in status()->get<double>("numCaptures") and is in the units of n0.
- Default: false.
- THERE MIGHT BE CASES/DATA WHERE THIS FAILS WITH MATREX (use CRAM if you need to be sure)
- "tallyAveConcentrations" (bool)
- Whether to add a tally nuclides to collect the average concentrations of ALL nuclides in the library.
- The results are found in status()->get<double>("ave_<ZZZAAAI>") and is in the units of n0. <ZZZAAAI> is the extended ZAID of the nuclide (leading zeroes ommited).
- Default: false.
- THERE MIGHT BE CASES/DATA WHERE THIS FAILS WITH MATREX (use CRAM if you need to be sure)
The default values are returned by Solver::get_defaults() if the Solver is Solver_matrex. They can also be retreived with the static function Solver_matrex::get_defaults_static(). The default values should not be hard coded anywhere else than this class.
- Examples:
- exNEAMS.cpp, tstParallelDepletion.cpp, and tstSolver_matrex.cpp.
Constructor & Destructor Documentation
Solver_matrex | ( | ) |
References Solver_matrex::d_opts, and Solver::get_defaults().
|
virtual |
Member Function Documentation
|
static |
Static version of Solver::get_defaults() for the MATREX solver. Gets default solver options.
- Note
- See Origen::Solver_matrex for list of options. This function is the Only place that should actually contain the default values.
- Parameters
-
[out] dc A SCALE DataContainer where to write the options. [in] force If true, any values already in dc will be overwritten. If false, only parameters without any value in dc are set. Optional (default = false).
Referenced by Solver_matrex::get_defaults_impl().
|
static |
Static version of Solver::check_opts for Solver_matrex. Check that a set of MATREX solver options is valid. This does not quarantee that the results will be accurate, only that the solver can be run with the options.
- Note
- See Origen::Solver_matrex for description of the options.
- Parameters
-
[in,out] opts In: the solver options. out: any error messages about the options. [in] allow_missing Whether opts is allowed to miss options without prompting an error. Optional (default = true)
- Returns
- true if the check is passed, false if the check fails.
- Note
- Any errors will be written to opts.
- Examples:
- tstSolver_matrex.cpp.
Referenced by Solver_matrex::check_opts_impl(), and TEST().
|
privatevirtual |
Implements Solver.
References Solver_matrex::d_lambda.
|
privatevirtual |
Implements Solver.
References Solver_matrex::d_trx.
|
privatevirtual |
Implements Solver.
References Solver_matrex::d_src.
|
privatevirtual |
Implements Solver.
References Solver_matrex::get_defaults_static().
|
privatevirtual |
Implements Solver.
References Solver_matrex::check_opts_static().
|
privatevirtual |
Implements Solver.
References Solver::check_opts(), CLASS_NAME, and Solver_matrex::d_opts.
Implements Solver.
References TransitionMatrixP::add_concentration_tallies(), TransitionMatrixP::add_energy_tally(), TransitionMatrixP::add_num_captures_tally(), TransitionMatrixP::add_num_fissions_tally(), Solver::check_opts(), Solver_matrex::d_lambda, Solver_matrex::d_opts, Solver_matrex::d_src, Solver_matrex::d_trx, TransitionMatrixP::fold_flux(), TransitionMatrixP::get_itot(), TransitionMatrixP::get_non(), and kernel_matrex().
|
privatevirtual |
Implements Solver.
References Solver_matrex::d_opts.
|
privatevirtual |
Implements Solver.
References Solver_matrex::d_opts, Solver::get_defaults(), Solver::set_continuous_loss(), Solver::set_source(), and Solver::set_transition_matrix().
|
inherited |
Set continuous removal rates. The rates are defined by decays constants that decay the nuclide out of existence.
- Parameters
-
[in] lambda The removal rates >= 0 [1/s] for each nuclide.
- Examples:
- tstSolver_cram.cpp, and tstSolver_matrex.cpp.
References Solver::set_continuous_loss_impl().
Referenced by Solver_Fake::clear_impl(), Solver_cram::clear_impl(), Solver_matrex::clear_impl(), and TEST().
|
inherited |
Set an Origen TransitionMatrix (library data).
- Parameters
-
[in] trx Origen::TransitionMatrix containing the library data.
- Examples:
- exNEAMS.cpp, tstSolver_cram.cpp, and tstSolver_matrex.cpp.
References Solver::set_transition_matrix_impl().
Referenced by Solver_Fake::clear_impl(), Solver_cram::clear_impl(), Solver_matrex::clear_impl(), and TEST().
|
inherited |
Set constant source term.
- Parameters
-
[in] src The source terms for each nuclide [(units of n0 in Solver::solve()) per second].
- Examples:
- tstSolver_cram.cpp, and tstSolver_matrex.cpp.
References Solver::set_source_impl().
Referenced by Solver_Fake::clear_impl(), Solver_cram::clear_impl(), Solver_matrex::clear_impl(), and TEST().
|
inherited |
Get default solver opts.
- Note
- The options are solver specific. See the appropriate solver subclass for list of opts.
- Parameters
-
[out] dc A SCALE DataContainer where to write the opts. [in] force If true, any values already in dc will be overwritten. If false, only parameters without any value in dc are set. Optional (default = false).
- Examples:
- tstSolver_cram.cpp, and tstSolver_matrex.cpp.
References Solver::get_defaults_impl().
Referenced by Solver_cram::clear_impl(), Solver_matrex::clear_impl(), Solver_cram::Solver_cram(), Solver_matrex::Solver_matrex(), and TEST().
|
inherited |
Check that a set of solver options is valid. This does not quarantee that the results will be accurate, only that the solver can be run with the opts.
- Note
- The options are solver specific. See the appropriate solver subclass for list of opts.
- Parameters
-
[in,out] opts In: the solver opts. out: any error messages about the opts. [in] allow_missing Whether opts is allowed to miss options without prompting an error. Optional (default = true).
- Returns
- true if the check is passed, false if the check fails.
- Note
- Any errors will be written to opts.
- Examples:
- tstSolver_cram.cpp, and tstSolver_matrex.cpp.
References Solver::check_opts_impl().
Referenced by Solver_cram::set_opts_impl(), Solver_matrex::set_opts_impl(), Solver_cram::solve_impl(), Solver_matrex::solve_impl(), and TEST().
|
inherited |
Set solver opts. Dies if you try to set incorrect values, so use Solver::check_opts() first if you want to be sure. Any options that are not specified in opts will be left to their earlier values (all are set to defaults by the constructor and by Solver::clear().
- Note
- The options are solver specific. See the appropriate solver subclass for list of opts.
- Parameters
-
[in] dc The new solver opts. Any option not specified will be left untouched.
- Examples:
- tstSolver_cram.cpp, and tstSolver_matrex.cpp.
References Solver::set_opts_impl().
Referenced by TEST().
Perform a single depletion calculation. TransitionMatrix must be set.
- Note
- Concentration units. "in" can have any units directly proportional to the number of atoms. The solver does not care about scaling. "out" will be in the same units. Make sure that the source term is in the correct units. Valid units include [1], [1/cm3], [1/bcm], [mol], etc.
- Parameters
-
[in] in Initial concentrations or abundances [see the note]. [in] flux Neutron flux density [1/cm2s]. [in] dt Step length [s]. [out] out Final concentrations or abundances [same units as "in"].
- Returns
- true on success or false on failure.
- Examples:
- exNEAMS.cpp, tstSolver.cpp, tstSolver_cram.cpp, and tstSolver_matrex.cpp.
References Solver::solve_impl().
Referenced by TEST().
|
inherited |
Return current solver options and possible error messages from Solver::solve(). Note, however, that the solver kernels do not actually send any error messages as of yet and instead terminate the process.
- Note
- The options are solver specific. See the appropriate solver subclass for list of opts.
- Returns
- the options and error messages.
- Examples:
- tstSolver_cram.cpp, and tstSolver_matrex.cpp.
References Solver::status_impl().
Referenced by TEST().
|
inherited |
Clear all data returning the solver option to the state it had right after constructor. All solver options get default values.
- Note
- This never needs to be called for memory management or other similar reasons.
- Examples:
- exNEAMS.cpp.
References Solver::clear_impl().
Referenced by TEST().
Member Data Documentation
|
private |
Referenced by Solver_matrex::set_continuous_loss_impl(), and Solver_matrex::solve_impl().
|
private |
Referenced by Solver_matrex::set_source_impl(), and Solver_matrex::solve_impl().
|
private |
Referenced by Solver_matrex::set_transition_matrix_impl(), and Solver_matrex::solve_impl().
|
private |
|
private |
|
private |
|
private |
The documentation for this class was generated from the following files:
- Solver/matrex/Solver_matrex.h
- Solver/matrex/Solver_matrex.cpp