Zellij
All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
Grid Class Reference

#include <Grid.h>

Public Member Functions

 Grid (SystemInterface &interFace)
 
void set_extent (size_t extent_i, size_t extent_j, size_t)
 
UnitCellMapunit_cells ()
 
Cellget_cell (size_t i, size_t j)
 
size_t II () const
 Return I extent of the grid / lattice.
 
size_t JJ () const
 Return J extent of the grid / lattice.
 
size_t size () const
 Return total number of cells in the grid / lattice.
 
int parallel_size () const
 
void set_start_rank (int start_rank)
 Set the rank that the should start processing and outputting (used for subcycling)
 
void handle_file_count ()
 
bool equivalence_nodes () const
 Are nodes at the boundaries of the unit cells equivalenced.
 
bool initialize (size_t i, size_t j, const std::string &key)
 Create a Cell object referencing the UnitCell specified by key at location (i,j)
 
void add_unit_cell (const std::string &key, const std::string &unit_filename, bool ints32bit)
 
void set_coordinate_offsets ()
 Specify the X and Y location of each grid cell in the overall grid space.
 
void generate_sidesets ()
 
template<typename INT >
void process (SystemInterface &interFace, INT)
 
void decompose (const std::string &method)
 
const Ioss::ParallelUtils & util () const
 
Ioss::Region * output_region (int rank=0)
 
bool minimize_open_files (Minimize type)
 
unsigned int get_generated_sidesets ()
 
void set_sideset_names (const std::string &names)
 

Public Attributes

std::array< std::string, 6 > generated_surface_names
 

Private Member Functions

template<typename INT >
void output_model (INT)
 Output node coordinates and element block connectivities for the output mesh.
 
void internal_process ()
 
void create_output_regions (SystemInterface &interFace)
 
void categorize_processor_boundaries ()
 
void output_nodal_coordinates (const Cell &cell)
 
template<typename INT >
void output_block_connectivity (Cell &cell, const std::vector< INT > &node_map)
 
template<typename INT >
void output_nodal_communication_map (Cell &cell, const std::vector< INT > &node_map)
 
template<typename INT >
void output_element_map (Cell &cell, INT)
 
template<typename INT >
void output_node_map (const Cell &cell, INT)
 
template<typename INT >
void output_surfaces (Cell &cell, INT)
 
template<typename INT >
void output_generated_surfaces (Cell &cell, INT)
 

Private Attributes

UnitCellMap m_unitCells
 
std::vector< std::unique_ptr< Ioss::Region > > m_outputRegions
 
std::vector< Cellm_grid {}
 
Ioss::ParallelUtils m_pu {}
 
size_t m_gridI {0}
 
size_t m_gridJ {0}
 
vector3d m_offset {0.0, 0.0, 0.0}
 
double m_scaleFactor {1.0}
 
int m_parallelSize {1}
 
int m_rankCount {1}
 Number of ranks to decompose for.
 
int m_startRank {0}
 Number of ranks to process at a time.
 
bool m_equivalenceNodes {true}
 Which rank to start outputting...
 
bool m_useInternalSidesets {true}
 
bool m_subCycle {false}
 
Minimize m_minimizeOpenFiles {Minimize::NONE}
 
unsigned int m_generatedSideSets {0}
 

Detailed Description

grid stores the data for the tessellation of size IxJ

Constructor & Destructor Documentation

◆ Grid()

Grid::Grid ( SystemInterface interFace)
explicit

Create an empty grid of size extent_i x extent_j. The output mesh will be written to the exodus database in the Ioss::Region region

Member Function Documentation

◆ add_unit_cell()

void Grid::add_unit_cell ( const std::string &  key,
const std::string &  unit_filename,
bool  ints32bit 
)

◆ categorize_processor_boundaries()

void Grid::categorize_processor_boundaries ( )
private

◆ create_output_regions()

void Grid::create_output_regions ( SystemInterface interFace)
private

◆ decompose()

void Grid::decompose ( const std::string &  method)

◆ equivalence_nodes()

bool Grid::equivalence_nodes ( ) const
inline

Are nodes at the boundaries of the unit cells equivalenced.

◆ generate_sidesets()

void Grid::generate_sidesets ( )

◆ get_cell()

Cell & Grid::get_cell ( size_t  i,
size_t  j 
)
inline

Return a reference to the Cell cell at location (i,j). Does not check that i and j are in bounds.

◆ get_generated_sidesets()

unsigned int Grid::get_generated_sidesets ( )
inline

◆ handle_file_count()

void Grid::handle_file_count ( )

