Chi-Tech
chi_meshcontinuum_vertexhandler.h
Go to the documentation of this file.
1#ifndef CHI_MESHCONTINUUM_VERTEXHANDLER_H
2#define CHI_MESHCONTINUUM_VERTEXHANDLER_H
3
5
6#include <map>
7
8namespace chi_mesh
9{
10
11/**Manages a vertex map with custom calls.*/
13{
14 typedef std::map<uint64_t, chi_mesh::Vector3> GlobalIDMap;
15private:
16 std::map<uint64_t, chi_mesh::Vector3> m_global_id_vertex_map;
17
18public:
19 // Iterators
20 GlobalIDMap::iterator begin() {return m_global_id_vertex_map.begin();}
21 GlobalIDMap::iterator end() {return m_global_id_vertex_map.end();}
22
23 GlobalIDMap::const_iterator begin() const {return m_global_id_vertex_map.begin();}
24 GlobalIDMap::const_iterator end() const {return m_global_id_vertex_map.end();}
25
26 // Accessors
27 chi_mesh::Vector3& operator[](const uint64_t global_id)
28 {
29 return m_global_id_vertex_map.at(global_id);
30 }
31
32 const chi_mesh::Vector3& operator[](const uint64_t global_id) const
33 {
34 return m_global_id_vertex_map.at(global_id);
35 }
36
37 // Utilities
38 void Insert(const uint64_t global_id, const chi_mesh::Vector3& vec)
39 {
40 m_global_id_vertex_map.insert(std::make_pair(global_id, vec));
41 }
42
43 size_t NumLocallyStored() const
44 {
45 return m_global_id_vertex_map.size();
46 }
47
48 void Clear()
49 {
51 }
52};
53
54}//namespace chi_mesh
55
56#endif //CHI_MESHCONTINUUM_VERTEXHANDLER_H
chi_mesh::Vector3 & operator[](const uint64_t global_id)
std::map< uint64_t, chi_mesh::Vector3 > m_global_id_vertex_map
const chi_mesh::Vector3 & operator[](const uint64_t global_id) const
void Insert(const uint64_t global_id, const chi_mesh::Vector3 &vec)
GlobalIDMap::const_iterator end() const
GlobalIDMap::const_iterator begin() const
std::map< uint64_t, chi_mesh::Vector3 > GlobalIDMap