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
MappingReporter Class Reference

A tool to reduce solution fields to coordinates in the latent space. More...

#include <MappingReporter.h>

Inheritance diagram for MappingReporter:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 MappingReporter (const InputParameters &parameters)
 
void initialSetup () override
 
virtual void execute () override
 
virtual void finalize () override
 
virtual void initialize () override final
 
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 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
 
VariableMappingBase & getMapping (const std::string &name) const
 Get the mapping using the parameters of the moose object.
 
VariableMappingBase & getMappingByName (const UserObjectName &name) const
 Get the mapping by supplying the name of the object in the warehouse.
 

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

void mapParallelStorageData ()
 Map the available data in a parallel storage into the latent space.
 
void mapVariableData ()
 Map the available data in variables into the latent space.
 
virtual ReporterName declareStochasticReporterClone (const Sampler &sampler, const ReporterData &from_data, const ReporterName &from_reporter, std::string prefix="")
 
template<typename T >
std::vector< T > & declareStochasticReporter (std::string value_name, const Sampler &sampler)
 
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)
 

Static Protected Member Functions

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

Protected Attributes

const ParallelSolutionStorage *const _parallel_storage
 If we already have solution fields stored from previous runs, we can use their ParallelStorageObject to obtain the corresponding coefficients.
 
Sampler *const _sampler
 We only need the sampler to check which coefficients would go to which processor in case a ParallelSolutionStorage is used.
 
const UserObjectName & _mapping_name
 The name of the mapping object we would like to use.
 
VariableMappingBase * _mapping
 Link to the mapping object, we need this to be a pointer due to the fact that we can only fetch this in initialSetup.
 
const std::vector< VariableName > & _variable_names
 The variables we would like to map.
 
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
 
std::vector< std::vector< std::vector< Real > > * > _vector_real_values_parallel_storage
 
std::vector< std::vector< Real > * > _vector_real_values
 

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 unsigned int _parallel_type
 
std::deque< std::unique_ptr< StochasticReporterValueBase > > _vectors
 Container for declared values that we may need to resize at initialize.
 
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
 
const InputParameters & _smi_params
 Parameters of the object with this interface.
 
FEProblemBase & _smi_feproblem
 Reference to FEProblemBase instance.
 

Detailed Description

A tool to reduce solution fields to coordinates in the latent space.

Definition at line 21 of file MappingReporter.h.

Constructor & Destructor Documentation

◆ MappingReporter()

MappingReporter::MappingReporter ( const InputParameters &  parameters)

Definition at line 43 of file MappingReporter.C.

45 MappingInterface(this),
46 _parallel_storage(isParamValid("parallel_storage")
47 ? &getUserObject<ParallelSolutionStorage>("parallel_storage")
48 : nullptr),
49 _sampler(isParamValid("sampler") ? &getSampler("sampler") : nullptr),
50 _mapping_name(getParam<UserObjectName>("mapping")),
51 _variable_names(getParam<std::vector<VariableName>>("variables"))
52{
54 {
55 if (_sampler)
56 {
57 // Declaring the reporters for every variable. This is a collection of vectors which describe
58 // the coordinates of the solution fields in the latent space.
60 for (auto var_i : index_range(_variable_names))
61 {
62 _vector_real_values_parallel_storage[var_i] = &declareStochasticReporter<std::vector<Real>>(
63 _variable_names[var_i] + "_" + _mapping_name, *_sampler);
64 }
65 }
66 else
67 paramError("sampler",
68 "We need a sampler object if the parallel storage is supplied! The sampler object "
69 "shall be the same as the one used to generate the solution fields in the "
70 "parallel storage object.");
71 }
72 else
73 {
74 // Declaring the reporters for every variable. This is a collection of vectors which describe
75 // the coordinates of the solution fields in the latent space.
77 for (auto var_i : index_range(_variable_names))
80 }
81}
const ReporterMode REPORTER_MODE_ROOT
An interface class that helps getting access to Mapping objects.
std::vector< std::vector< std::vector< Real > > * > _vector_real_values_parallel_storage
std::vector< std::vector< Real > * > _vector_real_values
const ParallelSolutionStorage *const _parallel_storage
If we already have solution fields stored from previous runs, we can use their ParallelStorageObject ...
Sampler *const _sampler
We only need the sampler to check which coefficients would go to which processor in case a ParallelSo...
const UserObjectName & _mapping_name
The name of the mapping object we would like to use.
const std::vector< VariableName > & _variable_names
The variables we would like to map.
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
T & declareValueByName(const ReporterValueName &value_name, Args &&... args)
T & getSampler(const std::string &name)
auto index_range(const T &sizable)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ declareStochasticReporter()

