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

#include <PODReducedBasisTrainer.h>

Inheritance diagram for PODReducedBasisTrainer:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 PODReducedBasisTrainer (const InputParameters &parameters)
 
virtual void initialSetup () override
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
void initReducedOperators ()
 Initializing the reduced operators.
 
void addSnapshot (unsigned int var_i, unsigned int glob_i, const std::shared_ptr< DenseVector< Real > > &snapshot)
 Adding a snapshot for a variable.
 
void addToReducedOperator (unsigned int base_i, unsigned int tag_i, std::vector< DenseVector< Real > > &residual)
 Adding the contribution of a residual to the reduced operators.
 
const std::vector< std::string > & getVarNames () const
 
const std::vector< std::string > & getTagNames () const
 
const std::vector< std::string > & getTagTypes () const
 
unsigned int getSnapsSize (unsigned int var_i) const
 Getting the snapshot size across all of the processors for a given variable with index var_i.
 
unsigned int getBaseSize (unsigned int var_i) const
 Getting the base size for variable with index v_ind.
 
unsigned int getSumBaseSize () const
 Getting the overall base size, which is the sum of the individual bases.
 
const DenseVector< Real > & getBasisVector (unsigned int var_i, unsigned int base_i) const
 Getting a basis vector for a given variable.
 
const DenseVector< Real > & getBasisVector (unsigned int glob_i) const
 Getting basis vector based on its global index.
 
unsigned int getVariableIndex (unsigned int glob_i) const
 Getting appropriate variable index for a global base index.
 
virtual void threadJoin (const UserObject &) 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 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
 
const std::string & modelMetaDataName () const
 Accessor for the name of the model meta data.
 
const FileName & getModelDataFileName () const
 Get the associated filename.
 
bool hasModelData () const
 Check if we need to load model data (if the filename parameter is used)
 
bool hasExplicitModelData () const
 Check if the filename parameter is explicitly set (ignoring recover state)
 
template<typename T , typename... Args>
T & declareModelData (const std::string &data_name, Args &&... args)
 Declare model data for loading from file as well as restart.
 
template<typename T , typename... Args>
const T & getModelData (const std::string &data_name, Args &&... args) const
 Retrieve model data from the interface.
 

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 computeCorrelationMatrix ()
 Computes the correlation matrices using the snapshots.
 
void computeEigenDecomposition ()
 Computes the eigen-decomposition of the stored correlation matrices.
 
void computeBasisVectors ()
 Generates the basis vectors using the snapshots together with the eigen-decomposition of the correlation matrices.
 
void printEigenvalues ()
 Prints the eigenvalues of the correlation matrix for each variable.
 
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 ()
 
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)
 

Static Protected Member Functions

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

Protected Attributes

std::vector< std::string > & _var_names
 Vector containing the names of the variables we want to use for constructing the surrogates.
 
std::vector< Real > _error_res
 Energy limits that define how many basis functions will be kept for each variable.
 
std::vector< std::string > & _tag_names
 Names of the tags that should be used to fetch residuals from the MultiApp.
 
std::vector< std::string > & _tag_types
 list of bools describing which tag is indepedent of the solution.
 
std::vector< DistributedSnapshots > _snapshots
 Distributed container for snapshots per variable.
 
std::vector< DenseMatrix< Real > > _corr_mx
 The correlation matrices for the variables.
 
std::vector< DenseVector< Real > > _eigenvalues
 The eigenvalues of the correalation matrix for each variable.
 
std::vector< DenseMatrix< Real > > _eigenvectors
 The eigenvectors of the correalation matrix for each variable.
 
std::vector< std::vector< DenseVector< Real > > > & _base
 The reduced basis for the variables.
 
std::vector< DenseMatrix< Real > > & _red_operators
 The reduced operators that should be transferred to the surrogate.
 
bool _base_completed
 Switch that tells if the object has already computed the necessary basis vectors.
 
bool _empty_operators
 Flag describing if the reduced operators are empty or not.
 
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

unsigned int determineNumberOfModes (Real error, const std::vector< Real > &inp_vec) const
 Computes the number of bases necessary for a given error indicator.
 
void receiveObjects (ReplicatedMesh &mesh, std::unordered_map< unsigned int, std::vector< std::shared_ptr< DenseVector< Real > > > > &received_vectors, std::unordered_map< unsigned int, std::vector< std::shared_ptr< DenseVector< Real > > > > &local_vectors, processor_id_type, const std::vector< std::tuple< unsigned int, unsigned int, std::shared_ptr< DenseVector< Real > > > > &vectors)
 Function that manipulates the received objects and computes the correlation matrices on the fly.
 
bool suppressInfo () const
 
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 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

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 & _model_object
 Reference to the MooseObject that uses this interface.
 
const std::string _model_meta_data_name
 The model meta data name.
 
PublicRestartable _model_restartable
 Member for interfacing with the framework's restartable system.
 

Detailed Description

Definition at line 27 of file PODReducedBasisTrainer.h.

Constructor & Destructor Documentation

◆ PODReducedBasisTrainer()

PODReducedBasisTrainer::PODReducedBasisTrainer ( const InputParameters &  parameters)

Definition at line 44 of file PODReducedBasisTrainer.C.

