Chi-Tech
chi_mesh::MeshContinuum Class Reference

#include <chi_meshcontinuum.h>

Public Member Functions

 MeshContinuum ()
 
void SetGlobalVertexCount (const uint64_t count)
 
uint64_t GetGlobalVertexCount () const
 
std::map< uint64_t, std::string > & GetBoundaryIDMap ()
 
const std::map< uint64_t, std::string > & GetBoundaryIDMap () const
 
uint64_t MakeBoundaryID (const std::string &boundary_name) const
 
void ClearCellReferences ()
 
void ExportCellsToObj (const char *fileName, bool per_material=false, int options=0) const
 
void ExportCellsToVTK (const std::string &file_base_name) const
 
void ExportCellsToExodus (const std::string &file_base_name, bool suppress_node_sets=false, bool suppress_side_sets=false) const
 
std::shared_ptr< GridFaceHistogramMakeGridFaceHistogram (double master_tolerance=100.0, double slave_tolerance=1.1) const
 
bool IsCellLocal (uint64_t cell_global_index) const
 
void FindAssociatedVertices (const chi_mesh::CellFace &cur_face, std::vector< short > &dof_mapping) const
 
void FindAssociatedCellVertices (const chi_mesh::CellFace &cur_face, std::vector< short > &dof_mapping) const
 
size_t MapCellGlobalID2LocalID (uint64_t global_id) const
 
chi_mesh::Vector3 ComputeCentroidFromListOfNodes (const std::vector< uint64_t > &list) const
 
MPILocalCommSetPtr MakeMPILocalCommunicatorSet () const
 
size_t GetGlobalNumberOfCells () const
 
std::vector< uint64_t > GetDomainUniqueBoundaryIDs () const
 
size_t CountCellsInLogicalVolume (const chi_mesh::LogicalVolume &log_vol) const
 
bool CheckPointInsideCell (const chi_mesh::Cell &cell, const chi_mesh::Vector3 &point) const
 
MeshAttributes Attributes () const
 
std::array< size_t, 3 > GetIJKInfo () const
 
chi_data_types::NDArray< uint64_t > MakeIJKToGlobalIDMapping () const
 
std::vector< chi_mesh::Vector3MakeCellOrthoSizes () const
 
std::pair< chi_mesh::Vector3, chi_mesh::Vector3GetLocalBoundingBox () const
 

Static Public Member Functions

static std::shared_ptr< MeshContinuumNew ()
 
static int GetCellDimension (const chi_mesh::Cell &cell)
 
static size_t MapCellFace (const chi_mesh::Cell &cur_cell, const chi_mesh::Cell &adj_cell, unsigned int f)
 

Data Fields

VertexHandler vertices
 
LocalCellHandler local_cells
 
GlobalCellHandler cells
 
size_t Nx = 0
 
size_t Ny = 0
 
size_t Nz = 0
 

Private Types

typedef std::shared_ptr< chi::ChiMPICommunicatorSetMPILocalCommSetPtr
 

Private Member Functions

void SetAttributes (MeshAttributes new_attribs, std::array< size_t, 3 > ortho_Nis={0, 0, 0})
 

Private Attributes

std::vector< std::unique_ptr< chi_mesh::Cell > > local_cells_
 Actual local cells. More...
 
std::vector< std::unique_ptr< chi_mesh::Cell > > ghost_cells_
 Locally stored ghosts. More...
 
std::map< uint64_t, uint64_t > global_cell_id_to_local_id_map_
 
std::map< uint64_t, uint64_t > global_cell_id_to_nonlocal_id_map_
 
uint64_t global_vertex_count_ = 0
 
MeshAttributes attributes = NONE
 
struct {
   size_t   Nx = 0
 
   size_t   Ny = 0
 
