https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
20public:
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
39protected:
40 virtual void executeSetUp() 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
53 const Real & _subset_probability;
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
71 unsigned int _subset;
72
74 std::vector<Distribution const *> _distributions;
75
78
79private:
81 std::vector<std::vector<Real>> _inputs_sto;
82
84 std::vector<Real> _outputs_sto;
85
87 std::vector<std::vector<Real>> _inputs_sorted;
88
90 std::vector<std::vector<Real>> _markov_seed;
91};
const InputParameters & parameters() const
A class used to perform Parallel Subset Simulation Sampling.
const bool & _use_absolute_value
Absolute value of the model result. Use this when failure is defined as a non-exceedance rather than ...
const Real & getSubsetProbability() const
Access the subset probability.
const std::vector< Real > & _outputs
Reporter value containing calculated outputs.
const unsigned int & _num_random_seeds
Initialize a certain number of random seeds. Change from the default only if you have to.
const unsigned int & getNumSamplesSub() const
Access the number samples per subset.
bool _is_sampling_completed
True if the sampling is completed.
const int & _step
Track the current step of the main App.
virtual void executeSetUp() override
const bool & getUseAbsoluteValue() const
Access use absolute value bool.
const std::vector< std::vector< Real > > & _inputs
Reporter value containing input values from decision reporter.
virtual bool isAdaptiveSamplingCompleted() const override
Returns true if the adaptive sampling is completed.
const unsigned int & _num_samplessub
Number of samples per subset.
const unsigned int _count_max
Maximum length of markov chains based on subset probability.
const Real & _subset_probability
The subset conditional failure probability.
virtual Real computeSample(dof_id_type row_index, dof_id_type col_index) override
std::vector< Distribution const * > _distributions
Storage for distribution objects to be utilized.
std::vector< std::vector< Real > > _markov_seed
Mean input vector for the next proposed sample inputs across several processors.
std::vector< Real > _outputs_sto
Storage for previously accepted sample outputs across all the subsets.
const unsigned int & _num_subsets
Number of subsets.
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.
static InputParameters validParams()
unsigned int _subset
Track the current subset index.