https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | List of all members
AdaptiveMonteCarloDecision Class Reference

AdaptiveMonteCarloDecision will help make sample accept/reject decisions in adaptive Monte Carlo schemes. More...

#include <AdaptiveMonteCarloDecision.h>

Inheritance diagram for AdaptiveMonteCarloDecision:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 AdaptiveMonteCarloDecision (const InputParameters &parameters)
 
virtual void initialize () override
 
virtual void finalize () override
 
virtual void execute () override
 
void threadJoin (const UserObject &) final
 
bool shouldStore () const override final
 
SubProblemgetSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void gatherSum (T &value)
 
void gatherMax (T &value)
 
void gatherMin (T &value)
 
void gatherProxyValueMax (T1 &proxy, T2 &value)
 
void gatherProxyValueMin (T1 &proxy, T2 &value)
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObjectprimaryThreadCopy ()
 
std::set< UserObjectName > getDependObjects () const
 
virtual bool needThreadedCopy () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const std::vector< MooseVariableScalar *> & getCoupledMooseScalarVars ()
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName (const std::string &prop_name)
 
const MaterialProperty< T > & getZeroMaterialProperty (Ts... args)
 
std::set< SubdomainIDgetMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryIDgetMaterialPropertyBoundaryIDs (const std::string &name)
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 
std::unordered_map< SubdomainID, std::vector< MaterialBase *> > buildRequiredMaterials (bool allow_stateful=true)
 
void statefulPropertiesAllowed (bool)
 
bool getMaterialPropertyCalled () const
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 
virtual void resolveOptionalProperties ()
 
const GenericMaterialProperty< T, is_ad > & getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state)
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
virtual void store (nlohmann::json &json) const
 
virtual void declareLateValues ()
 
void buildOutputHideVariableList (std::set< std::string > variable_names)
 
const std::set< OutputName > & getOutputs ()
 
virtual void subdomainSetup () override
 
virtual void subdomainSetup () override
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
T & getSampler (const std::string &name)
 
SamplergetSampler (const std::string &name)
 
T & getSamplerByName (const SamplerName &name)
 
SamplergetSamplerByName (const SamplerName &name)
 
virtual void meshChanged ()
 
virtual void meshDisplaced ()
 
PerfGraphperfGraph ()
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void sort (typename std::vector< T > &vector)
 
static void sortDFS (typename std::vector< T > &vector)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static constexpr PropertyValue::id_type default_property_id
 
static constexpr PropertyValue::id_type zero_property_id
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObject &uo) const override
 
void addReporterDependencyHelper (const ReporterName &reporter_name) override
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 
libMesh::Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValuecoupledVectorTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledMatrixTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalargetScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 
void markMatPropRequested (const std::string &)
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 
T & declareUnusedValue (Args &&... args)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
T & declareValue (const std::string &param_name, Args &&... args)
 
T & declareValue (const std::string &param_name, ReporterMode mode, Args &&... args)
 
T & declareValue (const std::string &param_name, Args &&... args)
 
T & declareValue (const std::string &param_name, ReporterMode mode, Args &&... args)
 
T & declareValue (const std::string &param_name, Args &&... args)
 
T & declareValue (const std::string &param_name, ReporterMode mode, Args &&... args)
 
T & declareValue (const std::string &param_name, Args &&... args)
 
T & declareValue (const std::string &param_name, ReporterMode mode, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, ReporterMode mode, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, ReporterMode mode, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, ReporterMode mode, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, ReporterMode mode, Args &&... args)
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const std::vector< Real > & _output_value
 Model output value from SubApp. More...
 
std::vector< Real > & _output_required
 Modified value of model output by this reporter class. More...
 
std::vector< std::vector< Real > > & _inputs
 Model input data that is uncertain. More...
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
const THREAD_ID _tid
 
Assembly_assembly
 
const Moose::CoordinateSystemType_coord_sys
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
FEProblemBase_mdi_feproblem
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
FEProblemBase_sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real_real_zero
 
const VariableValue_scalar_zero
 