46 _var_names(declareModelData<std::vector<std::string>>(
47 "_var_names", getParam<std::vector<std::string>>("var_names"))),
48 _error_res(getParam<std::vector<Real>>("error_res")),
49 _tag_names(declareModelData<std::vector<std::string>>(
50 "_tag_names", getParam<std::vector<std::string>>("tag_names"))),
51 _tag_types(declareModelData<std::vector<std::string>>(
52 "_tag_types", getParam<std::vector<std::string>>("tag_types"))),
53 _base(declareModelData<std::vector<std::vector<DenseVector<Real>>>>("_base")),
54 _red_operators(declareModelData<std::vector<DenseMatrix<Real>>>("_red_operators")),
55 _base_completed(false),
57{
58 if (_error_res.size() != _var_names.size())
59 paramError("error_res",
60 "The number of elements is not equal to the number"
61 " of elements in 'var_names'!");
62
63 if (_tag_names.size() != _tag_types.size())
64 paramError("tag_types",
65 "The number of elements is not equal to the number"
66 " of elements in 'tag_names'!");
67
68 std::vector<std::string> available_names{"op", "src", "op_dir", "src_dir"};
69 for (auto tag_type : _tag_types)
70 {
71 auto it = std::find(available_names.begin(), available_names.end(), tag_type);
72 if (it == available_names.end())
73 paramError("tag_types",
74 "Tag type '",
75 tag_type,
76 "' is not valid, available names are:",
77 " op, op_dir, src, src_dir");
78 }
79}
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
const T & getParam(const std::string &name) const
std::vector< std::string > & _tag_names
Names of the tags that should be used to fetch residuals from the MultiApp.
bool _empty_operators
Flag describing if the reduced operators are empty or not.
bool _base_completed
Switch that tells if the object has already computed the necessary basis vectors.
std::vector< std::string > & _tag_types
list of bools describing which tag is indepedent of the solution.
std::vector< std::vector< DenseVector< Real > > > & _base
The reduced basis for the variables.
std::vector< std::string > & _var_names
Vector containing the names of the variables we want to use for constructing the surrogates.
std::vector< Real > _error_res
Energy limits that define how many basis functions will be kept for each variable.
std::vector< DenseMatrix< Real > > & _red_operators
The reduced operators that should be transferred to the surrogate.
T & declareModelData(const std::string &data_name, Args &&... args)
Declare model data for loading from file as well as restart.
This is the base trainer class whose main functionality is the API for declaring model data.

Member Function Documentation

◆ addSnapshot()

void PODReducedBasisTrainer::addSnapshot ( unsigned int  var_i,
unsigned int  glob_i,
const std::shared_ptr< DenseVector< Real > > &  snapshot 
)

Adding a snapshot for a variable.

Definition at line 138 of file PODReducedBasisTrainer.C.

141{
142 _snapshots[var_i].addNewEntry(glob_i, snapshot);
143}
std::vector< DistributedSnapshots > _snapshots
Distributed container for snapshots per variable.

Referenced by PODSamplerSolutionTransfer::execute(), and PODSamplerSolutionTransfer::executeFromMultiapp().

◆ addToReducedOperator()

void PODReducedBasisTrainer::addToReducedOperator ( unsigned int  base_i,
unsigned int  tag_i,
std::vector< DenseVector< Real > > &  residual 
)

Adding the contribution of a residual to the reduced operators.

Definition at line 504 of file PODReducedBasisTrainer.C.

507{
508 // Computing the elements of the reduced operator using Galerkin projection
509 // on the residual. This is done in parallel and the local contributions are
510 // gathered in finalize().
511 unsigned int counter = 0;
512 for (unsigned int var_i = 0; var_i < _var_names.size(); ++var_i)
513 {
514 for (unsigned int base_j = 0; base_j < _base[var_i].size(); ++base_j)
515 {
516 _red_operators[tag_i](counter, base_i) = residual[var_i].dot(_base[var_i][base_j]);
517 counter++;
518 }
519 }
520
521 _empty_operators = false;
522}

Referenced by PODResidualTransfer::transferResidual().

◆ computeBasisVectors()

void PODReducedBasisTrainer::computeBasisVectors ( )
protected

Generates the basis vectors using the snapshots together with the eigen-decomposition of the correlation matrices.

Definition at line 447 of file PODReducedBasisTrainer.C.

448{
449 // Looping over all the variables.
450 for (unsigned int var_i = 0; var_i < _eigenvectors.size(); ++var_i)
451 {
452 unsigned int no_bases = _eigenvalues[var_i].size();
453 unsigned int no_snaps = _snapshots[var_i].getNumberOfLocalEntries();
454
455 _base[var_i].resize(no_bases);
456
457 // Filling the containers using the local snapshots and the eigenvalues and
458 // eigenvectors of the correlation matrices.
459 for (unsigned int base_i = 0; base_i < no_bases; ++base_i)
460 {
461 _base[var_i][base_i].resize(_snapshots[var_i].getLocalEntry(0)->size());
462
463 for (unsigned int loc_i = 0; loc_i < no_snaps; ++loc_i)
464 {
465 unsigned int glob_i = _snapshots[var_i].getGlobalIndex(loc_i);
466 const DenseVector<Real> & snapshot = *_snapshots[var_i].getLocalEntry(loc_i);
467
468 for (unsigned int i = 0; i < _base[var_i][base_i].size(); ++i)
469 {
470 _base[var_i][base_i](i) += _eigenvectors[var_i](glob_i, base_i) * snapshot(i);
471 }
472 }
473
474 // Gathering and summing the local contributions over all of the processes.
475 // This makes sure that every process sees all of the basis functions.
476 gatherSum(_base[var_i][base_i].get_values());
477
478 // Normalizing the basis functions to make sure they are orthonormal.
479 _base[var_i][base_i].scale(1.0 / sqrt(_eigenvalues[var_i](base_i)));
480 }
481 }
482}
std::vector< DenseMatrix< Real > > _eigenvectors
The eigenvectors of the correalation matrix for each variable.
std::vector< DenseVector< Real > > _eigenvalues
The eigenvalues of the correalation matrix for each variable.
void gatherSum(T &value)
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh

