https://mooseframework.inl.gov
AdaptiveMonteCarloDecision.h
Go to the documentation of this file.
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"
16 
22 {
23 public:
26  virtual void initialize() override {}
27  virtual void finalize() override {}
28  virtual void execute() override;
29 
30 protected:
32  const std::vector<Real> & _output_value;
33 
35  std::vector<Real> & _output_required;
36 
38  std::vector<std::vector<Real>> & _inputs;
39 
40 private:
45  void reinitChain();
46 
49 
52 
55 
58 
61 
63  std::vector<std::vector<Real>> _prev_val;
64 
66  std::vector<Real> _prev_val_out;
67 
69  std::vector<std::vector<Real>> _inputs_sto;
70 
72  std::vector<std::vector<Real>> _inputs_sorted;
73 
75  std::vector<Real> _outputs_sto;
76 
78  std::vector<Real> _output_sorted;
79 
82 
84  const bool _gp_used;
85 
87  const int * const _gp_training_samples;
88 };
Sampler & _sampler
The adaptive Monte Carlo sampler.
std::vector< Real > _prev_val_out
Storage for previously accepted output value.
A class used to perform Parallel Subset Simulation Sampling.
const bool _gp_used
Check if a GP is used.
A class used to perform Adaptive Importance Sampling using a Markov Chain Monte Carlo algorithm...
AdaptiveMonteCarloDecision(const InputParameters &parameters)
void reinitChain()
This reinitializes the Markov chain to the starting value until the Gaussian process training is comp...
std::vector< std::vector< Real > > _inputs_sto
Storage for the previously accepted sample inputs across all the subsets.
std::vector< std::vector< Real > > _inputs_sorted
Store the sorted input samples according to their corresponding outputs.
std::vector< std::vector< Real > > _prev_val
Storage for previously accepted input values. This helps in making decision on the next proposed inpu...
const int *const _gp_training_samples
Store the GP training samples.
libMesh::Parallel::Communicator & _local_comm
Communicator that was split based on samples that have rows.
const std::vector< Real > & _output_value
Model output value from SubApp.
const ParallelSubsetSimulation *const _pss
Parallel Subset Simulation sampler.
std::vector< Real > _output_sorted
Store the sorted output sample values.
virtual void initialize() override
AdaptiveMonteCarloDecision will help make sample accept/reject decisions in adaptive Monte Carlo sche...
int _check_step
Ensure that the MCMC algorithm proceeds in a sequential fashion.
static InputParameters validParams()
std::vector< Real > _outputs_sto
Storage for previously accepted sample outputs across all the subsets.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > & _output_required
Modified value of model output by this reporter class.
const AdaptiveImportanceSampler *const _ais
Adaptive Importance Sampler.
std::vector< std::vector< Real > > & _inputs
Model input data that is uncertain.
const InputParameters & parameters() const
Real _output_limit
Store the intermediate ouput failure thresholds.