#include <PODReducedBasisSurrogate.h>
Public Types | |
typedef DataFileName | DataFileParameterType |
Public Member Functions | |
PODReducedBasisSurrogate (const InputParameters ¶meters) | |
void | evaluateSolution (const std::vector< Real > ¶ms) |
Get the reduced solution for a given parameter sample. More... | |
void | evaluateSolution (const std::vector< Real > ¶ms, DenseVector< Real > &inp_vector, std::string var_name) |
Get the reduced solution for a given parameter sample and reconstruct the approximate solution into a given vector. More... | |
const std::vector< DenseVector< Real > > & | getApproximateSolution () const |
Get a reference to the approximate solutions. More... | |
Real | getNodalQoI (std::string var_name, unsigned int qoi_type) const |
Get the nodal QoI of the reconstructed solution for a given variable. More... | |
virtual Real | evaluate (const std::vector< Real > &x) const |
Evaluate surrogate model given a row of parameters. 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 |
T & | getSampler (const std::string &name) |
Sampler & | getSampler (const std::string &name) |
T & | getSamplerByName (const SamplerName &name) |
Sampler & | getSamplerByName (const SamplerName &name) |
template<> | |
SurrogateModel & | getSurrogateModel (const std::string &name) const |
template<> | |
SurrogateTrainerBase & | getSurrogateTrainer (const std::string &name) const |
template<> | |
SurrogateModel & | getSurrogateModelByName (const UserObjectName &name) const |
template<> | |
SurrogateTrainerBase & | getSurrogateTrainerByName (const UserObjectName &name) 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... | |
virtual void | evaluate (const std::vector< Real > &x, std::vector< Real > &y) const |
Various evaluate methods that can be overriden. More... | |
virtual Real | evaluate (const std::vector< Real > &x, Real &std) const |
Evaluate methods that also return predicted standard deviation (see GaussianProcess.h) More... | |
virtual void | evaluate (const std::vector< Real > &x, std::vector< Real > &y, std::vector< Real > &) const |
template<typename T = SurrogateModel> | |
T & | getSurrogateModel (const std::string &name) const |
Get a SurrogateModel/Trainer with a given name. More... | |
template<typename T = SurrogateTrainerBase> | |
T & | getSurrogateTrainer (const std::string &name) const |
template<typename T = SurrogateModel> | |
T & | getSurrogateModelByName (const UserObjectName &name) const |
Get a sampler with a given name. More... | |
template<typename T = SurrogateTrainerBase> | |
T & | getSurrogateTrainerByName (const UserObjectName &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 () |
static MooseEnum | defaultPredictorTypes () |
static MooseEnum | defaultResponseTypes () |
Public Attributes | |
const ConsoleStream | _console |
Protected Member Functions | |
void | initializeReducedSystem () |
Initialize reduced matrices, vectors and additional containers. More... | |
void | initializeApproximateSolution () |
Initialize approximate solution vector. More... | |
void | solveReducedSystem (const std::vector< Real > ¶ms) |
Assemble and solve the reduced equation system. More... | |
void | reconstructApproximateSolution () |
Reconstruct the approximate solution vector using the stored coefficients. More... | |
void | reconstructApproximateSolution (DenseVector< Real > &inp_vector, std::string var_name) |
Reconstruct the approximate solution vector into an input vector. More... | |
Protected Attributes | |
std::vector< std::string > | _change_rank |
A vector containing the number of basis functions each variable should use. More... | |
std::vector< unsigned int > | _new_ranks |
The new rank the variable should have. More... | |
std::vector< unsigned int > | _final_ranks |
The final rank that should be used for every variable. More... | |
std::vector< unsigned int > | _comulative_ranks |
Comulative ranks of the system. Used for indexing only. More... | |
const std::vector< std::string > & | _var_names |
Vector containing the names of the variables we want to reconstruct. More... | |
const std::vector< std::string > & | _tag_types |
Strings describing which operator is indepedent of the solution and which corresponds to a reduced DirichletBC operator. More... | |
const std::vector< std::vector< DenseVector< Real > > > & | _base |
The basis vectors for all the variables. More... | |
const std::vector< DenseMatrix< Real > > & | _red_operators |
The reduced operators in the same order as given in tag_types. More... | |
DenseVector< Real > | _coeffs |
Coefficients of the reduced order model. More... | |
DenseMatrix< Real > | _sys_mx |
The reduced system matrix. More... | |
DenseVector< Real > | _rhs |
The reduced right hand side. More... | |
std::vector< DenseVector< Real > > | _approx_solution |
Reconstructed solution for each variable. More... | |
const Real | _penalty |
Penalty parameter for Dirichlet BCs. More... | |
bool | _initialized |
Switch that is set to see if the ROM matrices and vectors are initialized. 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 |
Definition at line 14 of file PODReducedBasisSurrogate.h.
PODReducedBasisSurrogate::PODReducedBasisSurrogate | ( | const InputParameters & | parameters | ) |
Definition at line 31 of file PODReducedBasisSurrogate.C.
|
inherited |
Declare model data for loading from file as well as restart.
Definition at line 78 of file RestartableModelInterface.h.
|
inlinestaticinherited |
Definition at line 27 of file SurrogateModel.h.
|
inlinestaticinherited |
Definition at line 28 of file SurrogateModel.h.
Referenced by EvaluateSurrogate::validParams().
Evaluate surrogate model given a row of parameters.
Reimplemented in LibtorchANNSurrogate, PolynomialChaos, GaussianProcessSurrogate, PolynomialRegressionSurrogate, and NearestPointSurrogate.
Definition at line 33 of file SurrogateModel.h.
Referenced by SurrogateModelScalarAux::computeValue(), SurrogateTrainer::evaluateModelError(), BiFidelityActiveLearningGPDecision::facilitateDecision(), and ActiveLearningGPDecision::facilitateDecision().
|
inlinevirtualinherited |
Various evaluate methods that can be overriden.
Reimplemented in GaussianProcessSurrogate, PolynomialRegressionSurrogate, and NearestPointSurrogate.
Definition at line 43 of file SurrogateModel.h.
|
inlinevirtualinherited |
Evaluate methods that also return predicted standard deviation (see GaussianProcess.h)
Reimplemented in GaussianProcessSurrogate.
Definition at line 53 of file SurrogateModel.h.
|
inlinevirtualinherited |
Reimplemented in GaussianProcessSurrogate.
Definition at line 59 of file SurrogateModel.h.
Get the reduced solution for a given parameter sample.
Definition at line 56 of file PODReducedBasisSurrogate.C.
void PODReducedBasisSurrogate::evaluateSolution | ( | const std::vector< Real > & | params, |
DenseVector< Real > & | inp_vector, | ||
std::string | var_name | ||
) |
Get the reduced solution for a given parameter sample and reconstruct the approximate solution into a given vector.
Definition at line 74 of file PODReducedBasisSurrogate.C.
|
inline |
Get a reference to the approximate solutions.
Definition at line 31 of file PODReducedBasisSurrogate.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.
Get the nodal QoI of the reconstructed solution for a given variable.
Definition at line 255 of file PODReducedBasisSurrogate.C.
|
inherited |
Definition at line 46 of file SurrogateModelInterface.C.
|
inherited |
Get a SurrogateModel/Trainer with a given name.
name | The name of the parameter key of the sampler to retrieve |
Definition at line 81 of file SurrogateModelInterface.h.
Referenced by SurrogateTrainer::initialize().
|
inherited |
Definition at line 31 of file SurrogateModelInterface.C.
|
inherited |
Get a sampler with a given name.
name | The name of the sampler to retrieve |
Definition at line 88 of file SurrogateModelInterface.h.
Referenced by CrossValidationScores::CrossValidationScores(), EvaluateSurrogate::EvaluateSurrogate(), and InverseMapping::initialSetup().
|
inherited |
Definition at line 104 of file SurrogateModelInterface.h.
|
inherited |
Definition at line 60 of file SurrogateModelInterface.C.
|
inherited |
Definition at line 53 of file SurrogateModelInterface.C.
|
inherited |
Definition at line 111 of file SurrogateModelInterface.h.
Referenced by SurrogateTrainerOutput::output().
|
inherited |
Check if we need to load model data (if the filename parameter is used)
Definition at line 39 of file RestartableModelInterface.C.
|
protected |
Initialize approximate solution vector.
Definition at line 135 of file PODReducedBasisSurrogate.C.
Referenced by evaluateSolution().
|
protected |
Initialize reduced matrices, vectors and additional containers.
Definition at line 93 of file PODReducedBasisSurrogate.C.
Referenced by evaluateSolution().
|
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().
|
protected |
Reconstruct the approximate solution vector using the stored coefficients.
Definition at line 204 of file PODReducedBasisSurrogate.C.
Referenced by evaluateSolution().
|
protected |
Reconstruct the approximate solution vector into an input vector.
Definition at line 223 of file PODReducedBasisSurrogate.C.
Assemble and solve the reduced equation system.
Definition at line 143 of file PODReducedBasisSurrogate.C.
Referenced by evaluateSolution().
|
static |
Definition at line 15 of file PODReducedBasisSurrogate.C.
|
protected |
Reconstructed solution for each variable.
Definition at line 89 of file PODReducedBasisSurrogate.h.
Referenced by getApproximateSolution(), getNodalQoI(), initializeApproximateSolution(), and reconstructApproximateSolution().
|
protected |
The basis vectors for all the variables.
Definition at line 74 of file PODReducedBasisSurrogate.h.
Referenced by initializeApproximateSolution(), initializeReducedSystem(), and reconstructApproximateSolution().
|
protected |
A vector containing the number of basis functions each variable should use.
This is optional, used only to override the base numbers from the training data.
Definition at line 55 of file PODReducedBasisSurrogate.h.
Referenced by initializeReducedSystem(), and PODReducedBasisSurrogate().
|
protected |
Coefficients of the reduced order model.
Definition at line 80 of file PODReducedBasisSurrogate.h.
Referenced by initializeReducedSystem(), reconstructApproximateSolution(), and solveReducedSystem().
|
protected |
Comulative ranks of the system. Used for indexing only.
Definition at line 64 of file PODReducedBasisSurrogate.h.
Referenced by initializeReducedSystem(), reconstructApproximateSolution(), and solveReducedSystem().
|
protected |
The final rank that should be used for every variable.
Definition at line 61 of file PODReducedBasisSurrogate.h.
Referenced by initializeReducedSystem(), and reconstructApproximateSolution().
|
protected |
Switch that is set to see if the ROM matrices and vectors are initialized.
Definition at line 95 of file PODReducedBasisSurrogate.h.
Referenced by evaluateSolution().
|
protected |
The new rank the variable should have.
Definition at line 58 of file PODReducedBasisSurrogate.h.
Referenced by initializeReducedSystem(), and PODReducedBasisSurrogate().
|
protected |
Penalty parameter for Dirichlet BCs.
Definition at line 92 of file PODReducedBasisSurrogate.h.
Referenced by solveReducedSystem().
|
protected |
The reduced operators in the same order as given in tag_types.
Definition at line 77 of file PODReducedBasisSurrogate.h.
Referenced by solveReducedSystem().
|
protected |
The reduced right hand side.
Definition at line 86 of file PODReducedBasisSurrogate.h.
Referenced by initializeReducedSystem(), and solveReducedSystem().
|
protected |
The reduced system matrix.
Definition at line 83 of file PODReducedBasisSurrogate.h.
Referenced by initializeReducedSystem(), and solveReducedSystem().
|
protected |
Strings describing which operator is indepedent of the solution and which corresponds to a reduced DirichletBC operator.
Definition at line 71 of file PODReducedBasisSurrogate.h.
Referenced by solveReducedSystem().
|
protected |
Vector containing the names of the variables we want to reconstruct.
Definition at line 67 of file PODReducedBasisSurrogate.h.
Referenced by getNodalQoI(), initializeApproximateSolution(), initializeReducedSystem(), reconstructApproximateSolution(), and solveReducedSystem().