Referenced by execute().

◆ computeCorrelationMatrix()

void PODReducedBasisTrainer::computeCorrelationMatrix ( )
protected

Computes the correlation matrices using the snapshots.

Definition at line 146 of file PODReducedBasisTrainer.C.

147{
148 // Getting the number of snapshots. It is assumed that every variable has the
149 // same number of snapshots. This assumption is used at multiple locations in
150 // this source file.
151 const auto no_snaps = getSnapsSize(0);
152
153 // Initializing the correlation matrices for each variable.
154 for (unsigned int var_i = 0; var_i < _snapshots.size(); ++var_i)
155 _corr_mx[var_i] = DenseMatrix<Real>(no_snaps, no_snaps);
156
157 /*
158 Creating a simple 2D map that distributes the elements in the correlation
159 matrices to each processor. A square mesh with elements corresponding to
160 the entries in the correlation matrix is used, since optimal partitioning
161 routines are already implemented for it. In this case, the centroids of the
162 elements are equivalent to the indices of the correlation matrix. This method
163 may seem too convoluted, but is necessary to ensure that the communication
164 stays balanced and scales well for runs with a large number of processors.
165 */
166 ReplicatedMesh mesh(_communicator, 2);
167 MeshTools::Generation::build_square(
168 mesh, no_snaps, no_snaps, -0.5, no_snaps - 0.5, -0.5, no_snaps - 0.5);
169
170 // A flag is added to each element saying if the result has already been compuuted
171 // or not.
172 mesh.add_elem_integer("filled");
173
174 // Since the correlation matrix is symmetric, it is enough to compute the
175 // entries on the diagonal in addition to the elements above the diagonal.
176 // Therefore, the elements in the mesh below the diagonal are deleted.
177 for (Elem * elem : mesh.active_element_ptr_range())
178 {
179 const auto centroid = elem->vertex_average();
180 if (centroid(0) > centroid(1))
181 mesh.delete_elem(elem);
182 }
183
184 // The mesh is distributed among the processors.
185 mesh.prepare_for_use();
186
187 /*
188 This step restructures the snapshots into an unordered map to make it easier
189 to do cross-products in the later stages. Since _snapshots only contains
190 pointers to the data, this should not include a considerable amount of copy
191 operations.
192 */
193 std::unordered_map<unsigned int, std::vector<std::shared_ptr<DenseVector<Real>>>> local_vectors;
194 for (unsigned int loc_vec_i = 0; loc_vec_i < _snapshots[0].getNumberOfLocalEntries(); ++loc_vec_i)
195 {
196 const unsigned int glob_vec_i = _snapshots[0].getGlobalIndex(loc_vec_i);
197 auto & entry = local_vectors[glob_vec_i];
198
199 for (unsigned int v_ind = 0; v_ind < _snapshots.size(); ++v_ind)
200 entry.push_back(_snapshots[v_ind].getLocalEntry(loc_vec_i));
201 }
202
203 /*
204 Initializing containers for the objects that will be sent to other processors.
205 send_vectors is just a temporary object that ensures that the same snapshot is
206 sent to other processors only once. send_map, on the other hand, will be used
207 by the communicator and contains the required snapshots for each processor
208 which is not the the current rank.
209 std::tuple<unsigned int, unsigned int, std::shared_ptr<DenseVector<Real>>> type
210 is a container that uses (global snapshot index, variable index, snapshot) to
211 identify and send/receive snapshots during the communication.
212 */
213
214 std::unordered_map<processor_id_type, std::set<unsigned int>> send_vectors;
215 std::unordered_map<
217 std::vector<std::tuple<unsigned int, unsigned int, std::shared_ptr<DenseVector<Real>>>>>
218 send_map;
219
220 // Fill the send map with snapshots we need to send for each processor. First,
221 // we loop over the matrix entries (elements in the mesh)
222 for (Elem * elem : mesh.active_element_ptr_range())
223 if (elem->processor_id() != processor_id())
224 {
225 // The centroids in the mesh correspond to the 2D corrdinates of the elements
226 // in the mesh.
227 const auto centroid = elem->vertex_average();
228 const unsigned int i = centroid(0);
229 const unsigned int j = centroid(1);
230
231 /*
232 Checking if the current processor has the required snapshot.
233 We assume that every variable has the same number of snapshots with the
234 same distribution among processors. Therefore, it is enough to test
235 the first variable only.
236 */
237 if (_snapshots[0].hasGlobalEntry(i))
238 {
239 // Continue loop if the snapshot is already being sent.
240 if (send_vectors[elem->processor_id()].count(i))
241 continue;
242
243 // Add another entry to the map if another processor needs the owned
244 // snapshot.
245 send_vectors[elem->processor_id()].insert(i);
246 for (unsigned int v_ind = 0; v_ind < _snapshots.size(); ++v_ind)
247 send_map[elem->processor_id()].emplace_back(
248 i, v_ind, _snapshots[v_ind].getGlobalEntry(i));
249 }
250 else if (_snapshots[0].hasGlobalEntry(j))
251 {
252 // Continue loop if the snapshot is already being sent.
253 if (send_vectors[elem->processor_id()].count(j))
254 continue;
255
256 // Add another entry to the map if another processor needs the owned
257 // snapshot.
258 send_vectors[elem->processor_id()].insert(j);
259 for (unsigned int v_ind = 0; v_ind < _snapshots.size(); ++v_ind)
260 send_map[elem->processor_id()].emplace_back(
261 j, v_ind, _snapshots[v_ind].getGlobalEntry(j));
262 }
263 }
264 else
265 // Initializing the flag value with 0 (not computed) for each element.
266 elem->set_extra_integer(0, 0);
267
268 // Creating container for received data. In this case the map contains the snapshots
269 // for each variable for each required global snapshot index.
270 std::unordered_map<unsigned int, std::vector<std::shared_ptr<DenseVector<Real>>>>
271 received_vectors;
272
273 // Converting function to functor to be able to pass to push packed range.
274 auto functor =
275 [this, &mesh, &received_vectors, &local_vectors](
277 const std::vector<
278 std::tuple<unsigned int, unsigned int, std::shared_ptr<DenseVector<Real>>>> & vectors)
279 { PODReducedBasisTrainer::receiveObjects(mesh, received_vectors, local_vectors, pid, vectors); };
280
281 Parallel::push_parallel_packed_range(_communicator, send_map, (void *)nullptr, functor);
282
283 // This extra call is necessary in case a processor has all the elements it needs
284 // (hence doesn't receive any).
285 functor(
286 processor_id(),
287 std::vector<std::tuple<unsigned int, unsigned int, std::shared_ptr<DenseVector<Real>>>>());
288
289 // Now, the correlation matrices aregathered and summed to make sure every processor
290 // sees them.
291 gatherSum(_corr_mx[0].get_values());
292
293 // The lower triangle of the matrices are then filled using symmetry.
294 for (auto & corr_mx : _corr_mx)
295 for (unsigned int row_i = 1; row_i < corr_mx.m(); ++row_i)
296 for (unsigned int col_i = 0; col_i < row_i; ++col_i)
297 corr_mx(row_i, col_i) = corr_mx(col_i, row_i);
298}
for(PetscInt i=0;i< nvars;++i)
void ErrorVector unsigned int
unsigned int getSnapsSize(unsigned int var_i) const
Getting the snapshot size across all of the processors for a given variable with index var_i.
void receiveObjects(ReplicatedMesh &mesh, std::unordered_map< unsigned int, std::vector< std::shared_ptr< DenseVector< Real > > > > &received_vectors, std::unordered_map< unsigned int, std::vector< std::shared_ptr< DenseVector< Real > > > > &local_vectors, processor_id_type, const std::vector< std::tuple< unsigned int, unsigned int, std::shared_ptr< DenseVector< Real > > > > &vectors)
Function that manipulates the received objects and computes the correlation matrices on the fly.
std::vector< DenseMatrix< Real > > _corr_mx
The correlation matrices for the variables.
const Parallel::Communicator & _communicator
processor_id_type processor_id() const
MeshBase & mesh
uint8_t processor_id_type
if(subdm)

