$extrastylesheet
transient_rb_evaluation.h
Go to the documentation of this file.
00001 // rbOOmit: An implementation of the Certified Reduced Basis method.
00002 // Copyright (C) 2009, 2010 David J. Knezevic
00003 
00004 // This file is part of rbOOmit.
00005 
00006 // rbOOmit is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License, or (at your option) any later version.
00010 
00011 // rbOOmit is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 #ifndef LIBMESH_TRANSIENT_RB_EVALUATION_H
00021 #define LIBMESH_TRANSIENT_RB_EVALUATION_H
00022 
00023 // rbOOmit includes
00024 #include "libmesh/rb_evaluation.h"
00025 #include "libmesh/rb_temporal_discretization.h"
00026 
00027 // libMesh includes
00028 
00029 // C++ includes
00030 
00031 namespace libMesh
00032 {
00033 
00034 class TransientRBThetaExpansion;
00035 
00051 // ------------------------------------------------------------
00052 // TransientRBEvaluation class definition
00053 
00054 class TransientRBEvaluation : public RBEvaluation, public RBTemporalDiscretization
00055 {
00056 public:
00057 
00061   TransientRBEvaluation (const Parallel::Communicator &comm_in
00062                          LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
00063 
00067   ~TransientRBEvaluation ();
00068 
00072   typedef RBEvaluation Parent;
00073 
00078   virtual void clear();
00079 
00087   virtual void resize_data_structures(const unsigned int Nmax,
00088                                       bool resize_error_bound_data=true);
00089 
00095   virtual Real rb_solve(unsigned int N);
00096 
00102   virtual Real rb_solve_again();
00103 
00107   virtual Real get_rb_solution_norm();
00108 
00114   virtual Real residual_scaling_numer(Real alpha_LB);
00115 
00121   virtual Real compute_residual_dual_norm(const unsigned int N);
00122 
00129   virtual Real uncached_compute_residual_dual_norm(const unsigned int N);
00130 
00136   void cache_online_residual_terms(const unsigned int N);
00137 
00144   virtual void clear_riesz_representors();
00145 
00150   virtual void write_offline_data_to_files(const std::string& directory_name = "offline_data",
00151                                            const bool write_binary_data=true);
00152 
00157   virtual void read_offline_data_from_files(const std::string& directory_name = "offline_data",
00158                                             bool read_error_bound_data=true,
00159                                             const bool read_binary_data=true);
00160 
00161   //----------- PUBLIC DATA MEMBERS -----------//
00162 
00166   DenseMatrix<Number> RB_L2_matrix;
00167 
00171   DenseMatrix<Number> RB_LHS_matrix;
00172   DenseMatrix<Number> RB_RHS_matrix;
00173   DenseVector<Number> RB_RHS_save;
00174 
00178   std::vector< DenseMatrix<Number> > RB_M_q_vector;
00179 
00184   std::vector< std::vector<Number> > RB_outputs_all_k;
00185 
00190   std::vector< std::vector<Real> > RB_output_error_bounds_all_k;
00191 
00195   DenseVector<Number> old_RB_solution;
00196 
00200   std::vector< DenseVector<Number> > RB_temporal_solution_data;
00201 
00206   std::vector< Real > error_bound_all_k;
00207 
00212   std::vector<Real> initial_L2_error_all_N;
00213 
00218   std::vector< DenseVector<Number> > RB_initial_condition_all_N;
00219 
00224   std::vector< std::vector< std::vector<Number> > > Fq_Mq_representor_innerprods;
00225   std::vector< std::vector< std::vector<Number> > > Mq_Mq_representor_innerprods;
00226   std::vector< std::vector< std::vector< std::vector<Number> > > > Aq_Mq_representor_innerprods;
00227 
00228 
00233   Number cached_Fq_term;
00234   DenseVector<Number> cached_Fq_Aq_vector;
00235   DenseMatrix<Number> cached_Aq_Aq_matrix;
00236   DenseVector<Number> cached_Fq_Mq_vector;
00237   DenseMatrix<Number> cached_Aq_Mq_matrix;
00238   DenseMatrix<Number> cached_Mq_Mq_matrix;
00239 
00244   std::vector< std::vector< NumericVector<Number>* > > M_q_representor;
00245 
00249   bool _rb_solve_data_cached;
00250 
00251 };
00252 
00253 }
00254 
00255 #endif // LIBMESH_TRANSIENT_RB_EVALUATION_H