const Point & _point_zero
 
const InputParameters_mi_params
 
const std::string _mi_name
 
const MooseObjectName _mi_moose_object_name
 
FEProblemBase_mi_feproblem
 
SubProblem_mi_subproblem
 
const THREAD_ID _mi_tid
 
const Moose::MaterialDataType _material_data_type
 
MaterialData_material_data
 
bool _stateful_allowed
 
bool _get_material_property_called
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 
std::unordered_set< unsigned int_material_property_dependencies
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real_t
 
const Real_t_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
bool _is_transient
 
const Parallel::Communicator & _communicator
 

Static Protected Attributes

static const std::string _interpolated_old
 
static const std::string _interpolated_older
 

Private Member Functions

void reinitChain ()
 This reinitializes the Markov chain to the starting value until the Gaussian process training is completed. More...
 

Private Attributes

Sampler_sampler
 The adaptive Monte Carlo sampler. More...
 
const AdaptiveImportanceSampler *const _ais
 Adaptive Importance Sampler. More...
 
const ParallelSubsetSimulation *const _pss
 Parallel Subset Simulation sampler. More...
 
int _check_step
 Ensure that the MCMC algorithm proceeds in a sequential fashion. More...
 
libMesh::Parallel::Communicator_local_comm
 Communicator that was split based on samples that have rows. More...
 
std::vector< std::vector< Real > > _prev_val
 Storage for previously accepted input values. This helps in making decision on the next proposed inputs. More...
 
std::vector< Real_prev_val_out
 Storage for previously accepted output value. More...
 
std::vector< std::vector< Real > > _inputs_sto
 Storage for the previously accepted sample inputs across all the subsets. More...
 
std::vector< std::vector< Real > > _inputs_sorted
 Store the sorted input samples according to their corresponding outputs. More...
 
std::vector< Real_outputs_sto
 Storage for previously accepted sample outputs across all the subsets. More...
 
std::vector< Real_output_sorted
 Store the sorted output sample values. More...
 
Real _output_limit
 Store the intermediate ouput failure thresholds. More...
 
const bool _gp_used
 Check if a GP is used. More...
 
const int *const _gp_training_samples
 Store the GP training samples. More...
 

Detailed Description

AdaptiveMonteCarloDecision will help make sample accept/reject decisions in adaptive Monte Carlo schemes.

Definition at line 21 of file AdaptiveMonteCarloDecision.h.

Constructor & Destructor Documentation

◆ AdaptiveMonteCarloDecision()

AdaptiveMonteCarloDecision::AdaptiveMonteCarloDecision ( const InputParameters parameters)

Definition at line 36 of file AdaptiveMonteCarloDecision.C.

