Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "GeneralReporter.h" 13 : #include "AdaptiveImportanceSampler.h" 14 : 15 : /** 16 : * AdaptiveImportanceStats will help make sample accept/reject decisions in adaptive Monte Carlo 17 : * schemes. 18 : */ 19 : class AdaptiveImportanceStats : public GeneralReporter 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : AdaptiveImportanceStats(const InputParameters & parameters); 24 1296 : virtual void initialize() override {} 25 1296 : virtual void finalize() override {} 26 : virtual void execute() override; 27 : 28 : protected: 29 : /// Model output value from SubApp 30 : const std::vector<Real> & _output_value; 31 : 32 : /// Means of the importance distributions 33 : std::vector<Real> & _mu_imp; 34 : 35 : /// Standard deviations of the importance distributions 36 : std::vector<Real> & _std_imp; 37 : 38 : /// Failure probability estimate 39 : std::vector<Real> & _pf; 40 : 41 : /// Coefficient of variation of failure probability 42 : std::vector<Real> & _cov_pf; 43 : 44 : private: 45 : /// Track the current step of the main App 46 : const int & _step; 47 : 48 : /// Adaptive Importance Sampler 49 : AdaptiveImportanceSampler & _ais; 50 : 51 : /// Flag for GP utilization 52 : const std::vector<bool> * _gp_flag; 53 : 54 : /// Ensure that the MCMC algorithm proceeds in a sequential fashion 55 : int _check_step; 56 : 57 : /// Storage for the sequential sum of pf 58 : Real _pf_sum; 59 : 60 : /// Storage for the sequential sum of variance of pf 61 : Real _var_sum; 62 : 63 : /// Storage for the distribution names 64 : std::vector<const Distribution *> _distributions_store; 65 : 66 : /// Storage for the standard deviation factor over the importance distribution 67 : Real _factor; 68 : };