template<typename T >
std::vector< T > & StochasticReporter::declareStochasticReporter ( std::string  value_name,
const Sampler &  sampler 
)
protectedinherited

Definition at line 164 of file StochasticReporter.h.

165{
166 const ReporterMode mode =
168 std::vector<T> & vector =
169 this->template declareValueByName<std::vector<T>, StochasticReporterContext<T>>(
170 value_name, mode, sampler);
171
172 _vectors.push_back(std::make_unique<StochasticReporterValue<T>>(vector, sampler));
173 return vector;
174}
const ReporterMode REPORTER_MODE_DISTRIBUTED
std::deque< std::unique_ptr< StochasticReporterValueBase > > _vectors
Container for declared values that we may need to resize at initialize.
const unsigned int _parallel_type

Referenced by StochasticReporter::declareStochasticReporterClone(), and SamplerReporterTransfer::intitializeStochasticReporters().

◆ declareStochasticReporterClone()

ReporterName StochasticReporter::declareStochasticReporterClone ( const Sampler &  sampler,
const ReporterData &  from_data,
const ReporterName &  from_reporter,
std::string  prefix = "" 
)
protectedvirtualinherited

Reimplemented in ActiveLearningReporterTempl< T >, ActiveLearningReporterTempl< Real >, and StochasticMatrix.

Definition at line 47 of file StochasticReporter.C.

51{
52 std::string value_name = (prefix.empty() ? "" : prefix + ":") + from_reporter.getObjectName() +
53 ":" + from_reporter.getValueName();
54
55 if (!from_data.hasReporterValue(from_reporter))
56 mooseError("Reporter value ", from_reporter, " has not been declared.");
57
58 // Single quantities
59 if (from_data.hasReporterValue<bool>(from_reporter))
60 declareStochasticReporter<bool>(value_name, sampler);
61 else if (from_data.hasReporterValue<int>(from_reporter))
62 declareStochasticReporter<int>(value_name, sampler);
63 else if (from_data.hasReporterValue<Real>(from_reporter))
64 declareStochasticReporter<Real>(value_name, sampler);
65 else if (from_data.hasReporterValue<std::string>(from_reporter))
66 declareStochasticReporter<std::string>(value_name, sampler);
67 // Vector quantities
68 else if (from_data.hasReporterValue<std::vector<bool>>(from_reporter))
69 declareStochasticReporter<std::vector<bool>>(value_name, sampler);
70 else if (from_data.hasReporterValue<std::vector<int>>(from_reporter))
71 declareStochasticReporter<std::vector<int>>(value_name, sampler);
72 else if (from_data.hasReporterValue<std::vector<Real>>(from_reporter))
73 declareStochasticReporter<std::vector<Real>>(value_name, sampler);
74 else if (from_data.hasReporterValue<std::vector<std::string>>(from_reporter))
75 declareStochasticReporter<std::vector<std::string>>(value_name, sampler);
76 // Vector of vector quantities
77 else if (from_data.hasReporterValue<std::vector<std::vector<bool>>>(from_reporter))
78 declareStochasticReporter<std::vector<std::vector<bool>>>(value_name, sampler);
79 else if (from_data.hasReporterValue<std::vector<std::vector<int>>>(from_reporter))
80 declareStochasticReporter<std::vector<std::vector<int>>>(value_name, sampler);
81 else if (from_data.hasReporterValue<std::vector<std::vector<Real>>>(from_reporter))
82 declareStochasticReporter<std::vector<std::vector<Real>>>(value_name, sampler);
83 else if (from_data.hasReporterValue<std::vector<std::vector<std::string>>>(from_reporter))
84 declareStochasticReporter<std::vector<std::vector<std::string>>>(value_name, sampler);
85 else
86 return {}; // Empty ReporterName to show that reporter value is unsupported type
87
88 return {name(), value_name};
89}
const std::string & name() const
void mooseError(Args &&... args) const
bool hasReporterValue(const ReporterName &reporter_name) const
const std::string & getObjectName() const
const std::string & getValueName() const
std::vector< T > & declareStochasticReporter(std::string value_name, const Sampler &sampler)