38  _output_value(isParamValid("gp_decision") ? getReporterValue<std::vector<Real>>("output_value")
39  : getReporterValue<std::vector<Real>>(
40  "output_value", REPORTER_MODE_DISTRIBUTED)),
41  _output_required(declareValue<std::vector<Real>>("output_required")),
42  _inputs(declareValue<std::vector<std::vector<Real>>>("inputs")),
43  _sampler(getSampler("sampler")),
44  _ais(dynamic_cast<const AdaptiveImportanceSampler *>(&_sampler)),
45  _pss(dynamic_cast<const ParallelSubsetSimulation *>(&_sampler)),
46  _check_step(std::numeric_limits<int>::max()),
48  _gp_used(isParamValid("gp_decision")),
50  _gp_used ? &getUserObject<ActiveLearningGPDecision>("gp_decision").getTrainingSamples()
51  : nullptr)
52 {
53 
54  // Check whether the selected sampler is an adaptive sampler or not
55  if (!_ais && !_pss)
56  paramError("sampler", "The selected sampler is not an adaptive sampler.");
57 
58  const auto rows = _sampler.getNumberOfRows();
59  const auto cols = _sampler.getNumberOfCols();
60 
61  // Initialize the required variables depending upon the type of adaptive Monte Carlo algorithm
62  _inputs.resize(cols, std::vector<Real>(rows));
63  _prev_val.resize(cols, std::vector<Real>(rows));
64  _output_required.resize(rows);
65  _prev_val_out.resize(rows);
66 
67  if (_ais)
68  {
69  for (dof_id_type j = 0; j < _sampler.getNumberOfCols(); ++j)
70  _prev_val[j][0] = _ais->getInitialValues()[j];
72  }
73  else if (_pss)
74  {
75  _inputs_sto.resize(cols, std::vector<Real>(_pss->getNumSamplesSub()));
76  _inputs_sorted.resize(cols);
78  _output_limit = -std::numeric_limits<Real>::max();
79  }
80 }
Sampler & _sampler
The adaptive Monte Carlo sampler.
std::vector< Real > _prev_val_out
Storage for previously accepted output value.
const bool _gp_used
Check if a GP is used.
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.
bool isParamValid(const std::string &name) const
const T & getReporterValue(const std::string &param_name, const std::size_t time_index=0)
libMesh::Parallel::Communicator & _local_comm
Communicator that was split based on samples that have rows.
libMesh::Parallel::Communicator & getLocalComm()
const std::vector< Real > & _output_value
Model output value from SubApp.
const unsigned int & getNumSamplesSub() const
Access the number samples per subset.
const ParallelSubsetSimulation *const _pss
Parallel Subset Simulation sampler.
int _check_step
Ensure that the MCMC algorithm proceeds in a sequential fashion.
void paramError(const std::string &param, Args... args) const
GeneralReporter(const InputParameters &parameters)
T & declareValue(const std::string &param_name, Args &&... args)
std::vector< Real > _outputs_sto
Storage for previously accepted sample outputs across all the subsets.
dof_id_type getNumberOfRows() const
std::vector< Real > & _output_required
Modified value of model output by this reporter class.
T & getSampler(const std::string &name)
const AdaptiveImportanceSampler *const _ais
Adaptive Importance Sampler.
std::vector< std::vector< Real > > & _inputs
Model input data that is uncertain.
const InputParameters & parameters() const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Real _output_limit
Store the intermediate ouput failure thresholds.
const std::vector< Real > & getInitialValues() const
dof_id_type getNumberOfCols() const
uint8_t dof_id_type

Member Function Documentation

◆ execute()

void AdaptiveMonteCarloDecision::execute ( )
overridevirtual

Implements GeneralReporter.

Definition at line 93 of file AdaptiveMonteCarloDecision.C.