   size_t   Nz = 0
 
ortho_attributes
 
std::map< uint64_t, std::string > boundary_id_map_
 

Friends

class chi_mesh::VolumeMesher
 
class chi_mesh::MeshGenerator
 

Detailed Description

Stores the relevant information for completely defining a computational domain.

Definition at line 34 of file chi_meshcontinuum.h.

Member Typedef Documentation

◆ MPILocalCommSetPtr

Definition at line 37 of file chi_meshcontinuum.h.

Constructor & Destructor Documentation

◆ MeshContinuum()

chi_mesh::MeshContinuum::MeshContinuum ( )
inline

Definition at line 68 of file chi_meshcontinuum.h.

Member Function Documentation

◆ Attributes()

MeshAttributes chi_mesh::MeshContinuum::Attributes ( ) const
inline

Definition at line 156 of file chi_meshcontinuum.h.

◆ CheckPointInsideCell()

bool chi_mesh::MeshContinuum::CheckPointInsideCell ( const chi_mesh::Cell cell,
const chi_mesh::Vector3 point 
) const

Checks whether a point is within a cell.

Definition at line 338 of file chi_meshcontinuum_utilities.cc.

◆ ClearCellReferences()

void chi_mesh::MeshContinuum::ClearCellReferences ( )
inline

Method to be called if cells and nodes have been transferred to another grid.

Definition at line 102 of file chi_meshcontinuum.h.

◆ ComputeCentroidFromListOfNodes()

chi_mesh::Vector3 chi_mesh::MeshContinuum::ComputeCentroidFromListOfNodes ( const std::vector< uint64_t > &  list) const

Computes the centroid from nodes specified by the given list.

Definition at line 299 of file chi_meshcontinuum_utilities.cc.

◆ CountCellsInLogicalVolume()

size_t chi_mesh::MeshContinuum::CountCellsInLogicalVolume ( const chi_mesh::LogicalVolume log_vol) const

Counts the number of cells within a logical volume across all partitions.

Definition at line 317 of file chi_meshcontinuum_utilities.cc.

◆ ExportCellsToExodus()

void chi_mesh::MeshContinuum::ExportCellsToExodus ( const std::string &  file_base_name,
bool  suppress_node_sets = false,
bool  suppress_side_sets = false 
) const

Exports just the portion of the mesh to ExodusII format.

Definition at line 25 of file chi_meshcontinuum_exportexodus.cc.

◆ ExportCellsToObj()

void chi_mesh::MeshContinuum::ExportCellsToObj ( const char *  fileName,
bool  per_material = false,
int  options = 0 
) const

Export cells to python.

Todo:
Export Cells to OBJ needs polygon support.

Definition at line 16 of file chi_meshcontinuum_exportobj.cc.

◆ ExportCellsToVTK()

void chi_mesh::MeshContinuum::ExportCellsToVTK ( const std::string &  file_base_name) const

Exports just the mesh to VTK format.

Definition at line 14 of file chi_meshcontinuum_exportvtk.cc.

◆ FindAssociatedCellVertices()

void chi_mesh::MeshContinuum::FindAssociatedCellVertices ( const chi_mesh::CellFace cur_face,
std::vector< short > &  dof_mapping 
) const

Creates a mapping of the current face local-ids to the adjacent cell's local ids.

General map vertices

Definition at line 209 of file chi_meshcontinuum_utilities.cc.

◆ FindAssociatedVertices()

void chi_mesh::MeshContinuum::FindAssociatedVertices ( const chi_mesh::CellFace cur_face,
std::vector< short > &  dof_mapping 
) const

Creates a mapping of the current face local-ids to the adjacent face's local ids.

General map vertices

Definition at line 164 of file chi_meshcontinuum_utilities.cc.

◆ GetBoundaryIDMap() [1/2]

std::map< uint64_t, std::string > & chi_mesh::MeshContinuum::GetBoundaryIDMap ( )
inline

Definition at line 83 of file chi_meshcontinuum.h.

◆ GetBoundaryIDMap() [2/2]

const std::map< uint64_t, std::string > & chi_mesh::MeshContinuum::GetBoundaryIDMap ( ) const
inline

Definition at line 88 of file chi_meshcontinuum.h.

◆ GetCellDimension()

int chi_mesh::MeshContinuum::GetCellDimension ( const chi_mesh::Cell cell)
static

Check whether a cell is a boundary by checking if the key is found in the native or foreign cell maps.

Definition at line 136 of file chi_meshcontinuum_utilities.cc.

◆ GetDomainUniqueBoundaryIDs()

std::vector< uint64_t > chi_mesh::MeshContinuum::GetDomainUniqueBoundaryIDs ( ) const

Builds and returns a vector of unique boundary id's present in the mesh.

Definition at line 12 of file chi_meshcontinuum_uniquebndryIDs.cc.

◆ GetGlobalNumberOfCells()

size_t chi_mesh::MeshContinuum::GetGlobalNumberOfCells ( ) const

Returns the total number of global cells.

Definition at line 85 of file chi_meshcontinuum_globalcellhandler.cc.

◆ GetGlobalVertexCount()

uint64_t chi_mesh::MeshContinuum::GetGlobalVertexCount ( ) const
inline

Definition at line 81 of file chi_meshcontinuum.h.

◆ GetIJKInfo()

std::array< size_t, 3 > chi_mesh::MeshContinuum::GetIJKInfo ( ) const

Gets and orthogonal mesh interface object.

Definition at line 443 of file chi_meshcontinuum_utilities.cc.

◆ GetLocalBoundingBox()

std::pair< chi_mesh::Vector3, chi_mesh::Vector3 > chi_mesh::MeshContinuum::GetLocalBoundingBox ( ) const

Definition at line 526 of file chi_meshcontinuum_utilities.cc.

◆ IsCellLocal()

bool chi_mesh::MeshContinuum::IsCellLocal ( uint64_t  cell_global_index) const

Check whether a cell is local by attempting to find the key in the native index map.

Definition at line 124 of file chi_meshcontinuum_utilities.cc.

◆ MakeBoundaryID()

uint64_t chi_mesh::MeshContinuum::MakeBoundaryID ( const std::string &  boundary_name) const

Makes a bndry id given a name. If the bndry name already exists, the associated bndry id will be returned. Other the id will be set to one more than the maximum boundary id.

Definition at line 511 of file chi_meshcontinuum_utilities.cc.

◆ MakeCellOrthoSizes()

std::vector< chi_mesh::Vector3 > chi_mesh::MeshContinuum::MakeCellOrthoSizes ( ) const

Determines the bounding box size of each cell and returns it as a list of 3-component vectors, one Vec3 for each cell.

Definition at line 480 of file chi_meshcontinuum_utilities.cc.

◆ MakeGridFaceHistogram()

std::shared_ptr< chi_mesh::GridFaceHistogram > chi_mesh::MeshContinuum::MakeGridFaceHistogram ( double  master_tolerance = 100.0,
double  slave_tolerance = 1.1 
) const

Populates a face histogram.

Parameters
master_toleranceMultiple histograms will only be attempted if the ratio of the maximum dofs-per-face to the average dofs-per-face is greater than this value. Default 1.2.
slave_toleranceWhile traversing a sorted list of dofs-per-face, a new bin will only be generated when the ratio of the listed dofs-per-face to a running bin average exceeds this value. Defualt 1.1.

The function populates face_categories which is a structure containing pairs. Pair.first is the max dofs-per-face for the category and Pair.second is the number of faces in this category.

Definition at line 33 of file chi_meshcontinuum_utilities.cc.

◆ MakeIJKToGlobalIDMapping()

chi_data_types::NDArray< uint64_t > chi_mesh::MeshContinuum::MakeIJKToGlobalIDMapping ( ) const

Provides a mapping from cell ijk indices to global ids.

Definition at line 455 of file chi_meshcontinuum_utilities.cc.

◆ MakeMPILocalCommunicatorSet()

std::shared_ptr< chi::ChiMPICommunicatorSet > chi_mesh::MeshContinuum::MakeMPILocalCommunicatorSet ( ) const

Gets the communicator-set for interprocess communication, associated with this mesh. If not created yet, it will create it.

Definition at line 12 of file chi_meshcontinuum_communicator.cc.

◆ MapCellFace()

size_t chi_mesh::MeshContinuum::MapCellFace ( const chi_mesh::Cell cur_cell,
const chi_mesh::Cell adj_cell,
unsigned int  f 
)
static

Given the current cell, cell A, and its adjacent cell, cell B, with cell B adjacent to A at the f-th face of cell A. Will determine the af-th index of the face on cell B that interface with the f-th face of cell A.

Definition at line 254 of file chi_meshcontinuum_utilities.cc.

◆ MapCellGlobalID2LocalID()

size_t chi_mesh::MeshContinuum::MapCellGlobalID2LocalID ( uint64_t  global_id) const

Given a global-id of a cell, will return the local-id if the cell is local, otherwise will throw out_of_range.

Given a global-id of a cell, will return the local-id if the cell is local, otherwise will throw logic_error.

Definition at line 292 of file chi_meshcontinuum_utilities.cc.

◆ New()

static std::shared_ptr< MeshContinuum > chi_mesh::MeshContinuum::New ( )
inlinestatic

Definition at line 95 of file chi_meshcontinuum.h.

◆ SetAttributes()

void chi_mesh::MeshContinuum::SetAttributes ( MeshAttributes  new_attribs,
std::array< size_t, 3 >  ortho_Nis = {0, 0, 0} 
)
inlineprivate

Definition at line 167 of file chi_meshcontinuum.h.

◆ SetGlobalVertexCount()

void chi_mesh::MeshContinuum::SetGlobalVertexCount ( const uint64_t  count)
inline

Definition at line 77 of file chi_meshcontinuum.h.

Friends And Related Function Documentation

◆ chi_mesh::MeshGenerator

friend class chi_mesh::MeshGenerator
friend

Definition at line 166 of file chi_meshcontinuum.h.

◆ chi_mesh::VolumeMesher

friend class chi_mesh::VolumeMesher
friend

Definition at line 165 of file chi_meshcontinuum.h.

Field Documentation

◆ attributes

MeshAttributes chi_mesh::MeshContinuum::attributes = NONE
private

Definition at line 56 of file chi_meshcontinuum.h.

◆ boundary_id_map_

std::map<uint64_t, std::string> chi_mesh::MeshContinuum::boundary_id_map_
private

Definition at line 65 of file chi_meshcontinuum.h.

◆ cells

GlobalCellHandler chi_mesh::MeshContinuum::cells

Definition at line 53 of file chi_meshcontinuum.h.

◆ ghost_cells_

std::vector<std::unique_ptr<chi_mesh::Cell> > chi_mesh::MeshContinuum::ghost_cells_
private

Locally stored ghosts.

Definition at line 43 of file chi_meshcontinuum.h.

◆ global_cell_id_to_local_id_map_

std::map<uint64_t, uint64_t> chi_mesh::MeshContinuum::global_cell_id_to_local_id_map_
private

Definition at line 45 of file chi_meshcontinuum.h.

◆ global_cell_id_to_nonlocal_id_map_

std::map<uint64_t, uint64_t> chi_mesh::MeshContinuum::global_cell_id_to_nonlocal_id_map_
private

Definition at line 46 of file chi_meshcontinuum.h.

◆ global_vertex_count_

uint64_t chi_mesh::MeshContinuum::global_vertex_count_ = 0
private

Definition at line 48 of file chi_meshcontinuum.h.

◆ local_cells

LocalCellHandler chi_mesh::MeshContinuum::local_cells

Definition at line 52 of file chi_meshcontinuum.h.

◆ local_cells_

std::vector<std::unique_ptr<chi_mesh::Cell> > chi_mesh::MeshContinuum::local_cells_
private

Actual local cells.

Definition at line 41 of file chi_meshcontinuum.h.

◆ Nx

size_t chi_mesh::MeshContinuum::Nx = 0

Definition at line 60 of file chi_meshcontinuum.h.

◆ Ny

size_t chi_mesh::MeshContinuum::Ny = 0

Definition at line 61 of file chi_meshcontinuum.h.

◆ Nz

size_t chi_mesh::MeshContinuum::Nz = 0

Definition at line 62 of file chi_meshcontinuum.h.

◆ 

struct { ... } chi_mesh::MeshContinuum::ortho_attributes

◆ vertices

VertexHandler chi_mesh::MeshContinuum::vertices

Definition at line 51 of file chi_meshcontinuum.h.


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