mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-21 14:35:27 -04:00
53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
#ifndef OPENMC_TALLIES_TRIGGER_H
|
|
#define OPENMC_TALLIES_TRIGGER_H
|
|
|
|
#include <string>
|
|
|
|
#include "pugixml.hpp"
|
|
|
|
namespace openmc {
|
|
|
|
//==============================================================================
|
|
// Type definitions
|
|
//==============================================================================
|
|
|
|
enum class TriggerMetric {
|
|
variance,
|
|
relative_error,
|
|
standard_deviation,
|
|
not_active
|
|
};
|
|
|
|
//! Stops the simulation early if a desired tally uncertainty is reached.
|
|
|
|
struct Trigger {
|
|
TriggerMetric metric; //!< The type of uncertainty (e.g. std dev) measured
|
|
double threshold; //!< Uncertainty value below which trigger is satisfied
|
|
bool ignore_zeros; //!< Whether to allow zero tally bins to be ignored
|
|
int score_index; //!< Index of the relevant score in the tally's arrays
|
|
};
|
|
|
|
//! Stops the simulation early if a desired k-effective uncertainty is reached.
|
|
|
|
struct KTrigger {
|
|
TriggerMetric metric {TriggerMetric::not_active};
|
|
double threshold {0.};
|
|
};
|
|
|
|
//==============================================================================
|
|
// Global variable declarations
|
|
//==============================================================================
|
|
|
|
// TODO: consider a different namespace
|
|
namespace settings {
|
|
extern KTrigger keff_trigger;
|
|
}
|
|
|
|
//==============================================================================
|
|
// Non-memeber functions
|
|
//==============================================================================
|
|
|
|
void check_triggers();
|
|
|
|
} // namespace openmc
|
|
#endif // OPENMC_TALLIES_TRIGGER_H
|