libMesh
rb_scm_construction.h
Go to the documentation of this file.
1 // rbOOmit: An implementation of the Certified Reduced Basis method.
2 // Copyright (C) 2009, 2010 David J. Knezevic
3 
4 // This file is part of rbOOmit.
5 
6 // rbOOmit is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 
11 // rbOOmit is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20 #ifndef LIBMESH_RB_SCM_CONSTRUCTION_H
21 #define LIBMESH_RB_SCM_CONSTRUCTION_H
22 
23 // Configuration data
24 #include "libmesh/libmesh_config.h"
25 
26 // Currently, the RBSCMConstruction is only usable
27 // if SLEPc is enabled.
28 #if defined(LIBMESH_HAVE_SLEPC) && (LIBMESH_HAVE_GLPK)
29 
30 // rbOOmit includes
31 #include "libmesh/rb_construction_base.h"
32 
33 // libMesh includes
34 #include "libmesh/condensed_eigen_system.h"
35 
36 // C++ includes
37 
38 namespace libMesh
39 {
40 
41 // Forward declarations
42 class RBSCMEvaluation;
43 
53 class RBSCMConstruction : public RBConstructionBase<CondensedEigenSystem>
54 {
55 public:
56 
62  const std::string & name_in,
63  const unsigned int number_in);
64 
68  virtual ~RBSCMConstruction ();
69 
74 
79 
84  virtual void clear () libmesh_override;
85 
89  void set_rb_scm_evaluation(RBSCMEvaluation & rb_scm_eval_in);
90 
95 
100 
105  virtual void resize_SCM_vectors ();
106 
111  virtual void process_parameters_file(const std::string & parameters_filename);
112 
116  virtual void print_info();
117 
127  virtual void set_eigensolver_properties(int) {}
128 
133  void set_RB_system_name(const std::string & new_name)
134  { RB_system_name = new_name; }
135 
140  void set_SCM_training_tolerance(Real SCM_training_tolerance_in) { this->SCM_training_tolerance = SCM_training_tolerance_in; }
141 
146  virtual void perform_SCM_greedy();
147 
156  virtual void attach_deflation_space() {}
157 
158 protected:
159 
164  virtual void add_scaled_symm_Aq(unsigned int q_a, Number scalar);
165 
171  virtual void load_matrix_B();
172 
176  virtual void compute_SCM_bounding_box();
177 
183  virtual void evaluate_stability_constant();
184 
189  virtual void enrich_C_J(unsigned int new_C_J_index);
190 
197  virtual std::pair<unsigned int,Real> compute_SCM_bounds_on_training_set();
198 
204 
209  Number Aq_inner_product(unsigned int q,
210  const NumericVector<Number> & v,
211  const NumericVector<Number> & w);
212 
218  virtual Real SCM_greedy_error_indicator(Real LB, Real UB) { return fabs(UB-LB)/fabs(UB); }
219 
220  //----------- PROTECTED DATA MEMBERS -----------//
221 
226 
230  std::string RB_system_name;
231 
232 private:
233 
239 };
240 
241 } // namespace libMesh
242 
243 #endif // LIBMESH_HAVE_SLEPC && LIBMESH_HAVE_GLPK
244 
245 #endif // LIBMESH_RB_SCM_CONSTRUCTION_H
This is the EquationSystems class.
Number Aq_inner_product(unsigned int q, const NumericVector< Number > &v, const NumericVector< Number > &w)
Compute the inner product between two vectors using matrix Aq.
virtual void clear() libmesh_override
Clear all the data structures associated with the system.
virtual void enrich_C_J(unsigned int new_C_J_index)
Enrich C_J by adding the element of SCM_training_samples that has the largest gap between alpha_LB an...
virtual void evaluate_stability_constant()
Compute the stability constant for current_parameters by solving a generalized eigenvalue problem ove...
virtual ~RBSCMConstruction()
Destructor.
The libMesh namespace provides an interface to certain functionality in the library.
RBSCMEvaluation * rb_scm_eval
The current RBSCMEvaluation object we are using to perform the Evaluation stage of the SCM...
This class stores the set of RBTheta functor objects that define the "parameter-dependent expansion" ...
Real SCM_training_tolerance
Tolerance which controls when to terminate the SCM Greedy.
virtual void print_info()
Print out info that describes the current setup of this RBSCMConstruction.
void set_rb_scm_evaluation(RBSCMEvaluation &rb_scm_eval_in)
Set the RBSCMEvaluation object.
virtual void load_matrix_B()
Copy over the matrix to store in matrix_B, usually this is the mass or inner-product matrix...
This class is part of the rbOOmit framework.
std::string RB_system_name
The name of the associated RB system.
Number B_inner_product(const NumericVector< Number > &v, const NumericVector< Number > &w) const
Compute the inner product between two vectors using the system&#39;s matrix_B.
virtual Real SCM_greedy_error_indicator(Real LB, Real UB)
Helper function which provides an error indicator to be used in the SCM greedy.
virtual void attach_deflation_space()
Attach the deflation space defined by the specified vector, can be useful in solving constrained eige...
virtual void set_eigensolver_properties(int)
This function is called before truth eigensolves in compute_SCM_bounding_box and evaluate_stability_c...
RBSCMConstruction(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Constructor.
RBThetaExpansion & get_rb_theta_expansion()
Get a reference to the RBThetaExpansion object.
virtual std::pair< unsigned int, Real > compute_SCM_bounds_on_training_set()
Compute upper and lower bounds for each SCM training point.
virtual void process_parameters_file(const std::string &parameters_filename)
Read in the parameters from file specified by parameters_filename and set the this system&#39;s member va...
virtual void resize_SCM_vectors()
Clear and resize the SCM data vectors.
void set_SCM_training_tolerance(Real SCM_training_tolerance_in)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void perform_SCM_greedy()
Perform the SCM greedy algorithm to develop a lower bound over the training set.
virtual void add_scaled_symm_Aq(unsigned int q_a, Number scalar)
Add the scaled symmetrized affine matrix from the associated RBSystem to matrix_A.
virtual void compute_SCM_bounding_box()
Compute the SCM bounding box.
RBSCMEvaluation & get_rb_scm_evaluation()
Get a reference to the RBSCMEvaluation object.
RBConstructionBase< CondensedEigenSystem > Parent
The type of the parent.
This class is part of the rbOOmit framework.
void set_RB_system_name(const std::string &new_name)
Set the name of the associated RB system — we need this to load the (symmetrized) affine operators...
RBSCMConstruction sys_type
The type of system.
Real get_SCM_training_tolerance() const
Get/set SCM_training_tolerance: tolerance for SCM greedy.
This class is part of the rbOOmit framework.