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 {
37  {
38  // In this case the parameters related to the EIM are a subset of
39  // the parameters from the associated RB problem, hence we need to "pull out"
40  // the parameters related to the EIM
41  RBParameters mu_eim;
42  for (const auto & pr : rb_eim_eval.get_parameters())
43  {
44  const std::string & param_name = pr.first;
45  mu_eim.set_value(param_name, mu.get_value(param_name));
46  }
48  }
49  else
50  {
52  }
53 
55 
57 }
58 
59 }
libMesh::RBEvaluation::get_n_basis_functions
virtual unsigned int get_n_basis_functions() const
Get the current number of basis functions.
Definition: rb_evaluation.h:145
libMesh::Number
Real Number
Definition: libmesh_common.h:195
libMesh::RBEIMEvaluation::rb_solve
virtual Real rb_solve(unsigned int N) override
Calculate the EIM approximation to parametrized_function using the first N EIM basis functions.
Definition: rb_eim_evaluation.C:113
libMesh::RBParametrized::get_n_params
unsigned int get_n_params() const
Get the number of parameters.
Definition: rb_parametrized.C:115
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::RBParameters
This class is part of the rbOOmit framework.
Definition: rb_parameters.h:42
libMesh::RBParametrized::set_parameters
void set_parameters(const RBParameters &params)
Set the current parameters to params.
Definition: rb_parametrized.C:155
libMesh::RBEIMTheta::index
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:67
libMesh::RBParameters::n_parameters
unsigned int n_parameters() const
Get the number of parameters that have been added.
Definition: rb_parameters.C:63
libMesh::RBParametrized::get_parameters
const RBParameters & get_parameters() const
Get the current parameters.
Definition: rb_parametrized.C:166
libMesh::RBEvaluation::RB_solution
DenseVector< Number > RB_solution
The RB solution vector.
Definition: rb_evaluation.h:270
libMesh::RBParameters::set_value
void set_value(const std::string &param_name, Real value)
Set the value of the specified parameter.
Definition: rb_parameters.C:47
libMesh::RBEIMEvaluation
This class is part of the rbOOmit framework.
Definition: rb_eim_evaluation.h:51
libMesh::RBEIMTheta::RBEIMTheta
RBEIMTheta(RBEIMEvaluation &rb_eim_eval_in, unsigned int index_in)
Constructor.
Definition: rb_eim_theta.C:27
libMesh::RBEIMTheta::evaluate
virtual Number evaluate(const RBParameters &mu) override
Evaluate this RBEIMTheta object at the parameter mu.
Definition: rb_eim_theta.C:34
libMesh::RBEIMTheta::rb_eim_eval
RBEIMEvaluation & rb_eim_eval
The RBEIMEvaluation object that this RBEIMTheta is based on.
Definition: rb_eim_theta.h:61
libMesh::RBParameters::get_value
Real get_value(const std::string &param_name) const
Get the value of the specific parameter.
Definition: rb_parameters.C:41