1 #ifndef __HYPER_REDUCED_SAMPLING_ERROR_UPDATED__ 2 #define __HYPER_REDUCED_SAMPLING_ERROR_UPDATED__ 4 #include <deal.II/numerics/vector_tools.h> 5 #include "parameters/all_parameters.h" 6 #include "pod_basis_online.h" 7 #include "hrom_test_location.h" 8 #include <eigen/Eigen/Dense> 9 #include "nearest_neighbors.h" 10 #include "adaptive_sampling_base.h" 13 using DealiiVector = dealii::LinearAlgebra::distributed::Vector<double>;
14 using Eigen::MatrixXd;
15 using Eigen::RowVectorXd;
16 using Eigen::VectorXd;
31 template <
int dim,
int nstate>
37 const dealii::ParameterHandler ¶meter_handler_input);
49 void trueErrorROM(
const MatrixXd& rom_points, Epetra_Vector weights)
const;
61 std::unique_ptr<ProperOrthogonalDecomposition::ROMSolution<dim,nstate>>
solveSnapshotROM(
const RowVectorXd& parameter, Epetra_Vector weights)
const;
70 mutable std::vector<std::unique_ptr<ProperOrthogonalDecomposition::HROMTestLocation<dim,nstate>>>
hrom_locations;
std::unique_ptr< ProperOrthogonalDecomposition::ROMSolution< dim, nstate > > solveSnapshotROM(const RowVectorXd ¶meter, Epetra_Vector weights) const
Solve reduced-order solution.
double solveSnapshotROMandFOM(const RowVectorXd ¶meter, Epetra_Vector weights) const
Solve FOM and ROM, return error in functional between the models.
HyperreducedSamplingErrorUpdated(const PHiLiP::Parameters::AllParameters *const parameters_input, const dealii::ParameterHandler ¶meter_handler_input)
Constructor.
Files for the baseline physics.
std::vector< double > rom_functional
Functional value predicted by the rom at each sammpling iteration at parameter location specified in ...
Main parameter class that contains the various other sub-parameter classes.
Hyperreduced Adaptive Sampling with the updated error indicator.
int run_sampling() const override
Run test.
Epetra_Vector allocateVectorToSingleCore(const Epetra_Vector &b) const
Copy all elements in matrix A to all cores.
bool placeROMLocations(const MatrixXd &rom_points, Epetra_Vector weights) const
Placement of ROMs.
std::vector< std::unique_ptr< ProperOrthogonalDecomposition::HROMTestLocation< dim, nstate > > > hrom_locations
Vector of parameter-HROMTestLocation pairs.
void trueErrorROM(const MatrixXd &rom_points, Epetra_Vector weights) const
Compute true/actual error at all ROM points (error in functional between FOM and ROM solution) ...
RowVectorXd getMaxErrorROM() const override
Compute RBF and find max error.
void updateNearestExistingROMs(const RowVectorXd ¶meter, Epetra_Vector weights) const
Updates nearest ROM points to snapshot if error discrepancy is above tolerance.
void outputIterationData(std::string iteration) const override
Output for each iteration.
void solveFunctionalHROM(const RowVectorXd ¶meter, Epetra_Vector weights) const
Solve HROM and track functional.
std::shared_ptr< Epetra_Vector > ptr_weights
Ptr vector of ECSW Weights.