60 #if !defined(LIBMESH_HAVE_SLEPC) 61 libmesh_example_requires(
false,
"--enable-slepc");
64 #if !defined(LIBMESH_HAVE_XDR) 66 libmesh_example_requires(
false,
"--enable-xdr");
67 #elif defined(LIBMESH_DEFAULT_SINGLE_PRECISION) 69 libmesh_example_requires(
false,
"--disable-singleprecision");
75 libmesh_example_requires(2 <= LIBMESH_DIM,
"2D support");
77 #ifndef LIBMESH_ENABLE_DIRICHLET 78 libmesh_example_requires(
false,
"--enable-dirichlet");
82 std::string parameters_filename =
"reduced_basis_ex3.in";
83 GetPot infile(parameters_filename);
86 infile.parse_command_line(argc, argv);
88 unsigned int n_elem = infile(
"n_elem", 1);
89 const unsigned int dim = 2;
91 bool store_basis_functions = infile(
"store_basis_functions",
true);
114 equation_systems.
init ();
117 equation_systems.print_info();
148 #if defined(LIBMESH_HAVE_CAPNPROTO) 150 rb_eval_writer.write_to_file(
"trans_rb_eval.bin");
152 rb_eval.legacy_write_offline_data_to_files();
156 if (store_basis_functions)
165 #if defined(LIBMESH_HAVE_CAPNPROTO) 167 rb_eval_reader.read_from_file(
"trans_rb_eval.bin",
true);
169 rb_eval.legacy_read_offline_data_from_files();
173 unsigned int online_N = infile(
"online_N", 1);
174 Real online_x_vel = infile(
"online_x_vel", 0.);
175 Real online_y_vel = infile(
"online_y_vel", 0.);
177 online_mu.
set_value(
"x_vel", online_x_vel);
178 online_mu.
set_value(
"y_vel", online_y_vel);
179 rb_eval.set_parameters(online_mu);
180 rb_eval.print_parameters();
183 Real error_bound_final_time = rb_eval.rb_solve(online_N);
185 libMesh::out <<
"Error bound (absolute) at the final time is " 186 << error_bound_final_time << std::endl << std::endl;
188 if (store_basis_functions)
191 rb_eval.read_in_basis_functions(rb_con);
194 rb_con.pull_temporal_discretization_data(rb_eval);
195 rb_con.set_time_step(rb_con.get_n_time_steps());
197 #ifdef LIBMESH_HAVE_EXODUS_API 204 #ifdef LIBMESH_HAVE_EXODUS_API 210 #endif // LIBMESH_ENABLE_DIRICHLET 214 #endif // LIBMESH_HAVE_SLEPC virtual void initialize_rb_construction(bool skip_matrix_assembly=false, bool skip_vector_assembly=false)
Allocate all the data structures necessary for the construction stage of the RB method.
T command_line_next(std::string name, T default_value)
Use GetPot's search()/next() functions to get following arguments from the command line...
This is the EquationSystems class.
virtual void write_out_basis_functions(System &sys, const std::string &directory_name="offline_data", const bool write_binary_basis_functions=true)
Write out all the basis functions to file.
This class de-serializes a TransientRBEvaluation object using the Cap'n Proto library.
virtual Real train_reduced_basis(const bool resize_rb_eval_data=true)
Train the reduced basis.
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
This class serializes a TransientRBEvaluation object using the Cap'n Proto library.
const Parallel::Communicator & comm() const
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
void init()
Initializes degrees of freedom on the current mesh.
virtual void print_info() const
Print out info that describes the current setup of this RBConstruction.
SolverPackage default_solver_package()
virtual void load_basis_function(unsigned int i)
Load the i^th RB function into the RBConstruction solution vector.
virtual void write_equation_systems(const std::string &fname, const EquationSystems &es, const std::set< std::string > *system_names=nullptr) override
Writes out the solution for no specific time or timestep.
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
This class is part of the rbOOmit framework.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_value(const std::string ¶m_name, Real value)
Set the value of the specified parameter.
virtual void process_parameters_file(const std::string ¶meters_filename)
Read in from the file specified by parameters_filename and set the this system's member variables acc...
RBEvaluation & get_rb_evaluation()
Get a reference to the RBEvaluation object.
virtual void load_rb_solution()
Load the RB solution from the most recent solve with rb_eval into this system's solution vector...
void set_rb_evaluation(RBEvaluation &rb_eval_in)
Set the RBEvaluation object.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.