Referenced by StochasticMatrix::declareStochasticReporterClone(), and SamplerReporterTransfer::intitializeStochasticReporters().

◆ execute()

void MappingReporter::execute ( )
overridevirtual

Reimplemented from StochasticReporter.

Definition at line 90 of file MappingReporter.C.

91{
92 // We have two execution modes. If the parallel storage is supplied we loop over the snapshots in
93 // the parallel storage, and project them to obtain their coefficients.
96 // The alternative option is to just fetch the variables and reduce them
97 else
99}
void mapVariableData()
Map the available data in variables into the latent space.
void mapParallelStorageData()
Map the available data in a parallel storage into the latent space.

◆ finalize()

virtual void MappingReporter::finalize ( )
inlineoverridevirtual

Reimplemented from StochasticReporter.

Definition at line 29 of file MappingReporter.h.

29{}

◆ getMapping()

VariableMappingBase & MappingInterface::getMapping ( const std::string &  name) const
inherited

Get the mapping using the parameters of the moose object.

Parameters
nameThe parameter name

Definition at line 40 of file MappingInterface.C.

41{
42 return getMappingByName(_smi_params.get<UserObjectName>(name));
43}
const std::string name
Definition Setup.h:21
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
VariableMappingBase & getMappingByName(const UserObjectName &name) const
Get the mapping by supplying the name of the object in the warehouse.
const InputParameters & _smi_params
Parameters of the object with this interface.

Referenced by SingularTripletReporter::initialSetup(), and InverseMapping::initialSetup().

◆ getMappingByName()

VariableMappingBase & MappingInterface::getMappingByName ( const UserObjectName &  name) const
inherited

Get the mapping by supplying the name of the object in the warehouse.

Parameters
nameThe name of the mapping object

Definition at line 26 of file MappingInterface.C.

27{
28 std::vector<VariableMappingBase *> models;
30 .query()
31 .condition<AttribName>(name)
32 .condition<AttribSystem>("VariableMappingBase")
33 .queryInto(models);
34 if (models.empty())
35 mooseError("Unable to find a Mapping object with the name '" + name + "'");
36 return *(models[0]);
37}
void mooseError(Args &&... args)
TheWarehouse & theWarehouse() const
FEProblemBase & _smi_feproblem
Reference to FEProblemBase instance.
Query query()

Referenced by MappingInterface::getMapping(), initialSetup(), and MappingOutput::output().

◆ initialize()

void StochasticReporter::initialize ( )
finaloverridevirtualinherited

Implements GeneralReporter.

Definition at line 40 of file StochasticReporter.C.

41{
42 for (auto & vector : _vectors)
43 vector->initialize();
44}
virtual void initialize() override final

Referenced by SamplerReporterTransfer::initializeFromMultiapp().

◆ initialSetup()

void MappingReporter::initialSetup ( )
overridevirtual

Reimplemented from GeneralReporter.

Definition at line 84 of file MappingReporter.C.

85{
87}
VariableMappingBase * _mapping
Link to the mapping object, we need this to be a pointer due to the fact that we can only fetch this ...

◆ mapParallelStorageData()

void MappingReporter::mapParallelStorageData ( )
protected

Map the available data in a parallel storage into the latent space.

Definition at line 102 of file MappingReporter.C.