Referenced by execute().

◆ computeEigenDecomposition()

void PODReducedBasisTrainer::computeEigenDecomposition ( )
protected

Computes the eigen-decomposition of the stored correlation matrices.

Definition at line 381 of file PODReducedBasisTrainer.C.

382{
383 for (unsigned int v_ind = 0; v_ind < _corr_mx.size(); ++v_ind)
384 {
385 unsigned int no_snaps = _corr_mx[v_ind].n();
386
387 // Initializing temporary objects for the eigenvalues and eigenvectors since
388 // evd_left() returns an unordered vector of eigenvalues.
389 DenseVector<Real> eigenvalues(no_snaps);
390 DenseMatrix<Real> eigenvectors(no_snaps, no_snaps);
391
392 // Creating a temporary placeholder for the imaginary parts of the eigenvalues
393 DenseVector<Real> eigenvalues_imag(no_snaps);
394
395 // Performing the eigenvalue decomposition
396 _corr_mx[v_ind].evd_left(eigenvalues, eigenvalues_imag, eigenvectors);
397
398 // Sorting the eigenvectors and eigenvalues based on the magnitude of
399 // the eigenvalues
400 std::vector<unsigned int> idx(eigenvalues.size());
401 std::iota(idx.begin(), idx.end(), 0);
402 std::vector<Real> & v = eigenvalues.get_values();
403
404 // Getting the indices to be able to copy the corresponding eigenvector too.
405 std::stable_sort(
406 idx.begin(), idx.end(), [&v](unsigned int i, unsigned int j) { return v[i] > v[j]; });
407
408 // Getting a cutoff for the number of modes. The function requires a sorted list,
409 // thus the temporary vector is sorted.
410 std::stable_sort(v.begin(), v.end(), std::greater<Real>());
411 unsigned int cutoff = determineNumberOfModes(_error_res[v_ind], v);
412
413 // Initializing the actual containers for the eigenvectors and eigenvalues.
414 _eigenvalues[v_ind] = DenseVector<Real>(cutoff);
415 _eigenvectors[v_ind] = DenseMatrix<Real>(eigenvectors.m(), cutoff);
416
417 // Copying the kept eigenvalues and eigenvectors in a sorted container.
418 for (unsigned int j = 0; j < cutoff; ++j)
419 {
420 _eigenvalues[v_ind](j) = eigenvalues(j);
421 for (unsigned int k = 0; k < _eigenvectors[v_ind].m(); ++k)
422 {
423 _eigenvectors[v_ind](k, j) = eigenvectors(k, idx[j]);
424 }
425 }
426
428 }
429}
const double v
unsigned int determineNumberOfModes(Real error, const std::vector< Real > &inp_vec) const
Computes the number of bases necessary for a given error indicator.
void printEigenvalues()
Prints the eigenvalues of the correlation matrix for each variable.
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)

