1 #include "assemble_ECSW_training_data_base.h" 4 #include "flow_solver/flow_solver.h" 5 #include "flow_solver/flow_solver_factory.h" 8 namespace HyperReduction {
11 template <
int dim,
int nstate>
14 const dealii::ParameterHandler ¶meter_handler_input,
17 MatrixXd snapshot_parameters_input,
20 : all_parameters(parameters_input)
21 , parameter_handler(parameter_handler_input)
24 , snapshot_parameters(snapshot_parameters_input)
25 , mpi_communicator(MPI_COMM_WORLD)
26 , mpi_rank(dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD))
27 , pcout(
std::cout, mpi_rank==0)
28 , ode_solver_type(ode_solver_type)
30 , A_T(
std::make_shared<dealii::TrilinosWrappers::SparseMatrix>())
35 template <
int dim,
int nstate>
39 return std::make_shared<Epetra_CrsMatrix>(pod_basis);
42 Epetra_Map system_matrix_rowmap = system_matrix.RowMap();
43 Epetra_CrsMatrix petrov_galerkin_basis(Epetra_DataAccess::Copy, system_matrix_rowmap, pod_basis.NumGlobalCols());
44 EpetraExt::MatrixMatrix::Multiply(system_matrix,
false, pod_basis,
false, petrov_galerkin_basis,
true);
46 return std::make_shared<Epetra_CrsMatrix>(petrov_galerkin_basis);
53 template <
int dim,
int nstate>
61 if (flow_type == FlowCaseEnum::burgers_rewienski_snapshot){
75 else if (flow_type == FlowCaseEnum::naca0012){
89 else if (flow_type == FlowCaseEnum::gaussian_bump){
97 pcout <<
"Invalid flow case. You probably forgot to specify a flow case in the prm file." << std::endl;
103 template <
int dim,
int nstate>
108 template <
int dim,
int nstate>
110 MatrixXd snapshot_parameters_update) {
111 this->
pod = pod_update;
FlowCaseType
Selects the flow case to be simulated.
std::vector< dealii::LinearAlgebra::distributed::Vector< double > > fom_locations
Vector of parameter-ROMTestLocation pairs.
FlowCaseType flow_case_type
Selected FlowCaseType from the input file.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
std::vector< std::string > parameter_names
Names of parameters.
MatrixXd snapshot_parameters
Matrix of snapshot parameters.
double mach_inf
Mach number at infinity.
void update_snapshots(dealii::LinearAlgebra::distributed::Vector< double > fom_solution)
Update POD and Snapshot Parameters.
Files for the baseline physics.
ReducedOrderModelParam reduced_order_param
Contains parameters for the Reduced-Order model.
EulerParam euler_param
Contains parameters for the Euler equations non-dimensionalization.
ODESolverEnum
Types of ODE solver.
Main parameter class that contains the various other sub-parameter classes.
std::shared_ptr< ProperOrthogonalDecomposition::PODBase< dim > > pod
POD.
Parameters::ODESolverParam::ODESolverEnum ode_solver_type
ODE Solve Type/ Projection Type (galerkin or petrov-galerkin)
double angle_of_attack
Input file provides in degrees, but the value stored here is in radians.
std::shared_ptr< Epetra_CrsMatrix > local_generate_test_basis(Epetra_CrsMatrix &system_matrix, const Epetra_CrsMatrix &pod_basis)
Generate Test Basis from the pod and snapshot info depending on the ode_solve_type (copied from the O...
AssembleECSWBase(const PHiLiP::Parameters::AllParameters *const parameters_input, const dealii::ParameterHandler ¶meter_handler_input, std::shared_ptr< DGBase< dim, double >> &dg_input, std::shared_ptr< ProperOrthogonalDecomposition::PODBase< dim >> pod, MatrixXd snapshot_parameters_input, Parameters::ODESolverParam::ODESolverEnum ode_solver_type, Epetra_MpiComm &Comm)
Constructor.
const Parameters::AllParameters *const all_parameters
Pointer to all parameters.
void update_POD_snaps(std::shared_ptr< ProperOrthogonalDecomposition::PODBase< dim >> pod_update, MatrixXd snapshot_parameters_update)
Update POD and Snapshot Parameters.
dealii::ConditionalOStream pcout
ConditionalOStream.
DGBase is independent of the number of state variables.
Parameters::AllParameters reinit_params(const RowVectorXd ¶meter) const
Reinitialize parameters.
BurgersParam burgers_param
Contains parameters for Burgers equation.