103{
104 // If the mapping is not built yet, we shall build it using the solutions in the parallel
105 // storage. The conditional process is decided in the mapping object.
106 for (const auto & var : _variable_names)
107 _mapping->buildMapping(var);
108
109 // Since the solution fields can be distributed among the processes of each sub-application
110 // (unlike samples and reporter values which are just on the root process), we need to use the
111 // information in the sampler to check which solution is where.
112 const auto rank_config = _sampler->getRankConfig(true);
113
114 // We need to do some parallel communication in case we have snapshots on processes other than
115 // the roots of the sub-applications. This will collect the vectors that we need to send in the
116 // following format:
117 // <to which processor, (variable index, global sample index, solution field)>
118 std::unordered_map<processor_id_type,
119 std::vector<std::tuple<unsigned int, unsigned int, std::vector<Real>>>>
120 send_map;
121
122 // We need to use the rank config here to ensure we are looping on the non-root processors
123 // too
124 for (const auto sample_i : make_range(rank_config.num_local_sims))
125 {
126 // Converting the local indexing to global sample indices
127 const unsigned int global_i = sample_i + _sampler->getLocalRowBegin();
128
129 for (const auto var_i : index_range(_variable_names))
130 {
131 // Create a temporary storage for the coordinates in the latent space
132 std::vector<Real> local_vector;
133
134 // Check if the current process has this global sample
136 {
137 // Fetch the solution vector for the given sample index and variable
138 const auto & full_vector =
140
141 // At the moment we only support simulations which have only one solution field
142 // per sample. This is typically a steady-state simulation.
143 if (full_vector.size() != 1)
144 mooseError("MappingReporter is only supported for simulations with one solution "
145 "field per run!");
146
147 // We use the mapping object to generate the coordinates in the latent space
148 _mapping->map(_variable_names[var_i], global_i, local_vector);
149
150 // If we are on the root processor of the sub-application, we simply insert the result
151 // into the reporter storage space. Othervise we will send it to the root process.
152 if (rank_config.is_first_local_rank)
153 (*_vector_real_values_parallel_storage[var_i])[sample_i] = local_vector;
154 else
155 send_map[rank_config.my_first_rank].emplace_back(
156 var_i, sample_i, std::move(local_vector));
157 }
158 }
159 }
160
161 // This functor describes what we do when we receive the samples from other processes
162 auto receive_functor =
163 [this](processor_id_type /*pid*/,
164 const std::vector<std::tuple<unsigned int, unsigned int, std::vector<Real>>> & vectors)
165 {
166 // We unpack the tuples and insert the values into the reporter
167 for (const auto & [var_i, sample_i, vector] : vectors)
168 (*_vector_real_values_parallel_storage[var_i])[sample_i] = std::move(vector);
169 };
170
171 // We send the results from the non-root processors to the root processors
172 Parallel::push_parallel_packed_range(_communicator, send_map, (void *)nullptr, receive_functor);
173}
bool hasGlobalSample(unsigned int global_sample_i, const VariableName &variable) const
Determine if we have the solution vector with a given global sample index for a given variable.
const std::vector< DenseVector< Real > > & getGlobalSample(unsigned int global_sample_i, const VariableName &variable) const
Get the serialized solution field which is associated with a given global sample index and variable.
dof_id_type getLocalRowBegin() const
const LocalRankConfig & getRankConfig(bool batch_mode) const
virtual void map(const VariableName &vname, const DenseVector< Real > &full_order_vector, std::vector< Real > &reduced_order_vector) const =0
Map a full-order solution vector (in DenseVector format) for a given variable into a reduced-order ve...
const Parallel::Communicator & _communicator
uint8_t processor_id_type
IntRange< T > make_range(T beg, T end)

Referenced by execute().

◆ mapVariableData()

void MappingReporter::mapVariableData ( )
protected

Map the available data in variables into the latent space.

Definition at line 176 of file MappingReporter.C.

177{
179
180 for (unsigned int var_i = 0; var_i < _variable_names.size(); ++var_i)
181 {
182 // Getting the corresponding DoF indices for the variable.
184
185 // We need to serialize the solution on the root process first.
186 DenseVector<Real> serialized_solution;
187 nl.solution().localize(serialized_solution.get_values(),
189 : std::vector<dof_id_type>());
190 // We map the solution into the latent space and save the solutions in one go
191 if (processor_id() == 0)
192 _mapping->map(_variable_names[var_i], serialized_solution, *_vector_real_values[var_i]);
193 }
194}
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
const std::vector< dof_id_type > & getVariableGlobalDoFs()
void setVariableGlobalDoFs(const std::string &var_name)
NumericVector< Number > & solution()
FEProblemBase & _fe_problem
virtual void localize(std::vector< T > &v_local) const=0
processor_id_type processor_id() const
uint8_t dof_id_type