94 {
96  {
98  return;
99  }
100 
101  /* Decision step to whether or not to accept the proposed sample by the sampler.
102  This decision step changes with the type of adaptive Monte Carlo sampling algorithm. */
103  if (_ais)
104  {
105  const Real tmp = _ais->getUseAbsoluteValue() ? std::abs(_output_value[0]) : _output_value[0];
106 
107  /* Checking whether a GP surrogate is used. If it is used, importance sampling is not performed
108  during the training phase of the GP and all proposed samples are accepted until the training
109  phase is completed. Once the training is completed, the importance sampling starts.
110  If a GP surrogate is not used, the standard proposal and acceptance/rejection is performed as
111  part of the importance sampling. */
112  const bool restart_gp = _gp_used && _t_step == *_gp_training_samples;
113  const bool output_limit_reached = _gp_used || tmp >= _output_limit;
114  if (restart_gp)
115  reinitChain();
116 
117  _output_required[0] = output_limit_reached ? 1.0 : 0.0;
118 
119  if (_t_step <= _ais->getNumSamplesTrain() && !restart_gp)
120  {
121  /* This is the training phase of the Adaptive Importance Sampling algorithm.
122  Here, it is decided whether or not to accept a proposed sample by the
123  AdaptiveImportanceSampler.C sampler depending upon the model output_value. */
124  _inputs = output_limit_reached
126  : _prev_val;
127  if (output_limit_reached)
128  _prev_val = _inputs;
130  }
131  else if (_t_step > _ais->getNumSamplesTrain() && !restart_gp)
132  {
133  /* This is the sampling phase of the Adaptive Importance Sampling algorithm.
134  Here, all proposed samples by the AdaptiveImportanceSampler.C sampler are accepted since
135  the importance distribution traning phase is finished. */
137  _prev_val_out[0] = tmp;
138  }
139  }
140  else if (_pss)
141  {
142  // Track the current subset
143  const unsigned int subset =
145  const unsigned int sub_ind =
146  (_t_step - 1) - (_pss->getNumSamplesSub() / _sampler.getNumberOfRows()) * subset;
147  const unsigned int offset = sub_ind * _sampler.getNumberOfRows();
148  const unsigned int count_max = 1 / _pss->getSubsetProbability();
149 
151  for (dof_id_type ss = _sampler.getLocalRowBegin(); ss < _sampler.getLocalRowEnd(); ++ss)
152  {
153  const auto data = _sampler.getNextLocalRow();
154  for (unsigned int j = 0; j < _sampler.getNumberOfCols(); ++j)
155  data_in(ss, j) = data[j];
156  }
157  _local_comm.sum(data_in.get_values());
158 
159  // Get the accepted samples outputs across all the procs from the previous step
162  : _output_value;
164 
165  // These are the subsequent subsets which use Markov Chain Monte Carlo sampling scheme
166  if (subset > 0)
167  {
168  if (sub_ind == 0)
169  {
170  // _output_sorted contains largest po percentile output values
173  // _inputs_sorted contains the input values corresponding to the largest po percentile
174  // output values
177  // Get the subset's intermediate failure threshold values
179  }
180  // Check whether the number of samples in a Markov chain exceeded the limit
181  if (sub_ind % count_max == 0)
182  {
183  const unsigned int soffset = (sub_ind / count_max) * _sampler.getNumberOfRows();
184  // Reinitialize the starting input values for the next set of Markov chains
185  for (dof_id_type j = 0; j < _sampler.getNumberOfCols(); ++j)
186  _prev_val[j].assign(_inputs_sorted[j].begin() + soffset,
187  _inputs_sorted[j].begin() + soffset + _sampler.getNumberOfRows());
188  _prev_val_out.assign(_output_sorted.begin() + soffset,
189  _output_sorted.begin() + soffset + _sampler.getNumberOfRows());
190  }
191  else
192  {
193  // Otherwise, use the previously accepted input values to propose the next set of input
194  // values
195  for (dof_id_type j = 0; j < _sampler.getNumberOfCols(); ++j)
196  _prev_val[j].assign(_inputs_sto[j].begin() + offset - _sampler.getNumberOfRows(),
197  _inputs_sto[j].begin() + offset);
198  _prev_val_out.assign(_outputs_sto.begin() + offset - _sampler.getNumberOfRows(),
199  _outputs_sto.begin() + offset);
200  }
201  }
202 
203  // Check whether the outputs exceed the subset's intermediate failure threshold value
204  for (dof_id_type ss = 0; ss < _sampler.getNumberOfRows(); ++ss)
205  {
206  // Check whether the outputs exceed the subset's intermediate failure threshold value
207  // If so, accept the proposed input values by the Sampler object
208  // Otherwise, use the previously accepted input values
209  const bool output_limit_reached = _output_required[ss] >= _output_limit;
210  for (dof_id_type i = 0; i < _sampler.getNumberOfCols(); ++i)
211  {
212  _inputs[i][ss] = output_limit_reached ? data_in(ss, i) : _prev_val[i][ss];
213  _inputs_sto[i][ss + offset] = _inputs[i][ss];
214  }
215  if (!output_limit_reached)
217  _outputs_sto[ss + offset] = _output_required[ss];
218  }
219  }
220  // Track the current step
222 }
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
std::vector< std::vector< T > > reshapeVector(const std::vector< T > &vec, std::size_t n, bool row_major)
Reshape a vector into matrix-like vector of vectors.
Sampler & _sampler
The adaptive Monte Carlo sampler.
std::vector< Real > _prev_val_out
Storage for previously accepted output value.
const bool _gp_used
Check if a GP is used.
std::vector< Real > computeVectorABS(const std::vector< Real > &data)
return the absolute values in a vector.
void reinitChain()
This reinitializes the Markov chain to the starting value until the Gaussian process training is comp...
const bool & getUseAbsoluteValue() const
Access use absolute value bool.
std::vector< Real > getNextLocalRow()
std::vector< std::vector< Real > > _inputs_sto
Storage for the previously accepted sample inputs across all the subsets.
dof_id_type getLocalRowBegin() const
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...
dof_id_type getNumberOfLocalRows() const
const int *const _gp_training_samples
Store the GP training samples.
Real computeMin(const std::vector< Real > &data)
return the minimum value in a vector.
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 unsigned int & getNumSamplesSub() const
Access the number samples per subset.
const ParallelSubsetSimulation *const _pss
Parallel Subset Simulation sampler.
std::vector< Real > _output_sorted
Store the sorted output sample values.
int _check_step
Ensure that the MCMC algorithm proceeds in a sequential fashion.
const Real & getSubsetProbability() const
Access the subset probability.
dof_id_type getLocalRowEnd() const
std::vector< Real > _outputs_sto
Storage for previously accepted sample outputs across all the subsets.
dof_id_type getNumberOfRows() const
const int & getNumSamplesTrain() const
const bool & getUseAbsoluteValue() const
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.
std::vector< std::vector< Real > > sortInput(const std::vector< std::vector< Real >> &inputs, const std::vector< Real > &outputs, const unsigned int samplessub, const Real subset_prob)
return input values corresponding to the largest po percentile output values.
const AdaptiveImportanceSampler *const _ais
Adaptive Importance Sampler.
std::vector< std::vector< Real > > & _inputs
Model input data that is uncertain.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Real _output_limit
Store the intermediate ouput failure thresholds.
dof_id_type getNumberOfCols() const
uint8_t dof_id_type
std::vector< Real > sortOutput(const std::vector< Real > &outputs, const unsigned int samplessub, const Real subset_prob)
return the largest po percentile output values.

