Chi-Tech
chi_mesh::GlobalCellHandler Class Reference

#include <chi_meshcontinuum_globalcellhandler.h>

Public Member Functions

void push_back (std::unique_ptr< chi_mesh::Cell > new_cell)
 
chi_mesh::Celloperator[] (uint64_t cell_global_index)
 
const chi_mesh::Celloperator[] (uint64_t cell_global_index) const
 
size_t GetNumGhosts () const
 
std::vector< uint64_t > GetGhostGlobalIDs () const
 
uint64_t GetGhostLocalID (uint64_t cell_global_index) const
 

Private Member Functions

 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)
 

Private Attributes

std::vector< std::unique_ptr< chi_mesh::Cell > > & local_cells_ref_
 
std::vector< std::unique_ptr< chi_mesh::Cell > > & ghost_cells_ref_
 
std::map< uint64_t, uint64_t > & global_cell_id_to_native_id_map
 
std::map< uint64_t, uint64_t > & global_cell_id_to_foreign_id_map
 

Friends

class MeshContinuum
 

Detailed Description

Handles all global index queries.

Definition at line 12 of file chi_meshcontinuum_globalcellhandler.h.

Constructor & Destructor Documentation

◆ GlobalCellHandler()

chi_mesh::GlobalCellHandler::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 
)
inlineexplicitprivate

Definition at line 24 of file chi_meshcontinuum_globalcellhandler.h.

Member Function Documentation

◆ GetGhostGlobalIDs()

std::vector< uint64_t > chi_mesh::GlobalCellHandler::GetGhostGlobalIDs ( ) const

Returns the cell global ids of all ghost cells. These are cells that neighbors to this partition's cells but are on a different partition.

Definition at line 104 of file chi_meshcontinuum_globalcellhandler.cc.

◆ GetGhostLocalID()

uint64_t chi_mesh::GlobalCellHandler::GetGhostLocalID ( uint64_t  cell_global_index) const

Returns the local storage address of a ghost cell. If the ghost is not truly a ghost then -1 is returned, but is wasteful and therefore the user of this function should implement code to prevent it.

Definition at line 121 of file chi_meshcontinuum_globalcellhandler.cc.

◆ GetNumGhosts()

size_t chi_mesh::GlobalCellHandler::GetNumGhosts ( ) const
inline

Definition at line 40 of file chi_meshcontinuum_globalcellhandler.h.

◆ operator[]() [1/2]

chi_mesh::Cell & chi_mesh::GlobalCellHandler::operator[] ( uint64_t  cell_global_index)

Returns a reference to a cell given its global cell index.

Definition at line 37 of file chi_meshcontinuum_globalcellhandler.cc.

◆ operator[]() [2/2]

const chi_mesh::Cell & chi_mesh::GlobalCellHandler::operator[] ( uint64_t  cell_global_index) const

Returns a const reference to a cell given its global cell index.

Definition at line 61 of file chi_meshcontinuum_globalcellhandler.cc.

◆ push_back()

void chi_mesh::GlobalCellHandler::push_back ( std::unique_ptr< chi_mesh::Cell new_cell)

Adds a new cell to grid registry.

Definition at line 9 of file chi_meshcontinuum_globalcellhandler.cc.

Friends And Related Function Documentation

◆ MeshContinuum

friend class MeshContinuum
friend

Definition at line 14 of file chi_meshcontinuum_globalcellhandler.h.

Field Documentation

◆ ghost_cells_ref_

std::vector<std::unique_ptr<chi_mesh::Cell> >& chi_mesh::GlobalCellHandler::ghost_cells_ref_
private

Definition at line 17 of file chi_meshcontinuum_globalcellhandler.h.

◆ global_cell_id_to_foreign_id_map

std::map<uint64_t,uint64_t>& chi_mesh::GlobalCellHandler::global_cell_id_to_foreign_id_map
private

Definition at line 20 of file chi_meshcontinuum_globalcellhandler.h.

◆ global_cell_id_to_native_id_map

std::map<uint64_t,uint64_t>& chi_mesh::GlobalCellHandler::global_cell_id_to_native_id_map
private

Definition at line 19 of file chi_meshcontinuum_globalcellhandler.h.

◆ local_cells_ref_

std::vector<std::unique_ptr<chi_mesh::Cell> >& chi_mesh::GlobalCellHandler::local_cells_ref_
private

Definition at line 16 of file chi_meshcontinuum_globalcellhandler.h.


The documentation for this class was generated from the following files: