Class ResponseEvaluator
Defined in File response_evaluator.h
Nested Relationships
Nested Types
Class Documentation
-
class ResponseEvaluator
A class used for evaluating responses by folding sources against adjoint solutions.
The workflow for this utility is constructed to minimize the file reading necessary for evaluations. To begin, one should add all adjoint solutions that are desired for response computations as named data sets. Then, one should define the different forward source configurations of interest. With this, the user can now iterate over the source configurations and convolve them against all available adjoint data sets. For example,
evaluator = ResponseEvaluator(problem=phys) evaluator.SetOptions(data=[{"name": "detector", "file_prefixes": {...}}, ...]) responses = {} for config_index, source_config in enumerate(source_configs): evaluator.ClearForwardSources() evaluator.SetOptions(sources=source_config) responses[config_index] = { data_name: evaluator.EvaluateResponse(data_name) for data_name in data_names }
Public Functions
-
explicit ResponseEvaluator(const InputParameters ¶ms)
Construct the evaluator and apply its options with SetOptions. Collective.
-
void SetOptions(const InputParameters ¶ms)
Add data sets with SetDataOptions and forward sources with SetSourceOptions.
Collective, and every rank must give the same options.
-
void SetDataOptions(const InputParameters &input)
Add a named data set.
file_prefixesmay containflux_momentsandangular_fluxes, the adjoint flux moments and angular fluxes that EvaluateResponse folds against the forward sources, andsurface_angular_fluxes, the surface data that EvaluateSurfaceResponse pairs. Flux moments and angular fluxes must have been written with the current partitioning. The listedsurfacesare read from all surface files of the prefix, whatever number of ranks and partitioning wrote them, and distributed by face over the current ranks with DistributeSurfaceAngularFluxes. Each is a boundary name or an interior surface name, which reads both stored sides<name>_uand<name>_d. Collective.
-
void SetSourceOptions(const InputParameters &input)
Add forward sources.
Collective. A material source counts its cells over all ranks, so every rank must add the same sources in the same order.
-
void SetMaterialSourceOptions(const InputParameters ¶ms)
Add one material source. Collective, as described for SetSourceOptions.
-
void SetBoundarySourceOptions(const InputParameters ¶ms)
-
void ClearForwardSources()
Clear the existing forward sources from the response evaluator.
-
void AddResponseData(const InputParameters ¶ms)
-
void AddResponseSources(const InputParameters ¶ms)
-
double EvaluateResponse(const std::string &data_name) const
Evaluate a response by folding the currently defined forward sources against the adjoint flux moments and angular fluxes of the named data set added with SetDataOptions.
Point and volumetric sources are evaluated at the problem’s time and skipped when inactive then, as in the forward source assembly. Volumetric sources use the consistent mass matrix. Boundary sources require adjoint angular fluxes in physical orientation.
Collective. Throws
std::invalid_argumentfor an unknown data set andstd::logic_errorif the data set lacks the flux moments or angular fluxes that the defined sources require.
-
std::vector<SurfaceResponse> EvaluateSurfaceResponse(const std::string &fwd_data_name, const std::string &adj_data_name, const std::vector<std::string> &surfaces = {}) const
Evaluate the surface response of forward and adjoint surface angular fluxes added with SetDataOptions.
Returns one surface response per selected surface, as defined in ComputeSurfaceResponses: its outgoing and incoming parts and their sum, the response carried across the surface. They are also logged at verbosity 1.
Collective. Throws
std::invalid_argumentfor unknown data sets or surfaces, a surface requested more than once, and incompatible data, andstd::logic_errorif the forward and adjoint data do not cover the same faces.- Parameters:
fwd_data_name – Name of the forward data set.
adj_data_name – Name of the adjoint data set.
surfaces – Surfaces to evaluate: boundary names and interior surface names (
<name>or<name>_ualong the_unormal,<name>_dalong the_dnormal). If empty, every surface in the forward data is evaluated, in name order.
Public Static Functions
-
static InputParameters GetBoundarySourceOptionsBlock()
-
static InputParameters GetInputParameters()
Returns the input parameters for this object.
-
static std::shared_ptr<ResponseEvaluator> Create(const ParameterBlock ¶ms)
-
static InputParameters GetOptionsBlock()
Return the schema for the options block, covering data sets and forward sources.
-
static InputParameters GetDataOptionsBlock()
-
static InputParameters GetSourceOptionsBlock()
-
static InputParameters GetMaterialSourceOptionsBlock()
-
explicit ResponseEvaluator(const InputParameters ¶ms)