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 // rbOOmit includes
21 #include "libmesh/rb_eim_assembly.h"
22 #include "libmesh/rb_eim_construction.h"
23
24 // libMesh includes
25 #include "libmesh/fem_context.h"
26 #include "libmesh/dof_map.h"
27 #include "libmesh/quadrature.h"
28 #include "libmesh/libmesh_logging.h"
29 #include "libmesh/int_range.h"
30
31 namespace libMesh
32 {
33
RBEIMAssembly(RBEIMConstruction & rb_eim_con,unsigned int basis_function_index_in)34 RBEIMAssembly::RBEIMAssembly(RBEIMConstruction & rb_eim_con,
35 unsigned int basis_function_index_in)
36 :
37 _rb_eim_con(rb_eim_con),
38 _basis_function_index(basis_function_index_in)
39 {
40 }
41
42 RBEIMAssembly::~RBEIMAssembly() = default;
43
evaluate_basis_function(dof_id_type elem_id,unsigned int comp,std::vector<Number> & values)44 void RBEIMAssembly::evaluate_basis_function(dof_id_type elem_id,
45 unsigned int comp,
46 std::vector<Number> & values)
47 {
48 get_rb_eim_construction().get_rb_eim_evaluation().get_eim_basis_function_values_at_qps(
49 _basis_function_index, elem_id, comp, values);
50
51 libmesh_error_msg_if(values.empty(), "Error: EIM basis function has no entries on this element for this processor");
52 }
53
get_rb_eim_construction()54 RBEIMConstruction & RBEIMAssembly::get_rb_eim_construction()
55 {
56 return _rb_eim_con;
57 }
58
59 }
60