libMesh
rb_eim_theta.C
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 #include "libmesh/rb_eim_theta.h"
21 #include "libmesh/rb_parameters.h"
22 #include "libmesh/rb_eim_evaluation.h"
23 
24 namespace libMesh
25 {
26 
27 RBEIMTheta::RBEIMTheta(RBEIMEvaluation & rb_eim_eval_in, unsigned int index_in)
28  :
29  rb_eim_eval(rb_eim_eval_in),
30  index(index_in)
31 {
32 }
33 
35 {
36  std::vector<RBParameters> mus {mu};
37  std::vector<Number> values = evaluate_vec(mus);
38 
39  libmesh_error_msg_if(values.size() != 1, "Error: should have one value");
40  return values[0];
41 }
42 
43 std::vector<Number> RBEIMTheta::evaluate_vec(const std::vector<RBParameters> & mus)
44 {
48 
50 }
51 
52 }
void set_eim_error_indicator_active(bool is_active)
Activate/decative the error indicator in EIM solves.
void rb_eim_solves(const std::vector< RBParameters > &mus, unsigned int N)
Perform rb_eim_solves at each mu in mus and store the results in _rb_eim_solutions.
virtual std::vector< Number > evaluate_vec(const std::vector< RBParameters > &mus) override
Evaluate this RBEIMTheta at all parameters in mus.
Definition: rb_eim_theta.C:43
virtual Number evaluate(const RBParameters &mu) override
Evaluate this RBEIMTheta object at the parameter mu.
Definition: rb_eim_theta.C:34
unsigned int get_n_basis_functions() const
Return the current number of EIM basis functions.
std::vector< Number > get_rb_eim_solutions_entries(unsigned int index) const
Return entry index for each solution in _rb_eim_solutions.
unsigned int index
The index of the RB_solution vector that we pick out from rb_eim_eval to provide the value of the eva...
Definition: rb_eim_theta.h:83
The libMesh namespace provides an interface to certain functionality in the library.
RBEIMEvaluation & rb_eim_eval
The RBEIMEvaluation object that this RBEIMTheta is based on.
Definition: rb_eim_theta.h:77
RBEIMTheta(RBEIMEvaluation &rb_eim_eval_in, unsigned int index_in)
Constructor.
Definition: rb_eim_theta.C:27
This class is part of the rbOOmit framework.
Definition: rb_parameters.h:52
This class enables evaluation of an Empirical Interpolation Method (EIM) approximation.