Line data Source code
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 : 34 0 : RBEIMAssembly::RBEIMAssembly(RBEIMConstruction & rb_eim_con, 35 0 : unsigned int basis_function_index_in) 36 : : 37 0 : _rb_eim_con(rb_eim_con), 38 0 : _basis_function_index(basis_function_index_in) 39 : { 40 0 : } 41 : 42 0 : RBEIMAssembly::~RBEIMAssembly() = default; 43 : 44 0 : void RBEIMAssembly::evaluate_basis_function(dof_id_type elem_id, 45 : unsigned int comp, 46 : std::vector<Number> & values) 47 : { 48 0 : 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 0 : libmesh_error_msg_if(values.empty(), "Error: EIM basis function has no entries on this element for this processor"); 52 0 : } 53 : 54 0 : void RBEIMAssembly::evaluate_side_basis_function(dof_id_type elem_id, 55 : unsigned int side_index, 56 : unsigned int comp, 57 : std::vector<Number> & values) 58 : { 59 0 : get_rb_eim_construction().get_rb_eim_evaluation().get_eim_basis_function_side_values_at_qps( 60 : _basis_function_index, elem_id, side_index, comp, values); 61 : 62 0 : libmesh_error_msg_if(values.empty(), "Error: EIM basis function has no entries on this element for this processor"); 63 0 : } 64 : 65 0 : Number RBEIMAssembly::evaluate_node_basis_function(dof_id_type node_id, 66 : unsigned int comp) 67 : { 68 0 : return get_rb_eim_construction().get_rb_eim_evaluation().get_eim_basis_function_node_local_value( 69 0 : _basis_function_index, node_id, comp); 70 : } 71 : 72 0 : RBEIMConstruction & RBEIMAssembly::get_rb_eim_construction() 73 : { 74 0 : return _rb_eim_con; 75 : } 76 : 77 : }