https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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 | Static Private Member Functions | Private Attributes | List of all members
IndependentMHDecision Class Reference

A class for performing independent Metropolis-Hastings MCMC decision making. More...

#include <IndependentMHDecision.h>

Inheritance diagram for IndependentMHDecision:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 IndependentMHDecision (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
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObject * primaryThreadCopy ()
 
SubProblem & getSubProblem () const
 
bool shouldDuplicateInitialExecution () 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)
 
std::set< UserObjectName > getDependObjects () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool needThreadedCopy () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObject > getSharedPtr ()
 
std::shared_ptr< const MooseObject > getSharedPtr () const
 
bool isKokkosObject () const
 
MooseApp & getMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParameters & parameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () 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
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (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
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) 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 ExecFlagEnum & getExecuteOnEnum () 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 UserObjectBase & getUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBase & getUserObjectBaseByName (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)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name_in)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOldByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlderByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialProperty (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > getKokkosBlockMaterialProperty (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< SubdomainID > getMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryID > getMaterialPropertyBoundaryIDs (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)
 
virtual 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)
 
MaterialBase & getMaterial (const std::string &name)
 
MaterialBase & getMaterial (const std::string &name)
 
MaterialBase & getMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBase & getMaterialByName (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 hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (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 Function & getFunction (const std::string &name) const
 
const Function & getFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const T & getKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const T & getKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (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 VectorPostprocessorValue & getVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOldByName (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)
 
Sampler & getSampler (const std::string &name)
 
T & getSamplerByName (const SamplerName &name)
 
Sampler & getSamplerByName (const SamplerName &name)
 
virtual void meshChanged ()
 
virtual void meshDisplaced ()
 
PerfGraph & perfGraph ()
 
const PostprocessorValue & getPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValue & getPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValue & getPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOlderByName (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 Distribution & getDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const Distribution & getDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const Distribution & getDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const Distribution & getDistributionByName (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 callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
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, NameFunc &&name_func)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
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 computeEvidence (std::vector< Real > &evidence, const DenseMatrix< Real > &input_matrix) override
 Compute the evidence (aka, betterness of the proposed sample vs the previous)
 
virtual void computeTransitionVector (std::vector< Real > &tv, const std::vector< Real > &evidence) override
 Compute the transition probability vector (after the computation of evidence)
 
virtual void nextSamples (std::vector< Real > &req_inputs, DenseMatrix< Real > &input_matrix, const std::vector< Real > &tv, const unsigned int &parallel_index) override
 Resample inputs given the transition vector (after transition vector computed)
 
virtual void nextSeeds () override
 Compute the next set of seeds to facilitate proposals.
 
virtual bool usingGP () const
 Flag to specify if a pre-trained Gaussian process model is used.
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &uo) const override
 
void addReporterDependencyHelper (const ReporterName &reporter_name) override
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const ReporterContextBase & getReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterName & getReporterName (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 VariableValue & coupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValue & adCoupledScalarValue (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 VariableValue & coupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
const VariableValue & coupledMatrixTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValue & adCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagScalarValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::Scalar< const Real > kokkosCoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalar * getScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 
virtual void getKokkosMaterialPropertyHook (const std::string &, const unsigned int)
 
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)
 
LikelihoodFunctionBase * getLikelihoodFunctionByName (const UserObjectName &name) const
 Lookup a LikelihoodFunction object by name and return pointer.
 

Static Protected Member Functions

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

Protected Attributes

std::vector< std::vector< Real > > & _inputs
 Model input data that is uncertain.
 
std::vector< Real > & _tpm
 Transition probability matrix.
 
std::vector< Real > & _variance
 Model variance term.
 
Real & _noise
 Model noise term to pass to Likelihoods object.
 
std::vector< const LikelihoodFunctionBase * > _likelihoods
 Storage for the likelihood objects to be utilized.
 
Sampler & _sampler
 The MCMC sampler.
 
const PMCMCBase *const _pmcmc
 MCMC sampler base.
 
dof_id_type _props
 Storage for the number of parallel proposals.
 
const std::vector< Real > & _rnd_vec
 Storage for the random numbers for decision making.
 
const std::vector< Real > & _new_var_samples
 Storage for new proposed variance samples.
 
const std::vector< const Distribution * > _priors
 Storage for the priors.
 
const Distribution * _var_prior
 Storage for the prior over the variance.
 
std::vector< Real > * _outputs_required
 Transfer the right outputs to the file.
 
dof_id_type _num_confg_values
 Storage for the number of experimental configuration values.
 
dof_id_type _num_confg_params
 Storage for the number of experimental configuration parameters.
 
DenseMatrix< Real > & _data_prev
 Storage for previous inputs.
 
std::vector< Real > & _var_prev
 Storage for previous variances.
 
std::vector< Real > & _outputs_prev
 Storage for previous outputs.
 
const std::vector< Real > * _output_value
 Current output values.
 
int & _check_step
 Ensure that the MCMC algorithm proceeds in a sequential fashion.
 
const Moose::CoordinateSystemType & _coord_sys
 
const THREAD_ID _tid
 
SubProblem & _subproblem
 
FEProblemBase & _fe_problem
 
SystemBase & _sys
 
Assembly & _assembly
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp & _app
 
Factory & _factory
 
ActionFactory & _action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters & _pars
 
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 bool _is_kokkos_object
 
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

const Moose::FunctionBase * getKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBase & getUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const T & castUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const VectorPostprocessorValue & getVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
 
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool vectorPostprocessorsAdded () const
 
bool reportersAdded () const
 
void possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string &param_name="") const
 
RestartableDataValue & registerRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValue & getMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 
const VariableValue * getDefaultValue (const std::string &var_name) const
 
const ADVariableValue * getADDefaultValue (const std::string &var_name) const
 
void checkVar (const std::string &var_name) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagScalarVariable (const std::string &var_name, const std::string &tag_name, unsigned int comp) const
 
Moose::MaterialDataType getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const
 
unsigned int getMaxQps () const
 
void addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name)
 
const ReporterValueName & getReporterValueName (const std::string &param_name) const
 
const PostprocessorValue & getPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

const IndependentGaussianMH *const _igmh
 IndependentGaussianMH sampler.
 
std::vector< Real > & _seed_input
 Seed vector input for proposing new samples.
 
std::vector< Real > & _seed_outputs
 Outputs corresponding to the seed input vector.
 
std::vector< Real > _tpm_modified
 Modified transition vector considering the seed input.
 
std::vector< Real > _outputs_sto
 Store the gathered outputs.
 
const bool _always_store
 
UserObject * _primary_thread_copy
 
std::set< std::string > _supplied_uo
 
const ParallelParamObject & _parent
 
const MooseBase & _si_moose_base
 
const FEProblemBase * _si_problem
 
ExecFlagEnum _empty_execute_enum
 
const MooseObject & _fni_object
 
const InputParameters & _fni_params
 
FEProblemBase & _fni_feproblem
 
const THREAD_ID _fni_tid
 
const MooseObject & _uoi_moose_object
 
const FEProblemBase & _uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const MooseObject & _ppi_moose_object
 
const InputParameters & _ppi_params
 
const FEProblemBase & _ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const bool _broadcast_by_default
 
const MooseObject & _vpi_moose_object
 
const FEProblemBase & _vpi_feproblem
 
const THREAD_ID _vpi_tid
 
const InputParameters & _ri_params
 
FEProblemBase & _ri_fe_problem_base
 
const ReporterData & _ri_reporter_data
 
const MooseObject & _ri_moose_object
 
const InputParameters & _dni_params
 
FEProblemBase & _dni_feproblem
 
const MooseObject *const _dni_moose_object_ptr
 
const InputParameters & _si_params
 
FEProblemBase & _si_feproblem
 
THREAD_ID _si_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
MooseApp & _meta_data_app
 
const MooseObject *const _meta_data_object
 
const InputParameters & _sc_parameters
 
const std::string & _sc_name
 
const bool _sc_is_implicit
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 
std::unordered_map< std::string, std::unique_ptr< VariableValue > > _default_value
 
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > _dual_default_value
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _sc_coupled_vars
 
std::set< TagID > _sc_coupleable_vector_tags
 
std::set< TagID > _sc_coupleable_matrix_tags
 
const MooseObject & _mi_moose_object
 
const bool _mi_boundary_restricted
 
const std::set< SubdomainID > & _mi_block_ids
 
const std::set< BoundaryID > & _mi_boundary_ids
 
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
 
const std::string _ti_name
 
const MooseObject & _reporter_moose_object
 
const InputParameters & _reporter_params
 
const std::string & _reporter_name
 
FEProblemBase & _reporter_fe_problem
 
ReporterData & _reporter_data
 
std::vector< std::unique_ptr< UnusedWrapperBase > > _unused_values
 
MooseApp & _oi_moose_app
 
OutputWarehouse & _oi_output_warehouse
 
std::set< OutputName > _oi_outputs
 
FEProblemBase & _likelihood_feproblem
 Reference to FEProblemBase instance.
 

Detailed Description

A class for performing independent Metropolis-Hastings MCMC decision making.

Definition at line 19 of file IndependentMHDecision.h.

Constructor & Destructor Documentation

◆ IndependentMHDecision()

IndependentMHDecision::IndependentMHDecision ( const InputParameters &  parameters)

Definition at line 24 of file IndependentMHDecision.C.

26 _igmh(dynamic_cast<const IndependentGaussianMH *>(&_sampler)),
27 _seed_input(declareValue<std::vector<Real>>("seed_input")),
28 _seed_outputs(declareRestartableData<std::vector<Real>>("seed_outputs"))
29{
30 // Check whether the selected sampler is a M-H sampler or not
31 if (!_igmh)
32 paramError("sampler", "The selected sampler is not of type IndependentGaussianMH.");
33
35 _tpm_modified.assign(_props + 1, 1.0 / (_props + 1));
36}
A class for performing M-H MCMC sampling with independent Gaussian propoposals.
std::vector< Real > & _seed_input
Seed vector input for proposing new samples.
std::vector< Real > & _seed_outputs
Outputs corresponding to the seed input vector.
const IndependentGaussianMH *const _igmh
IndependentGaussianMH sampler.
std::vector< Real > _tpm_modified
Modified transition vector considering the seed input.
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
PMCMCDecision will help making sample accept/reject decisions in MCMC schemes (for e....
dof_id_type _num_confg_values
Storage for the number of experimental configuration values.
Sampler & _sampler
The MCMC sampler.
dof_id_type _props
Storage for the number of parallel proposals.
T & declareValue(const std::string &param_name, Args &&... args)
T & declareRestartableData(const std::string &data_name, Args &&... args)

Member Function Documentation

◆ computeEvidence()

void IndependentMHDecision::computeEvidence ( std::vector< Real > &  evidence,
const DenseMatrix< Real > &  input_matrix 
)
overrideprotectedvirtual

Compute the evidence (aka, betterness of the proposed sample vs the previous)

Parameters
evidenceThe evidence vector to be filled
input_matrixThe matrix of proposed inputs that are provided

Reimplemented from PMCMCDecision.

Definition at line 39 of file IndependentMHDecision.C.

41{
42 std::vector<Real> out(_num_confg_values);
43 for (unsigned int i = 0; i < evidence.size(); ++i)
44 {
45 evidence[i] = 0.0;
46 for (unsigned int j = 0; j < _priors.size(); ++j)
47 evidence[i] += (std::log(_priors[j]->pdf(input_matrix(i, j))) -
48 std::log(_priors[j]->pdf(_seed_input[j])));
49 for (unsigned int j = 0; j < _num_confg_values; ++j)
50 out[j] = (*_outputs_required)[j * _props + i];
51 for (unsigned int j = 0; j < _likelihoods.size(); ++j)
52 evidence[i] += (_likelihoods[j]->function(out) - _likelihoods[j]->function(_seed_outputs));
53 }
54}
std::vector< const LikelihoodFunctionBase * > _likelihoods
Storage for the likelihood objects to be utilized.
const std::vector< const Distribution * > _priors
Storage for the priors.
std::vector< Real > * _outputs_required
Transfer the right outputs to the file.
OStreamProxy out(std::cout)

◆ computeTransitionVector()

void IndependentMHDecision::computeTransitionVector ( std::vector< Real > &  tv,
const std::vector< Real > &  evidence 
)
overrideprotectedvirtual

Compute the transition probability vector (after the computation of evidence)

Parameters
tvThe transition probability vector to be filled
evidenceThe vector of evidences provided

Reimplemented from PMCMCDecision.

Definition at line 57 of file IndependentMHDecision.C.

59{
60 for (unsigned int i = 0; i < tv.size(); ++i)
61 tv[i] = (1.0 / tv.size()) * std::exp(std::min(evidence[i], 0.0));
62 _tpm_modified = tv;
63 _tpm_modified.push_back((1.0 - std::accumulate(tv.begin(), tv.end(), 0.0)));
64 _outputs_sto = (*_outputs_required);
65}
std::vector< Real > _outputs_sto
Store the gathered outputs.

◆ execute()

void PMCMCDecision::execute ( )
overridevirtualinherited

Implements GeneralReporter.

Definition at line 161 of file PMCMCDecision.C.

162{
164 {
166 return;
167 }
168
169 // Gather inputs and outputs from the sampler and subApps
170 DenseMatrix<Real> data_in = _sampler.getGlobalSamples();
171 if (!usingGP())
172 {
173 mooseAssert(_output_value->size() >= _sampler.getNumberOfLocalRows(),
174 "Incorrectly sized outputs.");
175 _outputs_required->assign(_output_value->begin(),
178 }
179
180 // Compute the evidence and transitimkon vectors
181 std::vector<Real> evidence(_props);
182 if (_t_step > _pmcmc->decisionStep())
183 {
184 computeEvidence(evidence, data_in);
185 computeTransitionVector(_tpm, evidence);
186 }
187 else
188 _tpm.assign(_props, 1.0);
189
190 // Accept/reject the proposed samples and assign the correct outputs
191 std::vector<Real> req_inputs(_sampler.getNumberOfCols() - _num_confg_params);
192 for (unsigned int i = 0; i < _props; ++i)
193 {
194 nextSamples(req_inputs, data_in, _tpm, i);
195 _inputs[i] = req_inputs;
196 }
197
198 // Compute the next seeds to facilitate proposals (not always required)
199 nextSeeds();
200
201 // Store data from previous step
202 _data_prev = data_in;
204 if (!usingGP())
205 _outputs_prev = (*_outputs_required);
206
207 // Track the current step
209}
virtual int decisionStep() const
Return the step after which decision making can begin.
Definition PMCMCBase.h:73
std::vector< Real > & _tpm
Transition probability matrix.
std::vector< Real > & _variance
Model variance term.
std::vector< Real > & _var_prev
Storage for previous variances.
virtual void nextSeeds()
Compute the next set of seeds to facilitate proposals.
std::vector< std::vector< Real > > & _inputs
Model input data that is uncertain.
dof_id_type _num_confg_params
Storage for the number of experimental configuration parameters.
virtual bool usingGP() const
Flag to specify if a pre-trained Gaussian process model is used.
virtual void nextSamples(std::vector< Real > &req_inputs, DenseMatrix< Real > &input_matrix, const std::vector< Real > &tv, const unsigned int &parallel_index)
Resample inputs given the transition vector (after transition vector computed)
const std::vector< Real > * _output_value
Current output values.
const PMCMCBase *const _pmcmc
MCMC sampler base.
virtual void computeTransitionVector(std::vector< Real > &tv, const std::vector< Real > &evidence)
Compute the transition probability vector (after the computation of evidence)
int & _check_step
Ensure that the MCMC algorithm proceeds in a sequential fashion.
DenseMatrix< Real > & _data_prev
Storage for previous inputs.
std::vector< Real > & _outputs_prev
Storage for previous outputs.
virtual void computeEvidence(std::vector< Real > &evidence, const DenseMatrix< Real > &input_matrix)
Compute the evidence (aka, betterness of the proposed sample vs the previous)
dof_id_type getNumberOfLocalRows() const
dof_id_type getNumberOfCols() const
DenseMatrix< Real > getGlobalSamples()
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
const Parallel::Communicator & _communicator

◆ finalize()

virtual void PMCMCDecision::finalize ( )
inlineoverridevirtualinherited

Implements GeneralReporter.

Definition at line 28 of file PMCMCDecision.h.

28{}

◆ getLikelihoodFunctionByName()

LikelihoodFunctionBase * LikelihoodInterface::getLikelihoodFunctionByName ( const UserObjectName &  name) const
protectedinherited

Lookup a LikelihoodFunction object by name and return pointer.

Definition at line 24 of file LikelihoodInterface.C.

25{
26 std::vector<LikelihoodFunctionBase *> models;
28 .query()
29 .condition<AttribName>(name)
30 .condition<AttribSystem>("LikelihoodFunctionBase")
31 .queryInto(models);
32
33 if (models.empty())
34 mooseError("Unable to find a LikelihoodFunction object with the name '" + name + "'");
35 return models[0];
36}
void mooseError(Args &&... args)
const std::string name
Definition Setup.h:21
TheWarehouse & theWarehouse() const
FEProblemBase & _likelihood_feproblem
Reference to FEProblemBase instance.
Query query()

Referenced by BayesianActiveLearner::BayesianActiveLearner(), PMCMCDecision::PMCMCDecision(), and TestLikelihood::TestLikelihood().

◆ initialize()

void PMCMCDecision::initialize ( )
overridevirtualinherited

Implements GeneralReporter.

Definition at line 87 of file PMCMCDecision.C.

88{
89 if (!isParamValid("output_value") && !usingGP())
90 paramError("output_value", "Value of the model output from the SubApp should be specified.");
91}
bool isParamValid(const std::string &name) const

◆ nextSamples()

void IndependentMHDecision::nextSamples ( std::vector< Real > &  req_inputs,
DenseMatrix< Real > &  input_matrix,
const std::vector< Real > &  tv,
const unsigned int &  parallel_index 
)
overrideprotectedvirtual

Resample inputs given the transition vector (after transition vector computed)

Parameters
req_inputsThe vector of accepted samples to be filled
input_matrixThe matrix of proposed inputs provided
tvThe vector of transition probabilities provided
parallel_indexThe current parallel proposal index provided

Reimplemented from PMCMCDecision.

Definition at line 68 of file IndependentMHDecision.C.

72{
73 const bool value = (_tpm_modified[0] == 1.0 / (_props + 1));
74 if (!value)
75 {
76 unsigned int index =
78 if (index < _props)
79 {
80 for (unsigned int k = 0; k < _sampler.getNumberOfCols() - _num_confg_params; ++k)
81 req_inputs[k] = input_matrix(index, k);
82 for (unsigned int k = 0; k < _num_confg_values; ++k)
83 (*_outputs_required)[k * _props + parallel_index] = _outputs_sto[k * _props + index];
84 }
85 else
86 {
87 req_inputs = _seed_input;
88 for (unsigned int k = 0; k < _num_confg_values; ++k)
89 (*_outputs_required)[k * _props + parallel_index] = _seed_outputs[k];
90 }
91 }
92 else
93 {
94 for (unsigned int k = 0; k < _sampler.getNumberOfCols() - _num_confg_params; ++k)
95 req_inputs[k] = input_matrix(parallel_index, k);
96 _variance[parallel_index] = _new_var_samples[parallel_index];
97 }
98}
const std::vector< Real > & _rnd_vec
Storage for the random numbers for decision making.
const std::vector< Real > & _new_var_samples
Storage for new proposed variance samples.
unsigned int weightedResample(const std::vector< Real > &weights, Real rnd)
return a resampled vector from a population given a weight vector.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ nextSeeds()

void IndependentMHDecision::nextSeeds ( )
overrideprotectedvirtual

Compute the next set of seeds to facilitate proposals.

Set to empty in base to permit flexibility for MCMC samplers

Reimplemented from PMCMCDecision.

Definition at line 101 of file IndependentMHDecision.C.

102{
104 for (unsigned int k = 0; k < _num_confg_values; ++k)
105 _seed_outputs[k] = (*_outputs_required)[(k + 1) * _props - 1];
106}

◆ usingGP()

virtual bool PMCMCDecision::usingGP ( ) const
inlineprotectedvirtualinherited

Flag to specify if a pre-trained Gaussian process model is used.

Definition at line 66 of file PMCMCDecision.h.

66{ return false; }

Referenced by PMCMCDecision::execute(), and PMCMCDecision::initialize().

◆ validParams()

InputParameters IndependentMHDecision::validParams ( )
static

Definition at line 15 of file IndependentMHDecision.C.

16{
18 params.addClassDescription("Perform decision making for independent Metropolis-Hastings MCMC.");
19 params.addParam<ReporterValueName>(
20 "seed_input", "seed_input", "The seed vector input for proposing new samples.");
21 return params;
22}
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _check_step

int& PMCMCDecision::_check_step
protectedinherited

Ensure that the MCMC algorithm proceeds in a sequential fashion.

Definition at line 126 of file PMCMCDecision.h.

Referenced by PMCMCDecision::execute().

◆ _data_prev

DenseMatrix<Real>& PMCMCDecision::_data_prev
protectedinherited

Storage for previous inputs.

Definition at line 114 of file PMCMCDecision.h.

Referenced by PMCMCDecision::computeEvidence(), PMCMCDecision::execute(), and PMCMCDecision::nextSamples().

◆ _igmh

const IndependentGaussianMH* const IndependentMHDecision::_igmh
private

IndependentGaussianMH sampler.

Definition at line 42 of file IndependentMHDecision.h.

Referenced by IndependentMHDecision().

◆ _inputs

std::vector<std::vector<Real> >& PMCMCDecision::_inputs
protectedinherited

Model input data that is uncertain.

Definition at line 69 of file PMCMCDecision.h.

Referenced by PMCMCDecision::execute(), nextSeeds(), and PMCMCDecision::PMCMCDecision().

◆ _likelihood_feproblem

FEProblemBase& LikelihoodInterface::_likelihood_feproblem
privateinherited

Reference to FEProblemBase instance.

Definition at line 29 of file LikelihoodInterface.h.

Referenced by LikelihoodInterface::getLikelihoodFunctionByName().

◆ _likelihoods

std::vector<const LikelihoodFunctionBase *> PMCMCDecision::_likelihoods
protectedinherited

Storage for the likelihood objects to be utilized.

Definition at line 81 of file PMCMCDecision.h.

Referenced by PMCMCDecision::computeEvidence(), computeEvidence(), and PMCMCDecision::PMCMCDecision().

◆ _new_var_samples

const std::vector<Real>& PMCMCDecision::_new_var_samples
protectedinherited

Storage for new proposed variance samples.

Definition at line 96 of file PMCMCDecision.h.

Referenced by PMCMCDecision::computeEvidence(), PMCMCDecision::nextSamples(), and nextSamples().

◆ _noise

Real& PMCMCDecision::_noise
protectedinherited

Model noise term to pass to Likelihoods object.

Definition at line 78 of file PMCMCDecision.h.

Referenced by PMCMCDecision::computeEvidence().

◆ _num_confg_params

dof_id_type PMCMCDecision::_num_confg_params
protectedinherited

Storage for the number of experimental configuration parameters.

Definition at line 111 of file PMCMCDecision.h.

Referenced by PMCMCDecision::execute(), PMCMCDecision::nextSamples(), nextSamples(), and PMCMCDecision::PMCMCDecision().

◆ _num_confg_values

dof_id_type PMCMCDecision::_num_confg_values
protectedinherited

Storage for the number of experimental configuration values.

Definition at line 108 of file PMCMCDecision.h.

Referenced by PMCMCDecision::computeEvidence(), computeEvidence(), IndependentMHDecision(), PMCMCDecision::nextSamples(), nextSamples(), nextSeeds(), and PMCMCDecision::PMCMCDecision().

◆ _output_value

const std::vector<Real>* PMCMCDecision::_output_value
protectedinherited

Current output values.

Definition at line 123 of file PMCMCDecision.h.

Referenced by PMCMCDecision::execute().

◆ _outputs_prev

std::vector<Real>& PMCMCDecision::_outputs_prev
protectedinherited

Storage for previous outputs.

Definition at line 120 of file PMCMCDecision.h.

Referenced by PMCMCDecision::computeEvidence(), PMCMCDecision::execute(), and PMCMCDecision::nextSamples().

◆ _outputs_required

std::vector<Real>* PMCMCDecision::_outputs_required
protectedinherited

◆ _outputs_sto

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

Store the gathered outputs.

Definition at line 54 of file IndependentMHDecision.h.

Referenced by computeTransitionVector(), and nextSamples().

◆ _pmcmc

const PMCMCBase* const PMCMCDecision::_pmcmc
protectedinherited

MCMC sampler base.

Definition at line 87 of file PMCMCDecision.h.

Referenced by PMCMCDecision::execute(), and PMCMCDecision::PMCMCDecision().

◆ _priors

const std::vector<const Distribution *> PMCMCDecision::_priors
protectedinherited

◆ _props

dof_id_type PMCMCDecision::_props
protectedinherited

◆ _rnd_vec

const std::vector<Real>& PMCMCDecision::_rnd_vec
protectedinherited

Storage for the random numbers for decision making.

Definition at line 93 of file PMCMCDecision.h.

Referenced by PMCMCDecision::nextSamples(), and nextSamples().

◆ _sampler

Sampler& PMCMCDecision::_sampler
protectedinherited

The MCMC sampler.

Definition at line 84 of file PMCMCDecision.h.

Referenced by PMCMCDecision::execute(), PMCMCDecision::nextSamples(), nextSamples(), and PMCMCDecision::PMCMCDecision().

◆ _seed_input

std::vector<Real>& IndependentMHDecision::_seed_input
private

Seed vector input for proposing new samples.

Definition at line 45 of file IndependentMHDecision.h.

Referenced by computeEvidence(), nextSamples(), and nextSeeds().

◆ _seed_outputs

std::vector<Real>& IndependentMHDecision::_seed_outputs
private

Outputs corresponding to the seed input vector.

Definition at line 48 of file IndependentMHDecision.h.

Referenced by computeEvidence(), IndependentMHDecision(), nextSamples(), and nextSeeds().

◆ _tpm

std::vector<Real>& PMCMCDecision::_tpm
protectedinherited

Transition probability matrix.

Definition at line 72 of file PMCMCDecision.h.

Referenced by PMCMCDecision::execute(), and PMCMCDecision::PMCMCDecision().

◆ _tpm_modified

std::vector<Real> IndependentMHDecision::_tpm_modified
private

Modified transition vector considering the seed input.

Definition at line 51 of file IndependentMHDecision.h.

Referenced by computeTransitionVector(), IndependentMHDecision(), and nextSamples().

◆ _var_prev

std::vector<Real>& PMCMCDecision::_var_prev
protectedinherited

Storage for previous variances.

Definition at line 117 of file PMCMCDecision.h.

Referenced by PMCMCDecision::computeEvidence(), PMCMCDecision::execute(), and PMCMCDecision::nextSamples().

◆ _var_prior

const Distribution* PMCMCDecision::_var_prior
protectedinherited

Storage for the prior over the variance.

Definition at line 102 of file PMCMCDecision.h.

Referenced by PMCMCDecision::computeEvidence(), and PMCMCDecision::nextSamples().

◆ _variance

std::vector<Real>& PMCMCDecision::_variance
protectedinherited

Model variance term.

Definition at line 75 of file PMCMCDecision.h.

Referenced by PMCMCDecision::execute(), PMCMCDecision::nextSamples(), nextSamples(), and PMCMCDecision::PMCMCDecision().


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