Chi-Tech
chi_meshcontinuum_globalcellhandler.h
Go to the documentation of this file.
1#ifndef CHI_MESHCONTINUUM_GLOBALCELLHANDLER_H_
2#define CHI_MESHCONTINUUM_GLOBALCELLHANDLER_H_
3
4#include "mesh/Cell/cell.h"
5
6#include <map>
7
8namespace chi_mesh
9{
10//##################################################
11/**Handles all global index queries.*/
13{
14 friend class MeshContinuum;
15private:
16 std::vector<std::unique_ptr<chi_mesh::Cell>>& local_cells_ref_;
17 std::vector<std::unique_ptr<chi_mesh::Cell>>& ghost_cells_ref_;
18
19 std::map<uint64_t,uint64_t>& global_cell_id_to_native_id_map;
20 std::map<uint64_t,uint64_t>& global_cell_id_to_foreign_id_map;
21
22
23private:
25 std::vector<std::unique_ptr<chi_mesh::Cell>>& in_native_cells,
26 std::vector<std::unique_ptr<chi_mesh::Cell>>& in_foreign_cells,
27 std::map<uint64_t,uint64_t>& in_global_cell_id_to_native_id_map,
28 std::map<uint64_t,uint64_t>& in_global_cell_id_to_foreign_id_map) :
29 local_cells_ref_(in_native_cells),
30 ghost_cells_ref_(in_foreign_cells),
31 global_cell_id_to_native_id_map(in_global_cell_id_to_native_id_map),
32 global_cell_id_to_foreign_id_map(in_global_cell_id_to_foreign_id_map)
33 {}
34
35public:
36 void push_back(std::unique_ptr<chi_mesh::Cell> new_cell);
37 chi_mesh::Cell& operator[](uint64_t cell_global_index);
38 const chi_mesh::Cell& operator[](uint64_t cell_global_index) const;
39
40 size_t GetNumGhosts() const
42
43 std::vector<uint64_t> GetGhostGlobalIDs() const;
44
45 uint64_t GetGhostLocalID(uint64_t cell_global_index) const;
46};
47
48}//namespace chi_mesh
49
50#endif //CHI_MESHCONTINUUM_GLOBALCELLHANDLER_H_
std::map< uint64_t, uint64_t > & global_cell_id_to_foreign_id_map
std::vector< uint64_t > GetGhostGlobalIDs() const
uint64_t GetGhostLocalID(uint64_t cell_global_index) const
chi_mesh::Cell & operator[](uint64_t cell_global_index)
std::vector< std::unique_ptr< chi_mesh::Cell > > & local_cells_ref_
void push_back(std::unique_ptr< chi_mesh::Cell > new_cell)
GlobalCellHandler(std::vector< std::unique_ptr< chi_mesh::Cell > > &in_native_cells, std::vector< std::unique_ptr< chi_mesh::Cell > > &in_foreign_cells, std::map< uint64_t, uint64_t > &in_global_cell_id_to_native_id_map, std::map< uint64_t, uint64_t > &in_global_cell_id_to_foreign_id_map)
std::map< uint64_t, uint64_t > & global_cell_id_to_native_id_map
std::vector< std::unique_ptr< chi_mesh::Cell > > & ghost_cells_ref_