Referenced by execute().

◆ declareModelData()

template<typename T , typename... Args>
T & RestartableModelInterface::declareModelData ( const std::string &  data_name,
Args &&...  args 
)
inherited

Declare model data for loading from file as well as restart.

Definition at line 76 of file RestartableModelInterface.h.

77{
78 return _model_restartable.declareRestartableData<T>(data_name, std::forward<Args>(args)...);
79}
const double T
T & declareRestartableData(const std::string &data_name, Args &&... args)
Declare a piece of data as "restartable" and initialize it.
PublicRestartable _model_restartable
Member for interfacing with the framework's restartable system.

◆ determineNumberOfModes()

unsigned int PODReducedBasisTrainer::determineNumberOfModes ( Real  error,
const std::vector< Real > &  inp_vec 
) const
private

Computes the number of bases necessary for a given error indicator.

This needs a sorted vector as input.

Definition at line 432 of file PODReducedBasisTrainer.C.

433{
434 Real sum = std::accumulate(inp_vec.begin(), inp_vec.end(), 0.0);
435
436 Real part_sum = 0.0;
437 for (unsigned int i = 0; i < inp_vec.size(); ++i)
438 {
439 part_sum += inp_vec[i];
440 if (part_sum / sum > 1 - error)
441 return (i + 1);
442 }
443 return (inp_vec.size());
444}
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Referenced by computeEigenDecomposition().

◆ execute()

void PODReducedBasisTrainer::execute ( )
overridevirtual

Implements GeneralUserObject.

Definition at line 104 of file PODReducedBasisTrainer.C.

105{
106 // If the base is not ready yet, create it by performing the POD on the
107 // snapshot matrices. Also, initialize the containers for the reduced
108 // operators.
109 if (!_base_completed)
110 {
111 if (_snapshots.empty() || getSnapsSize(0) == 0)
112 mooseError("No snapshots are available to build the POD basis. Make sure the snapshots are "
113 "transferred before this trainer executes.");
114
119 _base_completed = true;
120 _empty_operators = true;
121 }
122}
void mooseError(Args &&... args) const
void computeCorrelationMatrix()
Computes the correlation matrices using the snapshots.
void computeBasisVectors()
Generates the basis vectors using the snapshots together with the eigen-decomposition of the correlat...
void computeEigenDecomposition()
Computes the eigen-decomposition of the stored correlation matrices.
void initReducedOperators()
Initializing the reduced operators.

◆ finalize()

void PODReducedBasisTrainer::finalize ( )
overridevirtual

Reimplemented from SurrogateTrainerBase.

Definition at line 125 of file PODReducedBasisTrainer.C.

126{
127 // If the operators are already filled on each processor, gather and sum them
128 // together. This way every processor has access to every complete reduced
129 // operator.
130 if (!_empty_operators)
131 for (unsigned int tag_i = 0; tag_i < _red_operators.size(); ++tag_i)
132 {
133 gatherSum(_red_operators[tag_i].get_values());
134 }
135}

◆ getBaseSize()

unsigned int PODReducedBasisTrainer::getBaseSize ( unsigned int  var_i) const
inline

Getting the base size for variable with index v_ind.

Definition at line 66 of file PODReducedBasisTrainer.h.

66{ return _base[var_i].size(); }

Referenced by PODSamplerSolutionTransfer::execute().

◆ getBasisVector() [1/2]

const DenseVector< Real > & PODReducedBasisTrainer::getBasisVector ( unsigned int  glob_i) const

Getting basis vector based on its global index.

Definition at line 548 of file PODReducedBasisTrainer.C.

549{
550 unsigned int counter = 0;
551
552 for (unsigned int var_i = 0; var_i < _var_names.size(); ++var_i)
553 for (unsigned int base_i = 0; base_i < _base[var_i].size(); ++base_i)
554 {
555 if (glob_i == counter)
556 return _base[var_i][base_i];
557
558 counter += 1;
559 }
560
561 mooseError("The basis vector with global index ", glob_i, "is not available!");
562 return _base[0][0];
563}

◆ getBasisVector() [2/2]

const DenseVector< Real > & PODReducedBasisTrainer::getBasisVector ( unsigned int  var_i,
unsigned int  base_i 
) const

Getting a basis vector for a given variable.

Definition at line 542 of file PODReducedBasisTrainer.C.

543{
544 return _base[var_i][base_i];
545}

Referenced by PODSamplerSolutionTransfer::execute(), and PODSamplerSolutionTransfer::executeToMultiapp().

◆ getModelData()

template<typename T , typename... Args>
const T & RestartableModelInterface::getModelData ( const std::string &  data_name,
Args &&...  args 
) const
inherited

