MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
sub_elem_node_map.cpp
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 // MAST includes
22 
23 
25 
26 }
27 
28 
30 
31 }
32 
33 
34 
35 
36 unsigned int
37 MAST::SubElemNodeMap::count(libMesh::dof_id_type bracket_node1,
38  libMesh::dof_id_type bracket_node2) const {
39 
40  return _map.count(std::make_pair(bracket_node1, bracket_node2));
41 }
42 
43 
44 std::pair<libMesh::Node*, libMesh::Node*>&
45 MAST::SubElemNodeMap::add(libMesh::dof_id_type bracket_node1,
46  libMesh::dof_id_type bracket_node2) {
47 
48  MAST::SubElemNodeMap::map_type::iterator
49  it = _map.find(std::make_pair(bracket_node1, bracket_node2));
50 
51  if (it == _map.end()) {
52 
53  it = _map.insert(std::make_pair(std::make_pair(bracket_node1, bracket_node2),
54  std::make_pair(nullptr, nullptr))).first;
55  }
56 
57  return it->second;
58 }
59 
MAST::SubElemNodeMap::map_type _map
unsigned int count(libMesh::dof_id_type bracket_node1, libMesh::dof_id_type bracket_node2) const
std::pair< libMesh::Node *, libMesh::Node * > & add(libMesh::dof_id_type bracket_node1, libMesh::dof_id_type bracket_node2)