1#ifndef UTOPIA_CORE_GRIDS_TRIANGULAR_HH
2#define UTOPIA_CORE_GRIDS_TRIANGULAR_HH
86 throw std::runtime_error(
"The TriangularGrid::midx_of method is not "
95 throw std::runtime_error(
"The TriangularGrid::barycenter_of method "
96 "is not yet implemented!");
104 throw std::runtime_error(
"The TriangularGrid::extent_of method is not "
115 throw std::runtime_error(
"The TriangularGrid::vertices_of method is "
116 "not yet implemented!");
134 throw std::runtime_error(
"The TriangularGrid::cell_at method is not "
151 throw std::runtime_error(
"The TriangularGrid::boundary_cells method "
152 "is not yet implemented!");
167 +
"' neighborhood available for TriangularGrid!");
173 const Config&)
const override
180 +
"' neighborhood available for TriangularGrid!");
The base class for all grid discretizations used by the CellManager.
Definition base.hh:99
NBFuncID< Self > _nb_empty
A neighborhood function for empty neighborhood.
Definition base.hh:323
const std::shared_ptr< Space > & space() const
Const reference to the space this grid maps to.
Definition base.hh:299
const NBMode & nb_mode() const
Const reference to the currently selected neighborhood mode.
Definition base.hh:198
A grid discretization using triangular cells.
Definition triangular.hh:16
SpaceVec extent_of(const IndexType) const override
Returns the extent of the cell with the given ID.
Definition triangular.hh:103
DataIO::Config Config
The configuration type.
Definition triangular.hh:31
MultiIndex midx_of(const IndexType) const override
Returns the multi index of the cell with the given ID.
Definition triangular.hh:85
GridStructure structure() const override
Structure of the grid.
Definition triangular.hh:76
SpaceVec barycenter_of(const IndexType) const override
Returns the barycenter of the cell with the given ID.
Definition triangular.hh:94
TriangularGrid(std::shared_ptr< Space > space, const Config &cfg)
Construct a triangular grid discretization.
Definition triangular.hh:44
SpaceVec effective_resolution() const override
The effective cell resolution into each physical space dimension.
Definition triangular.hh:60
MultiIndexType< dim > MultiIndex
The type of multi-index like arrays, e.g. the grid shape.
Definition triangular.hh:28
MultiIndex shape() const override
Get shape of the triangular grid.
Definition triangular.hh:68
IndexType cell_at(const SpaceVec &) const override
Return the ID of the cell covering the given point in physical space.
Definition triangular.hh:133
NBFuncID< Base > get_nb_func(NBMode nb_mode, const Config &) override
Retrieve the neighborhood function depending on the mode.
Definition triangular.hh:160
std::vector< SpaceVec > vertices_of(const IndexType) const override
Returns the vertices of the cell with the given ID.
Definition triangular.hh:114
IndexType num_cells() const override
Number of triangular cells required to fill the physical space.
Definition triangular.hh:54
DistType expected_num_neighbors(const NBMode &nb_mode, const Config &) const override
Computes the expected number of neighbors for a neighborhood mode.
Definition triangular.hh:172
typename Space::SpaceVec SpaceVec
The type of vectors that have a relation to physical space.
Definition triangular.hh:25
std::set< IndexType > boundary_cells(std::string={}) const override
Retrieve a set of cell indices that are at a specified boundary.
Definition triangular.hh:150
static constexpr DimType dim
The dimensionality of the space to be discretized (for easier access)
Definition triangular.hh:22
NBMode
Possible neighborhood types; availability depends on choice of grid.
Definition base.hh:52
std::string nb_mode_to_string(const NBMode &nb_mode)
Given an NBMode enum value, return the corresponding string key.
Definition base.hh:78
GridStructure
Available grid implementations.
Definition base.hh:13
std::function< IndexContainer(const IndexType)> NBFuncID
Type of the neighborhood calculating function.
Definition base.hh:92
@ empty
Every entity is utterly alone in the world.
@ triangular
A triangular lattice grid.
YAML::Node Config
Type of a variadic dictionary-like data structure used throughout Utopia.
Definition types.hh:71
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
arma::Col< IndexType >::fixed< dim > MultiIndexType
Type for index type vectors that are associated with a physical space.
Definition types.hh:53
unsigned short DimType
Type for dimensions, i.e. very small unsigned integers.
Definition types.hh:34
unsigned int DistType
Type for distancens, i.e. intermediately long unsigned integers.
Definition types.hh:37
std::size_t IndexType
Type for indices, i.e. values used for container indexing, agent IDs, ...
Definition types.hh:40
SpaceVecType< dim > SpaceVec
The type for vectors relating to physical space.
Definition space.hh:33
static constexpr std::size_t dim
The dimensionality of the space.
Definition space.hh:30