https://mooseframework.inl.gov
ParallelSubsetSimulation.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 "Sampler.h"
13 #include "ReporterInterface.h"
14 
19 {
20 public:
22 
24 
26  const unsigned int & getNumSamplesSub() const;
27 
29  const bool & getUseAbsoluteValue() const;
30 
32  const Real & getSubsetProbability() const;
33 
37  virtual bool isAdaptiveSamplingCompleted() const override { return _is_sampling_completed; }
38 
39 protected:
40  virtual void sampleSetUp(const Sampler::SampleMode mode) override;
41  virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override;
42 
44  const unsigned int & _num_samplessub;
45 
47  const unsigned int & _num_subsets;
48 
50  const bool & _use_absolute_value;
51 
54 
56  const unsigned int & _num_random_seeds;
57 
59  const std::vector<Real> & _outputs;
60 
62  const std::vector<std::vector<Real>> & _inputs;
63 
65  const int & _step;
66 
68  const unsigned int _count_max;
69 
72 
74  unsigned int _subset;
75 
77  std::vector<Distribution const *> _distributions;
78 
81 
82 private:
84  std::vector<std::vector<Real>> _inputs_sto;
85 
87  std::vector<Real> _outputs_sto;
88 
90  std::vector<std::vector<Real>> _inputs_sorted;
91 
93  std::vector<std::vector<Real>> _markov_seed;
94 };
const std::vector< std::vector< Real > > & _inputs
Reporter value containing input values from decision reporter.
const std::vector< Real > & _outputs
Reporter value containing calculated outputs.
A class used to perform Parallel Subset Simulation Sampling.
std::vector< Distribution const * > _distributions
Storage for distribution objects to be utilized.
unsigned int _subset
Track the current subset index.
const bool & getUseAbsoluteValue() const
Access use absolute value bool.
virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override
std::vector< Real > _outputs_sto
Storage for previously accepted sample outputs across all the subsets.
int _check_step
Ensure that the MCMC algorithm proceeds in a sequential fashion.
const unsigned int & _num_random_seeds
Initialize a certain number of random seeds. Change from the default only if you have to...
std::vector< std::vector< Real > > _markov_seed
Mean input vector for the next proposed sample inputs across several processors.
std::vector< std::vector< Real > > _inputs_sorted
Store the sorted input samples according to their corresponding outputs.
const unsigned int & _num_subsets
Number of subsets.
bool _is_sampling_completed
True if the sampling is completed.
const int & _step
Track the current step of the main App.
const unsigned int & getNumSamplesSub() const
Access the number samples per subset.
virtual bool isAdaptiveSamplingCompleted() const override
Returns true if the adaptive sampling is completed.
const bool & _use_absolute_value
Absolute value of the model result. Use this when failure is defined as a non-exceedance rather than ...
ParallelSubsetSimulation(const InputParameters &parameters)
const Real & getSubsetProbability() const
Access the subset probability.
const unsigned int _count_max
Maximum length of markov chains based on subset probability.
std::vector< std::vector< Real > > _inputs_sto
Storage for the previously accepted sample inputs across all the subsets.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real & _subset_probability
The subset conditional failure probability.
const InputParameters & parameters() const
static InputParameters validParams()
const unsigned int & _num_samplessub
Number of samples per subset.
virtual void sampleSetUp(const Sampler::SampleMode mode) override
uint8_t dof_id_type