Determine if can keep all files open at all times, or if we need to close some/all after access...

◆ II()

size_t Grid::II ( ) const
inline

Return I extent of the grid / lattice.

◆ initialize()

bool Grid::initialize ( size_t  i,
size_t  j,
const std::string &  key 
)

Create a Cell object referencing the UnitCell specified by key at location (i,j)

◆ internal_process()

void Grid::internal_process ( )
private

◆ JJ()

size_t Grid::JJ ( ) const
inline

Return J extent of the grid / lattice.

◆ minimize_open_files()

bool Grid::minimize_open_files ( Minimize  type)
inline

◆ output_block_connectivity()

template<typename INT >
void Grid::output_block_connectivity ( Cell cell,
const std::vector< INT > &  node_map 
)
private

◆ output_element_map()

template<typename INT >
void Grid::output_element_map ( Cell cell,
INT   
)
private

◆ output_generated_surfaces()

template<typename INT >
void Grid::output_generated_surfaces ( Cell cell,
INT   
)
private

◆ output_model()

template<typename INT >
void Grid::output_model ( INT  )
private

Output node coordinates and element block connectivities for the output mesh.

◆ output_nodal_communication_map()

template<typename INT >
void Grid::output_nodal_communication_map ( Cell cell,
const std::vector< INT > &  node_map 
)
private

◆ output_nodal_coordinates()

void Grid::output_nodal_coordinates ( const Cell cell)
private

◆ output_node_map()

template<typename INT >
void Grid::output_node_map ( const Cell cell,
INT   
)
private

◆ output_region()

Ioss::Region * Grid::output_region ( int  rank = 0)
inline

◆ output_surfaces()

template<typename INT >
void Grid::output_surfaces ( Cell cell,
INT   
)
private

◆ parallel_size()

int Grid::parallel_size ( ) const
inline

◆ process()

template<typename INT >
void Grid::process ( SystemInterface interFace,
INT   
)

Once all Cell objects have been initialized, Determine the coordinate extents and offsets of each cell, the size of the output mesh, the node and element id offsets for each cell, the number of nodes and elements in the output mesh and initialize the output mesh.

◆ set_coordinate_offsets()

void Grid::set_coordinate_offsets ( )

Specify the X and Y location of each grid cell in the overall grid space.

◆ set_extent()

void Grid::set_extent ( size_t  extent_i,
size_t  extent_j,
size_t   
)

◆ set_sideset_names()

void Grid::set_sideset_names ( const std::string &  names)

◆ set_start_rank()

void Grid::set_start_rank ( int  start_rank)
inline

Set the rank that the should start processing and outputting (used for subcycling)

◆ size()

size_t Grid::size ( ) const
inline

Return total number of cells in the grid / lattice.

◆ unit_cells()

UnitCellMap & Grid::unit_cells ( )
inline

◆ util()

const Ioss::ParallelUtils & Grid::util ( ) const
inline

Member Data Documentation

◆ generated_surface_names

std::array<std::string, 6> Grid::generated_surface_names
Initial value:
{
{"min_i", "max_i", "min_j", "max_j", "min_k", "max_k"}}

◆ m_equivalenceNodes

bool Grid::m_equivalenceNodes {true}
private

Which rank to start outputting...

◆ m_generatedSideSets

unsigned int Grid::m_generatedSideSets {0}
private

◆ m_grid

std::vector<Cell> Grid::m_grid {}
private

◆ m_gridI

size_t Grid::m_gridI {0}
private

◆ m_gridJ

size_t Grid::m_gridJ {0}
private

◆ m_minimizeOpenFiles

Minimize Grid::m_minimizeOpenFiles {Minimize::NONE}
private

◆ m_offset

vector3d Grid::m_offset {0.0, 0.0, 0.0}
private

◆ m_outputRegions

std::vector<std::unique_ptr<Ioss::Region> > Grid::m_outputRegions
private

◆ m_parallelSize

int Grid::m_parallelSize {1}
private

◆ m_pu

Ioss::ParallelUtils Grid::m_pu {}
private

◆ m_rankCount

int Grid::m_rankCount {1}
private

Number of ranks to decompose for.

◆ m_scaleFactor

double Grid::m_scaleFactor {1.0}
private

◆ m_startRank

int Grid::m_startRank {0}
private

Number of ranks to process at a time.

◆ m_subCycle

bool Grid::m_subCycle {false}
private

◆ m_unitCells

UnitCellMap Grid::m_unitCells
private

◆ m_useInternalSidesets

bool Grid::m_useInternalSidesets {true}
private

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