Referenced by execute().

◆ validParams()

InputParameters MappingReporter::validParams ( )
static

Definition at line 21 of file MappingReporter.C.

22{
27 "A reporter which can map full solution fields to a latent space for given variables.");
28 params.addRequiredParam<UserObjectName>("mapping", "Name of the mapping object.");
29 params.addRequiredParam<std::vector<VariableName>>(
30 "variables", "The names of the variables which need to be mapped to the latent space.");
31 params.addParam<std::string>("parallel_storage",
32 "The storage space where the snapshots are stored. These snapshots "
33 "are used to build the mapping. If this parameter is not specified, "
34 "the reporter will fetch the variable from the nonlinear system.");
35 params.addParam<SamplerName>(
36 "sampler",
37 "Sampler be able to identify how the samples are distributed among "
38 "the processes. Only needed if parallel storage is defined. It is important to have the "
39 "same sampler here as the one used to prepare the snapshots in the parallel storage.");
40 return params;
41}
void addRequiredParam(const std::string &name, const std::string &doc_string)
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()
static InputParameters validParams()
static InputParameters validParams()

Member Data Documentation

◆ _mapping

VariableMappingBase* MappingReporter::_mapping
protected

Link to the mapping object, we need this to be a pointer due to the fact that we can only fetch this in initialSetup.

Definition at line 49 of file MappingReporter.h.

Referenced by initialSetup(), mapParallelStorageData(), and mapVariableData().

◆ _mapping_name

const UserObjectName& MappingReporter::_mapping_name
protected

The name of the mapping object we would like to use.

Definition at line 47 of file MappingReporter.h.

Referenced by initialSetup(), and MappingReporter().

◆ _parallel_storage

const ParallelSolutionStorage* const MappingReporter::_parallel_storage
protected

If we already have solution fields stored from previous runs, we can use their ParallelStorageObject to obtain the corresponding coefficients.

Definition at line 40 of file MappingReporter.h.

Referenced by execute(), mapParallelStorageData(), and MappingReporter().

◆ _parallel_type

const unsigned int StochasticReporter::_parallel_type
privateinherited

Definition at line 157 of file StochasticReporter.h.

Referenced by StochasticReporter::declareStochasticReporter().

◆ _sampler

Sampler* const MappingReporter::_sampler
protected

We only need the sampler to check which coefficients would go to which processor in case a ParallelSolutionStorage is used.

Definition at line 44 of file MappingReporter.h.

Referenced by mapParallelStorageData(), and MappingReporter().

◆ _smi_feproblem

FEProblemBase& MappingInterface::_smi_feproblem
privateinherited

Reference to FEProblemBase instance.

Definition at line 44 of file MappingInterface.h.

Referenced by MappingInterface::getMappingByName().

◆ _smi_params

const InputParameters& MappingInterface::_smi_params
privateinherited

Parameters of the object with this interface.

Definition at line 41 of file MappingInterface.h.

Referenced by MappingInterface::getMapping().

◆ _variable_names

const std::vector<VariableName>& MappingReporter::_variable_names
protected

The variables we would like to map.

Definition at line 52 of file MappingReporter.h.

Referenced by mapParallelStorageData(), MappingReporter(), and mapVariableData().

◆ _vector_real_values

std::vector<std::vector<Real> *> MappingReporter::_vector_real_values
protected

Definition at line 57 of file MappingReporter.h.

Referenced by MappingReporter(), and mapVariableData().

◆ _vector_real_values_parallel_storage

std::vector<std::vector<std::vector<Real> > *> MappingReporter::_vector_real_values_parallel_storage
protected

Links to the storage spaces (reporters) where we collect the coefficients

Definition at line 56 of file MappingReporter.h.

Referenced by mapParallelStorageData(), and MappingReporter().

◆ _vectors

std::deque<std::unique_ptr<StochasticReporterValueBase> > StochasticReporter::_vectors
privateinherited

Container for declared values that we may need to resize at initialize.

Definition at line 159 of file StochasticReporter.h.

Referenced by StochasticReporter::declareStochasticReporter(), and StochasticReporter::initialize().


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