◆ finalize()

virtual void AdaptiveMonteCarloDecision::finalize ( )
inlineoverridevirtual

Implements GeneralReporter.

Definition at line 27 of file AdaptiveMonteCarloDecision.h.

27 {}

◆ initialize()

virtual void AdaptiveMonteCarloDecision::initialize ( )
inlineoverridevirtual

Implements GeneralReporter.

Definition at line 26 of file AdaptiveMonteCarloDecision.h.

26 {}

◆ reinitChain()

void AdaptiveMonteCarloDecision::reinitChain ( )
private

This reinitializes the Markov chain to the starting value until the Gaussian process training is completed.

Definition at line 83 of file AdaptiveMonteCarloDecision.C.

Referenced by execute().

84 {
85  const std::vector<Real> & tmp1 = _ais->getInitialValues();
86  for (dof_id_type j = 0; j < tmp1.size(); ++j)
87  _inputs[j][0] = tmp1[j];
89  _prev_val_out[0] = 1.0;
90 }
std::vector< Real > _prev_val_out
Storage for previously accepted output value.
std::vector< std::vector< Real > > _prev_val
Storage for previously accepted input values. This helps in making decision on the next proposed inpu...
const AdaptiveImportanceSampler *const _ais
Adaptive Importance Sampler.
std::vector< std::vector< Real > > & _inputs
Model input data that is uncertain.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const std::vector< Real > & getInitialValues() const
uint8_t dof_id_type

◆ validParams()

InputParameters AdaptiveMonteCarloDecision::validParams ( )
static

Definition at line 19 of file AdaptiveMonteCarloDecision.C.

