Class which provides a Proper Orthogonal Decomposition (POD)-based mapping between full-order and reduced-order spaces. More...
#include <PODMapping.h>
Public Types | |
typedef DataFileName | DataFileParameterType |
Public Member Functions | |
PODMapping (const InputParameters ¶meters) | |
virtual void | buildMapping (const VariableName &vname) override |
Abstract function for building mapping for a given variable. More... | |
void | map (const VariableName &vname, const DenseVector< Real > &full_order_vector, std::vector< Real > &reduced_order_vector) const override |
Method used for mapping full-order solutions for a given variable onto a latent space. More... | |
void | map (const VariableName &vname, const unsigned int global_sample_i, std::vector< Real > &reduced_order_vector) const override |
Method used for mapping full-order solutions for a given variable onto a latent space. More... | |
void | inverse_map (const VariableName &vname, const std::vector< Real > &reduced_order_vector, DenseVector< Real > &full_order_vector) const override |
Method used for mapping reduced-order solutions for a given variable onto the full-order space. More... | |
const std::vector< DenseVector< Real > > & | leftBasis (const VariableName &vname) |
Return all of the left basis functions for a given variable. More... | |
const std::vector< DenseVector< Real > > & | rightBasis (const VariableName &vname) |
Return all of the right basis functions for a given variable. More... | |
const std::vector< Real > & | singularValues (const VariableName &vname) |
Return all of the singular values for a given variable. More... | |
const DenseVector< Real > & | leftBasisFunction (const VariableName &vname, const unsigned int base_i) |
Get the base_i -th left basis function for a given variable. More... | |
const DenseVector< Real > & | rightBasisFunction (const VariableName &vname, const unsigned int base_i) |
Get the base_i -th right basis function for a given variable. More... | |
virtual const std::vector< VariableName > & | getVariableNames () |
Get the available variable names in this mapping. More... | |
virtual bool | enabled () const |
std::shared_ptr< MooseObject > | getSharedPtr () |
std::shared_ptr< const MooseObject > | getSharedPtr () const |
MooseApp & | getMooseApp () const |
const std::string & | type () const |
virtual const std::string & | name () const |
std::string | typeAndName () const |
std::string | errorPrefix (const std::string &error_type) const |
void | callMooseError (std::string msg, const bool with_prefix) const |
MooseObjectParameterName | uniqueParameterName (const std::string ¶meter_name) const |
const InputParameters & | parameters () const |
MooseObjectName | uniqueName () const |
const T & | getParam (const std::string &name) const |
std::vector< std::pair< T1, T2 > > | getParam (const std::string ¶m1, const std::string ¶m2) 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 &nm) const |
void | paramError (const std::string ¶m, Args... args) const |
void | paramWarning (const std::string ¶m, Args... args) const |
void | paramInfo (const std::string ¶m, Args... args) const |
void | connectControllableParams (const std::string ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const |
void | mooseError (Args &&... args) const |
void | mooseErrorNonPrefixed (Args &&... args) const |
void | mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const |
void | mooseWarning (Args &&... args) const |
void | mooseWarningNonPrefixed (Args &&... args) const |
void | mooseDeprecated (Args &&... args) const |
void | mooseInfo (Args &&... args) const |
std::string | getDataFileName (const std::string ¶m) const |
std::string | getDataFileNameByName (const std::string &relative_path) const |
std::string | getDataFilePath (const std::string &relative_path) 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. More... | |
const FileName & | getModelDataFileName () const |
Get the associated filename. More... | |
bool | hasModelData () const |
Check if we need to load model data (if the filename parameter is used) More... | |
UserObjectName | getUserObjectName (const std::string ¶m_name) const |
const T & | getUserObject (const std::string ¶m_name, bool is_dependency=true) const |
const T & | getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const |
const UserObject & | getUserObjectBase (const std::string ¶m_name, bool is_dependency=true) const |
const UserObject & | getUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const |
bool | hasUserObject (const std::string ¶m_name) const |
bool | hasUserObject (const std::string ¶m_name) const |
bool | hasUserObject (const std::string ¶m_name) const |
bool | hasUserObject (const std::string ¶m_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 |
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. More... | |
template<typename T , typename... Args> | |
const T & | getModelData (const std::string &data_name, Args &&... args) const |
Retrieve model data from the interface. More... | |
Static Public Member Functions | |
static InputParameters | validParams () |
Public Attributes | |
const ConsoleStream | _console |
Protected Member Functions | |
void | checkIfReadyToUse (const VariableName &libmesh_dbg_var(vname)) const |
Check if we have a mapping for the variable and if it is ready to be used. More... | |
virtual void | addUserObjectDependencyHelper (const UserObject &) const |
Protected Attributes | |
const std::vector< dof_id_type > | _num_modes |
The number of modes which need to be computed. More... | |
const std::vector< Real > & | _energy_threshold |
The energy thresholds for truncation of the number of modes, defined by the user. More... | |
std::map< VariableName, std::vector< DenseVector< Real > > > & | _left_basis_functions |
Restartable container holding the basis functions for each variable. More... | |
std::map< VariableName, std::vector< DenseVector< Real > > > & | _right_basis_functions |
Restartable container holding the basis functions for each variable. More... | |
std::map< VariableName, std::vector< Real > > & | _singular_values |
Restartable container holding the singular values. More... | |
const std::string & | _extra_slepc_options |
Variable holding additional petsc options for the singular value solve. More... | |
const std::vector< VariableName > & | _variable_names |
Storage for the names of the variables this mapping can handle. More... | |
std::map< VariableName, bool > & | _mapping_ready_to_use |
Bool to decide if we already have the mapping built or not to make sure it is not computed multiple times unless the user requests it. More... | |
const bool & | _enabled |
MooseApp & | _app |
const std::string | _type |
const std::string | _name |
const InputParameters & | _pars |
Factory & | _factory |
ActionFactory & | _action_factory |
const Parallel::Communicator & | _communicator |
Private Attributes | |
const ParallelSolutionStorage *const | _parallel_storage |
Link to the parallel storage which holds the solution fields that are used for the SVD. More... | |
const StochasticTools::POD | _pod |
The POD object which can be used to compute the basis functions/vectors. More... | |
Class which provides a Proper Orthogonal Decomposition (POD)-based mapping between full-order and reduced-order spaces.
Definition at line 23 of file PODMapping.h.
PODMapping::PODMapping | ( | const InputParameters & | parameters | ) |
Definition at line 45 of file PODMapping.C.
|
overridevirtual |
Abstract function for building mapping for a given variable.
vname | The name of the variable |
Implements VariableMappingBase.
Definition at line 100 of file PODMapping.C.
Referenced by SingularTripletReporter::execute().
|
protectedinherited |
Check if we have a mapping for the variable and if it is ready to be used.
Definition at line 37 of file VariableMappingBase.C.
Referenced by inverse_map(), leftBasis(), leftBasisFunction(), map(), rightBasis(), rightBasisFunction(), and singularValues().
|
inherited |
Declare model data for loading from file as well as restart.
Definition at line 78 of file RestartableModelInterface.h.
|
inherited |
Retrieve model data from the interface.
Definition at line 85 of file RestartableModelInterface.h.
|
inherited |
Get the associated filename.
Definition at line 33 of file RestartableModelInterface.C.
|
inlinevirtualinherited |
Get the available variable names in this mapping.
Definition at line 71 of file VariableMappingBase.h.
Referenced by SingularTripletReporter::initialSetup(), and InverseMapping::initialSetup().
|
inherited |
Check if we need to load model data (if the filename parameter is used)
Definition at line 39 of file RestartableModelInterface.C.
|
overridevirtual |
Method used for mapping reduced-order solutions for a given variable onto the full-order space.
vname | The name of the variable |
reduced_order_vector | The coordinates in the latent space |
full_order_vector | Storage for the reconstructed solution for the given variable |
Implements VariableMappingBase.
Definition at line 181 of file PODMapping.C.
const std::vector< DenseVector< Real > > & PODMapping::leftBasis | ( | const VariableName & | vname | ) |
Return all of the left basis functions for a given variable.
vname | The name of the variable. |
Definition at line 241 of file PODMapping.C.
Referenced by SingularTripletReporter::execute().
const DenseVector< Real > & PODMapping::leftBasisFunction | ( | const VariableName & | vname, |
const unsigned int | base_i | ||
) |
Get the base_i
-th left basis function for a given variable.
vname | The name of the variable |
base_i | The index of the basis function |
Definition at line 209 of file PODMapping.C.
|
overridevirtual |
Method used for mapping full-order solutions for a given variable onto a latent space.
vname | The name of the variable |
full_order_vector | Serialized vector of the solution field for the given variable |
reduced_order_vector | Storage space for the coordinates in the latent space |
Implements VariableMappingBase.
Definition at line 163 of file PODMapping.C.
|
overridevirtual |
Method used for mapping full-order solutions for a given variable onto a latent space.
vname | The name of the variable |
global_sample_i | The global index of the sample whose solution should be mapped into the latent space |
reduced_order_vector | Storage space for the coordinates in the latent space |
Implements VariableMappingBase.
Definition at line 141 of file PODMapping.C.
|
inlineinherited |
Accessor for the name of the model meta data.
Definition at line 47 of file RestartableModelInterface.h.
Referenced by SurrogateTrainerOutput::output(), and MappingOutput::output().
const std::vector< DenseVector< Real > > & PODMapping::rightBasis | ( | const VariableName & | vname | ) |
Return all of the right basis functions for a given variable.
vname | The name of the variable. |
Definition at line 252 of file PODMapping.C.
Referenced by SingularTripletReporter::execute().
const DenseVector< Real > & PODMapping::rightBasisFunction | ( | const VariableName & | vname, |
const unsigned int | base_i | ||
) |
Get the base_i
-th right basis function for a given variable.
vname | The name of the variable |
base_i | The index of the basis function |
Definition at line 225 of file PODMapping.C.
const std::vector< Real > & PODMapping::singularValues | ( | const VariableName & | vname | ) |
Return all of the singular values for a given variable.
vname | The name of the variable. |
Definition at line 263 of file PODMapping.C.
Referenced by SingularTripletReporter::execute().
|
static |
Definition at line 18 of file PODMapping.C.
|
protected |
The energy thresholds for truncation of the number of modes, defined by the user.
Definition at line 104 of file PODMapping.h.
Referenced by buildMapping(), and PODMapping().
|
protected |
Variable holding additional petsc options for the singular value solve.
Definition at line 116 of file PODMapping.h.
|
protected |
Restartable container holding the basis functions for each variable.
Definition at line 107 of file PODMapping.h.
Referenced by buildMapping(), inverse_map(), leftBasis(), leftBasisFunction(), map(), and PODMapping().
|
protectedinherited |
Bool to decide if we already have the mapping built or not to make sure it is not computed multiple times unless the user requests it.
Definition at line 82 of file VariableMappingBase.h.
Referenced by buildMapping(), VariableMappingBase::checkIfReadyToUse(), and PODMapping().
|
protected |
The number of modes which need to be computed.
Definition at line 101 of file PODMapping.h.
Referenced by buildMapping(), and PODMapping().
|
private |
Link to the parallel storage which holds the solution fields that are used for the SVD.
Definition at line 120 of file PODMapping.h.
Referenced by buildMapping(), and map().
|
private |
The POD object which can be used to compute the basis functions/vectors.
Definition at line 123 of file PODMapping.h.
Referenced by buildMapping().
|
protected |
Restartable container holding the basis functions for each variable.
Definition at line 110 of file PODMapping.h.
Referenced by buildMapping(), PODMapping(), rightBasis(), and rightBasisFunction().
|
protected |
Restartable container holding the singular values.
Definition at line 113 of file PODMapping.h.
Referenced by buildMapping(), PODMapping(), and singularValues().
|
protectedinherited |
Storage for the names of the variables this mapping can handle.
Definition at line 78 of file VariableMappingBase.h.
Referenced by buildMapping(), VariableMappingBase::getVariableNames(), inverse_map(), leftBasisFunction(), PODMapping(), and rightBasisFunction().