Retrieve model data from the interface.

Definition at line 83 of file RestartableModelInterface.h.

84{
85 return _model_restartable.getRestartableData<T>(data_name, std::forward<Args>(args)...);
86}
const T & getRestartableData(const std::string &data_name) const
Declare a piece of data as "restartable" and initialize it Similar to declareRestartableData but retu...

◆ getModelDataFileName()

const FileName & RestartableModelInterface::getModelDataFileName ( ) const
inherited

Get the associated filename.

Definition at line 33 of file RestartableModelInterface.C.

34{
35 return _model_object.getParam<FileName>("filename");
36}
const MooseObject & _model_object
Reference to the MooseObject that uses this interface.

◆ getSnapsSize()

unsigned int PODReducedBasisTrainer::getSnapsSize ( unsigned int  var_i) const

Getting the snapshot size across all of the processors for a given variable with index var_i.

Definition at line 525 of file PODReducedBasisTrainer.C.

526{
527 return _snapshots[var_i].getNumberOfGlobalEntries();
528}

Referenced by computeCorrelationMatrix(), and execute().

◆ getSumBaseSize()

unsigned int PODReducedBasisTrainer::getSumBaseSize ( ) const

Getting the overall base size, which is the sum of the individual bases.

Definition at line 531 of file PODReducedBasisTrainer.C.

532{
533 unsigned int sum = 0;
534
535 for (unsigned int i = 0; i < _base.size(); ++i)
536 sum += _base[i].size();
537
538 return sum;
539}

Referenced by PODFullSolveMultiApp::computeResidualBatch(), PODResidualTransfer::execute(), initReducedOperators(), and PODFullSolveMultiApp::preTransfer().

◆ getTagNames()

const std::vector< std::string > & PODReducedBasisTrainer::getTagNames ( ) const
inline

◆ getTagTypes()

const std::vector< std::string > & PODReducedBasisTrainer::getTagTypes ( ) const
inline

Definition at line 59 of file PODReducedBasisTrainer.h.

59{ return _tag_types; }

Referenced by PODResidualTransfer::transferResidual().

◆ getVariableIndex()

unsigned int PODReducedBasisTrainer::getVariableIndex ( unsigned int  glob_i) const

Getting appropriate variable index for a global base index.

Definition at line 566 of file PODReducedBasisTrainer.C.

567{
568 unsigned int counter = 0;
569
570 for (unsigned int var_i = 0; var_i < _var_names.size(); ++var_i)
571 for (unsigned int base_i = 0; base_i < _base[var_i].size(); ++base_i)
572 {
573 if (glob_i == counter)
574 return var_i;
575
576 counter += 1;
577 }
578
579 mooseError("Variable with global base index ", glob_i, "is not available!");
580 return 0;
581}

Referenced by PODSamplerSolutionTransfer::executeToMultiapp().

◆ getVarNames()

const std::vector< std::string > & PODReducedBasisTrainer::getVarNames ( ) const
inline

◆ hasExplicitModelData()

bool RestartableModelInterface::hasExplicitModelData ( ) const
inherited

Check if the filename parameter is explicitly set (ignoring recover state)

Definition at line 39 of file RestartableModelInterface.C.

40{
41 return _model_object.isParamValid("filename");
42}
bool isParamValid(const std::string &name) const

Referenced by RestartableModelInterface::hasModelData().

◆ hasModelData()

bool RestartableModelInterface::hasModelData ( ) const
inherited

Check if we need to load model data (if the filename parameter is used)

Definition at line 45 of file RestartableModelInterface.C.

46{
48}
bool isRecovering() const
MooseApp & getMooseApp() const
bool hasExplicitModelData() const
Check if the filename parameter is explicitly set (ignoring recover state)

◆ initialize()

virtual void PODReducedBasisTrainer::initialize ( )
inlineoverridevirtual

Reimplemented from SurrogateTrainerBase.

Definition at line 36 of file PODReducedBasisTrainer.h.

36{};

◆ initialSetup()

void PODReducedBasisTrainer::initialSetup ( )
overridevirtual

Reimplemented from GeneralUserObject.

Definition at line 82 of file PODReducedBasisTrainer.C.

83{
84 // Initializing the containers for the essential data to construct the
85 // reduced operators.
86
87 _snapshots.clear();
89
90 _base.clear();
91 _base.resize(_var_names.size());
92
93 _corr_mx.clear();
94 _corr_mx.resize(_var_names.size());
95
96 _eigenvalues.clear();
97 _eigenvalues.resize(_var_names.size());
98
99 _eigenvectors.clear();
100 _eigenvectors.resize(_var_names.size());
101}
Templated class that specifies a distributed storage of a vector of given objects.

◆ initReducedOperators()

void PODReducedBasisTrainer::initReducedOperators ( )

Initializing the reduced operators.

Definition at line 485 of file PODReducedBasisTrainer.C.

486{
487 _red_operators.resize(_tag_names.size());
488
489 // Getting the sum of the ranks of the different bases. Every reduced operator
490 // is resized with this number. This way the construction can be more general.
491 unsigned int base_num = getSumBaseSize();
492
493 // Initializing each operator (each operator with a tag).
494 for (unsigned int tag_i = 0; tag_i < _red_operators.size(); ++tag_i)
495 {
496 if (_tag_types[tag_i] == "src" || _tag_types[tag_i] == "src_dir")
497 _red_operators[tag_i].resize(base_num, 1);
498 else
499 _red_operators[tag_i].resize(base_num, base_num);
500 }
501}
unsigned int getSumBaseSize() const
Getting the overall base size, which is the sum of the individual bases.