20 {
22  params.addClassDescription("Generic reporter which decides whether or not to accept a proposed "
23  "sample in Adaptive Monte Carlo type of algorithms.");
24  params.addRequiredParam<ReporterName>("output_value",
25  "Value of the model output from the SubApp.");
26  params.addParam<ReporterValueName>(
27  "output_required",
28  "output_required",
29  "Modified value of the model output from this reporter class.");
30  params.addParam<ReporterValueName>("inputs", "inputs", "Uncertain inputs to the model.");
31  params.addRequiredParam<SamplerName>("sampler", "The sampler object.");
32  params.addParam<UserObjectName>("gp_decision", "The Gaussian Process decision reporter.");
33  return params;
34 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _ais

const AdaptiveImportanceSampler* const AdaptiveMonteCarloDecision::_ais
private

Adaptive Importance Sampler.

Definition at line 51 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), execute(), and reinitChain().

◆ _check_step

int AdaptiveMonteCarloDecision::_check_step
private

Ensure that the MCMC algorithm proceeds in a sequential fashion.

Definition at line 57 of file AdaptiveMonteCarloDecision.h.

Referenced by execute().

◆ _gp_training_samples

const int* const AdaptiveMonteCarloDecision::_gp_training_samples
private

Store the GP training samples.

Definition at line 87 of file AdaptiveMonteCarloDecision.h.

Referenced by execute().

◆ _gp_used

const bool AdaptiveMonteCarloDecision::_gp_used
private

Check if a GP is used.

Definition at line 84 of file AdaptiveMonteCarloDecision.h.

Referenced by execute().

◆ _inputs

std::vector<std::vector<Real> >& AdaptiveMonteCarloDecision::_inputs
protected

Model input data that is uncertain.

Definition at line 38 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), execute(), and reinitChain().

◆ _inputs_sorted

std::vector<std::vector<Real> > AdaptiveMonteCarloDecision::_inputs_sorted
private

Store the sorted input samples according to their corresponding outputs.

Definition at line 72 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), and execute().

◆ _inputs_sto

std::vector<std::vector<Real> > AdaptiveMonteCarloDecision::_inputs_sto
private

Storage for the previously accepted sample inputs across all the subsets.

Definition at line 69 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), and execute().

◆ _local_comm

libMesh::Parallel::Communicator& AdaptiveMonteCarloDecision::_local_comm
private

Communicator that was split based on samples that have rows.

Definition at line 60 of file AdaptiveMonteCarloDecision.h.

Referenced by execute().

◆ _output_limit

Real AdaptiveMonteCarloDecision::_output_limit
private

Store the intermediate ouput failure thresholds.

Definition at line 81 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), and execute().

◆ _output_required

std::vector<Real>& AdaptiveMonteCarloDecision::_output_required
protected

Modified value of model output by this reporter class.

Definition at line 35 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), and execute().

◆ _output_sorted

std::vector<Real> AdaptiveMonteCarloDecision::_output_sorted
private

Store the sorted output sample values.

Definition at line 78 of file AdaptiveMonteCarloDecision.h.

Referenced by execute().

◆ _output_value

const std::vector<Real>& AdaptiveMonteCarloDecision::_output_value
protected

Model output value from SubApp.

Definition at line 32 of file AdaptiveMonteCarloDecision.h.

Referenced by execute().

◆ _outputs_sto

std::vector<Real> AdaptiveMonteCarloDecision::_outputs_sto
private

Storage for previously accepted sample outputs across all the subsets.

Definition at line 75 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), and execute().

◆ _prev_val

std::vector<std::vector<Real> > AdaptiveMonteCarloDecision::_prev_val
private

Storage for previously accepted input values. This helps in making decision on the next proposed inputs.

Definition at line 63 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), execute(), and reinitChain().

◆ _prev_val_out

std::vector<Real> AdaptiveMonteCarloDecision::_prev_val_out
private

Storage for previously accepted output value.

Definition at line 66 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), execute(), and reinitChain().

◆ _pss

const ParallelSubsetSimulation* const AdaptiveMonteCarloDecision::_pss
private

Parallel Subset Simulation sampler.

Definition at line 54 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), and execute().

◆ _sampler

Sampler& AdaptiveMonteCarloDecision::_sampler
private

The adaptive Monte Carlo sampler.

Definition at line 48 of file AdaptiveMonteCarloDecision.h.

Referenced by AdaptiveMonteCarloDecision(), and execute().


The documentation for this class was generated from the following files: