LevelAdjacentCellsCache< dim > Class Template Reference
|
Developer Documentation
|
#include <triangulation_utils.hpp>
Public Member Functions | |
| void | build_cache (const dealii::Triangulation< dim > &tria, const unsigned int level) |
| const std::set< dealii::TriaIterator< dealii::CellAccessor< dim > > > & | get_adjacent_cells (const tria_iterator &cell) const |
| unsigned int | n_global_cells_on_level () const |
Private Types | |
| using | tria_iterator = dealii::TriaIterator< dealii::CellAccessor< dim > > |
Private Member Functions | |
| void | assert_cache_built () const |
| void | cache_adjacent_cells (const dealii::Triangulation< dim > &tria, const unsigned int level) |
| void | compute_global_cell_count (const dealii::Triangulation< dim > &tria, const unsigned int level) |
Private Attributes | |
| unsigned int | n_global_level_cells = 0 |
| The total number of cells on the specified level across all MPI ranks. | |
| std::map< tria_iterator, std::set< tria_iterator > > | adjacent_cells_cache |
| bool | is_cache_built = false |
| unsigned int | cache_level = 0 |
| The level for which the adjacency cache has been built. | |
Detailed Description
class MeltPoolDG::LevelAdjacentCellsCache< dim >
A class which caches the adjacent cells for each cell on a given level of a triangulation. Adjacency is defined as vertex-sharing, i.e., two cells are considered adjacent if they share at least one vertex. The cache is built for a specific level of the triangulation and can be queried for the adjacent cells of any cell on that level, assuming the cell is locally available (i.e., it is either locally owned, ghost, or artificial).
- Note
- The class caches iterators to cells, which are only valid as long as the triangulation is not modified. If the triangulation is modified (e.g., by refining or coarsening), the cache must be rebuilt by calling the build_cache() function again.
Member Typedef Documentation
◆ tria_iterator
|
private |
Member Function Documentation
◆ assert_cache_built()
|
private |
Assert that the adjacency cache has been built before accessing it. If the cache has not been built, an exception is thrown. This is checked by the is_cache_built boolean variable.
◆ build_cache()
| void MeltPoolDG::LevelAdjacentCellsCache< dim >::build_cache | ( | const dealii::Triangulation< dim > & | tria, |
| const unsigned int | level | ||
| ) |
Build the adjacency cache for the given level of the triangulation.
- Parameters
-
tria The triangulation for which to build the cache. level The level for which to build the cache.
◆ cache_adjacent_cells()
|
private |
Build the adjacency cache for the given level of the triangulation. This function populates the adjacency cache with the adjacent cells for each cell on the specified level.
- Parameters
-
tria The triangulation for which to build the cache. level The level for which to build the cache.
◆ compute_global_cell_count()
|
private |
Compute the total number of cells on the specified level across all MPI ranks.
- Parameters
-
tria The triangulation for which to compute the cell count. level The level for which to compute the cell count.
◆ get_adjacent_cells()
| const std::set< dealii::TriaIterator< dealii::CellAccessor< dim > > > & MeltPoolDG::LevelAdjacentCellsCache< dim >::get_adjacent_cells | ( | const tria_iterator & | cell | ) | const |
Get the adjacent cells of a given cell on the specified level.
- Parameters
-
cell The cell for which to get the adjacent cells.
- Note
- The returned set of adjacent cells does not include the cell itself.
- If an adjacent cell is not available on the same level, the parent cell of the hypothesized adjacent cell on the specified level is returned instead.
◆ n_global_cells_on_level()
| unsigned int MeltPoolDG::LevelAdjacentCellsCache< dim >::n_global_cells_on_level | ( | ) | const |
Get the total number of cells on the specified level across all MPI ranks.
Member Data Documentation
◆ adjacent_cells_cache
|
private |
A map that assigns to each cell on the specified level the set of its adjacent cells. Note, that this does not include the cell itself.
◆ cache_level
|
private |
The level for which the adjacency cache has been built.
◆ is_cache_built
|
private |
A boolean indicating whether the adjacency cache has been built, i.e., whether the build_cache() function has been called.
◆ n_global_level_cells
|
private |
The total number of cells on the specified level across all MPI ranks.
The documentation for this class was generated from the following files:
- include/meltpooldg/utilities/triangulation_utils.hpp
- source/utilities/triangulation_utils.cpp
Generated by