Referenced by execute().

◆ modelMetaDataName()

const std::string & RestartableModelInterface::modelMetaDataName ( ) const
inlineinherited

Accessor for the name of the model meta data.

Definition at line 47 of file RestartableModelInterface.h.

47{ return _model_meta_data_name; }
const std::string _model_meta_data_name
The model meta data name.

Referenced by MappingOutput::output(), and SurrogateTrainerOutput::output().

◆ printEigenvalues()

void PODReducedBasisTrainer::printEigenvalues ( )
protected

Prints the eigenvalues of the correlation matrix for each variable.

Definition at line 584 of file PODReducedBasisTrainer.C.

585{
586 if (processor_id() == 0 && _tid == 0 && isParamValid("filenames"))
587 {
588 std::vector<std::string> filenames = getParam<std::vector<std::string>>("filenames");
589
590 if (filenames.size() != _var_names.size())
591 paramError("filenames",
592 "The number of file names is not equal to the number of variable names!");
593
594 for (unsigned int var_i = 0; var_i < _var_names.size(); ++var_i)
595 {
596 std::filebuf fb;
597 fb.open(filenames[var_i], std::ios::out);
598 std::ostream os(&fb);
599 os << "evs" << std::endl;
600 _eigenvalues[var_i].print_scientific(os);
601 }
602 }
603}
const THREAD_ID _tid

Referenced by computeEigenDecomposition().

◆ receiveObjects()

void PODReducedBasisTrainer::receiveObjects ( ReplicatedMesh &  mesh,
std::unordered_map< unsigned int, std::vector< std::shared_ptr< DenseVector< Real > > > > &  received_vectors,
std::unordered_map< unsigned int, std::vector< std::shared_ptr< DenseVector< Real > > > > &  local_vectors,
processor_id_type  ,
const std::vector< std::tuple< unsigned int, unsigned int, std::shared_ptr< DenseVector< Real > > > > &  vectors 
)
private

Function that manipulates the received objects and computes the correlation matrices on the fly.

Definition at line 301 of file PODReducedBasisTrainer.C.

310{
311 for (auto & tuple : vectors)
312 {
313 const auto glob_vec_i = std::get<0>(tuple);
314 const auto var_i = std::get<1>(tuple);
315 const auto & vector = std::get<2>(tuple);
316
317 // The entry that will be filled with all of the variable solutions for a vector
318 std::vector<std::shared_ptr<DenseVector<Real>>> & entry = received_vectors[glob_vec_i];
319
320 // Size it to the number of variables in case we haven't already
321 entry.resize(_snapshots.size(), nullptr);
322
323 // Add this varaible's contribution - this is shared_ptr so we are claiming partial
324 // ownership of this vector and do not have to do a copy
325 entry[var_i] = vector;
326 }
327
328 // Looping over the locally owned entries in the matrix and computing the
329 // values.
330 for (Elem * elem : mesh.active_local_element_ptr_range())
331 {
332 // If the matrix entry is already filled, the loop skips this element.
333 if (elem->get_extra_integer(0))
334 continue;
335
336 // Getting pointers to the necessary snapshots for the matrix entry.
337 // This points to a vector of size (number of variables).
338 const unsigned int i = elem->vertex_average()(0);
339 const unsigned int j = elem->vertex_average()(1);
340 std::vector<std::shared_ptr<DenseVector<Real>>> * i_vec = nullptr;
341 std::vector<std::shared_ptr<DenseVector<Real>>> * j_vec = nullptr;
342
343 const auto find_i_local = local_vectors.find(i);
344 if (find_i_local != local_vectors.end())
345 i_vec = &find_i_local->second;
346 else
347 {
348 const auto find_i_received = received_vectors.find(i);
349 if (find_i_received != received_vectors.end())
350 {
351 i_vec = &find_i_received->second;
352 }
353 else
354 continue;
355 }
356
357 const auto find_j_local = local_vectors.find(j);
358 if (find_j_local != local_vectors.end())
359 j_vec = &find_j_local->second;
360 else
361 {
362 const auto find_j_received = received_vectors.find(j);
363 if (find_j_received != received_vectors.end())
364 {
365 j_vec = &find_j_received->second;
366 }
367 else
368 continue;
369 }
370
371 // Coputing the available matrix entries for every variable.
372 for (unsigned int v_ind = 0; v_ind < _snapshots.size(); ++v_ind)
373 _corr_mx[v_ind](i, j) = (*i_vec)[v_ind]->dot(*(*j_vec)[v_ind]);
374
375 // Set the 'filled' flag to 1 (true) to make sure it is not recomputed.
376 elem->set_extra_integer(0, 1);
377 }
378}

Referenced by computeCorrelationMatrix().

◆ threadJoin()

virtual void SurrogateTrainerBase::threadJoin ( const UserObject &  )
inlinefinalvirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 40 of file SurrogateTrainer.h.

40{} // GeneralUserObjects are not threaded

◆ validParams()

InputParameters PODReducedBasisTrainer::validParams ( )
static

Definition at line 21 of file PODReducedBasisTrainer.C.

22{
24
25 params.addClassDescription("Computes the reduced subspace plus the reduced operators for "
26 "POD-RB surrogate.");
27 params.addRequiredParam<std::vector<std::string>>("var_names",
28 "Names of variables we want to "
29 "extract from solution vectors.");
30 params.addRequiredParam<std::vector<Real>>("error_res",
31 "The errors allowed in the snapshot reconstruction.");
32 params.addRequiredParam<std::vector<std::string>>("tag_names",
33 "Names of tags for the reduced operators.");
34 params.addParam<std::vector<std::string>>(
35 "filenames", "Files where the eigenvalues are printed for each variable (if given).");
36
37 params.addRequiredParam<std::vector<std::string>>(
38 "tag_types",
39 "List of keywords describing if the tags"
40 " correspond to independent operators or not. (op/op_dir/src/src_dir)");
41 return params;
42}
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()

Member Data Documentation

◆ _base

std::vector<std::vector<DenseVector<Real> > >& PODReducedBasisTrainer::_base
protected

◆ _base_completed

bool PODReducedBasisTrainer::_base_completed
protected

Switch that tells if the object has already computed the necessary basis vectors.

This switch is used in execute() to determine if we want to compute basis vectors or do something else.

Definition at line 128 of file PODReducedBasisTrainer.h.

Referenced by execute().

◆ _corr_mx

std::vector<DenseMatrix<Real> > PODReducedBasisTrainer::_corr_mx
protected

The correlation matrices for the variables.

Definition at line 111 of file PODReducedBasisTrainer.h.

Referenced by computeCorrelationMatrix(), computeEigenDecomposition(), initialSetup(), and receiveObjects().

◆ _eigenvalues

std::vector<DenseVector<Real> > PODReducedBasisTrainer::_eigenvalues
protected

The eigenvalues of the correalation matrix for each variable.

Definition at line 114 of file PODReducedBasisTrainer.h.

Referenced by computeBasisVectors(), computeEigenDecomposition(), initialSetup(), and printEigenvalues().

◆ _eigenvectors

std::vector<DenseMatrix<Real> > PODReducedBasisTrainer::_eigenvectors
protected

The eigenvectors of the correalation matrix for each variable.

Definition at line 117 of file PODReducedBasisTrainer.h.

Referenced by computeBasisVectors(), computeEigenDecomposition(), and initialSetup().

◆ _empty_operators

bool PODReducedBasisTrainer::_empty_operators
protected

Flag describing if the reduced operators are empty or not.

This is necessary to be able to do both the base and reduced operator generation in the same object.

Definition at line 133 of file PODReducedBasisTrainer.h.

Referenced by addToReducedOperator(), execute(), and finalize().

◆ _error_res

std::vector<Real> PODReducedBasisTrainer::_error_res
protected

Energy limits that define how many basis functions will be kept for each variable.

Definition at line 99 of file PODReducedBasisTrainer.h.

Referenced by computeEigenDecomposition(), and PODReducedBasisTrainer().

◆ _model_meta_data_name

const std::string RestartableModelInterface::_model_meta_data_name
privateinherited

The model meta data name.

This is used to store the restartable data within the RestartableDataMap.

Definition at line 64 of file RestartableModelInterface.h.

Referenced by RestartableModelInterface::modelMetaDataName(), and RestartableModelInterface::RestartableModelInterface().

◆ _model_object

const MooseObject& RestartableModelInterface::_model_object
privateinherited

◆ _model_restartable

PublicRestartable RestartableModelInterface::_model_restartable
privateinherited

Member for interfacing with the framework's restartable system.

We need this because we would like to have the capability to handle the model data separately from the other data members used for checkpointing.

Definition at line 71 of file RestartableModelInterface.h.

Referenced by RestartableModelInterface::declareModelData(), and RestartableModelInterface::getModelData().

◆ _red_operators

std::vector<DenseMatrix<Real> >& PODReducedBasisTrainer::_red_operators
protected

The reduced operators that should be transferred to the surrogate.

Definition at line 123 of file PODReducedBasisTrainer.h.

Referenced by addToReducedOperator(), finalize(), and initReducedOperators().

◆ _snapshots

std::vector<DistributedSnapshots> PODReducedBasisTrainer::_snapshots
protected

Distributed container for snapshots per variable.

Definition at line 108 of file PODReducedBasisTrainer.h.

Referenced by addSnapshot(), computeBasisVectors(), computeCorrelationMatrix(), execute(), getSnapsSize(), initialSetup(), and receiveObjects().

◆ _tag_names

std::vector<std::string>& PODReducedBasisTrainer::_tag_names
protected

Names of the tags that should be used to fetch residuals from the MultiApp.

Definition at line 102 of file PODReducedBasisTrainer.h.

Referenced by getTagNames(), initReducedOperators(), and PODReducedBasisTrainer().

◆ _tag_types

std::vector<std::string>& PODReducedBasisTrainer::_tag_types
protected

list of bools describing which tag is indepedent of the solution.

Definition at line 105 of file PODReducedBasisTrainer.h.

Referenced by getTagTypes(), initReducedOperators(), and PODReducedBasisTrainer().

◆ _var_names

std::vector<std::string>& PODReducedBasisTrainer::_var_names
protected

Vector containing the names of the variables we want to use for constructing the surrogates.

Definition at line 96 of file PODReducedBasisTrainer.h.

Referenced by addToReducedOperator(), getBasisVector(), getVariableIndex(), getVarNames(), initialSetup(), PODReducedBasisTrainer(), and printEigenvalues().


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