Utopia 2
Framework for studying models of complex & adaptive systems.
|
A grid discretization using triangular cells. More...
#include <triangular.hh>
Public Types | |
using | Base = Grid< Space > |
Base class type. | |
using | SpaceVec = typename Space::SpaceVec |
The type of vectors that have a relation to physical space. | |
using | MultiIndex = MultiIndexType< dim > |
The type of multi-index like arrays, e.g. the grid shape. | |
using | Config = DataIO::Config |
The configuration type. | |
Public Types inherited from Utopia::Grid< Space > | |
using | Self = Grid< Space > |
Type of this class, i.e. the base grid class. | |
using | SpaceVec = typename Space::SpaceVec |
The type of vectors that have a relation to physical space. | |
using | MultiIndex = MultiIndexType< dim > |
The type of multi-index like arrays, e.g. the grid shape. | |
using | Config = DataIO::Config |
The configuration type. | |
Public Member Functions | |
TriangularGrid (std::shared_ptr< Space > space, const Config &cfg) | |
Construct a triangular grid discretization. | |
IndexType | num_cells () const override |
Number of triangular cells required to fill the physical space. | |
SpaceVec | effective_resolution () const override |
The effective cell resolution into each physical space dimension. | |
MultiIndex | shape () const override |
Get shape of the triangular grid. | |
GridStructure | structure () const override |
Structure of the grid. | |
MultiIndex | midx_of (const IndexType) const override |
Returns the multi index of the cell with the given ID. | |
SpaceVec | barycenter_of (const IndexType) const override |
Returns the barycenter of the cell with the given ID. | |
SpaceVec | extent_of (const IndexType) const override |
Returns the extent of the cell with the given ID. | |
std::vector< SpaceVec > | vertices_of (const IndexType) const override |
Returns the vertices of the cell with the given ID. | |
IndexType | cell_at (const SpaceVec &) const override |
Return the ID of the cell covering the given point in physical space. | |
std::set< IndexType > | boundary_cells (std::string={}) const override |
Retrieve a set of cell indices that are at a specified boundary. | |
Public Member Functions inherited from Utopia::Grid< Space > | |
Grid (std::shared_ptr< Space > space, const Config &cfg) | |
Construct a grid discretization. | |
virtual | ~Grid ()=default |
Virtual destructor to allow polymorphic destruction. | |
IndexContainer | neighbors_of (const IndexType id) const |
Returns the indices of the neighbors of the cell with the given ID. | |
void | select_neighborhood (NBMode nb_mode, const Config &nb_params={}) |
const NBMode & | nb_mode () const |
Const reference to the currently selected neighborhood mode. | |
const Config & | nb_params () const |
The neighborhood parameters of the currently selected neighborhood. | |
auto | nb_size () const |
Maximum size of the currently selected neighborhood. | |
auto | resolution () const |
Get scalar resolution value of this grid. | |
std::string | structure_name () const |
Structure of the grid as std::string. | |
const std::shared_ptr< Space > & | space () const |
Const reference to the space this grid maps to. | |
bool | is_periodic () const |
Whether the space this grid maps to is periodic. | |
Static Public Attributes | |
static constexpr DimType | dim = Space::dim |
The dimensionality of the space to be discretized (for easier access) | |
Static Public Attributes inherited from Utopia::Grid< Space > | |
static constexpr DimType | dim = Space::dim |
The dimensionality of the space to be discretized (for easier access) | |
Protected Member Functions | |
NBFuncID< Base > | get_nb_func (NBMode nb_mode, const Config &) override |
Retrieve the neighborhood function depending on the mode. | |
DistType | expected_num_neighbors (const NBMode &nb_mode, const Config &) const override |
Computes the expected number of neighbors for a neighborhood mode. | |
Additional Inherited Members | |
Protected Attributes inherited from Utopia::Grid< Space > | |
const std::shared_ptr< Space > | _space |
The space that is to be discretized. | |
const DistType | _resolution |
How many cells to place per length unit of space. | |
NBMode | _nb_mode |
Neighborhood mode. | |
Config | _nb_params |
Neighborhood parameters. | |
NBFuncID< Self > | _nb_func |
Neighborhood function (working on cell IDs) | |
NBFuncID< Self > | _nb_empty |
A neighborhood function for empty neighborhood. | |
A grid discretization using triangular cells.
using Utopia::TriangularGrid< Space >::Config = DataIO::Config |
The configuration type.
using Utopia::TriangularGrid< Space >::MultiIndex = MultiIndexType<dim> |
The type of multi-index like arrays, e.g. the grid shape.
using Utopia::TriangularGrid< Space >::SpaceVec = typename Space::SpaceVec |
The type of vectors that have a relation to physical space.
|
inline |
Construct a triangular grid discretization.
space | The space to construct the discretization for |
cfg | Further configuration parameters |
|
inlineoverridevirtual |
Returns the barycenter of the cell with the given ID.
Implements Utopia::Grid< Space >.
|
inlineoverridevirtual |
Retrieve a set of cell indices that are at a specified boundary.
select | Which boundary to return the cell IDs of. If 'all', all boundary cells are returned. Other available values depend on the dimensionality of the grid: 1D: left, right 2D: bottom, top 3D: back, front |
Implements Utopia::Grid< Space >.
|
inlineoverridevirtual |
Return the ID of the cell covering the given point in physical space.
Cells are interpreted as covering half-open intervals in space, i.e., including their low-value edges and excluding their high-value edges. The special case of points on high-value edges for non-periodic space behaves such that these points are associated with the cells at the boundary.
Implements Utopia::Grid< Space >.
|
inlineoverridevirtual |
The effective cell resolution into each physical space dimension.
Implements Utopia::Grid< Space >.
|
inlineoverrideprotectedvirtual |
Computes the expected number of neighbors for a neighborhood mode.
Implements Utopia::Grid< Space >.
|
inlineoverridevirtual |
Returns the extent of the cell with the given ID.
Implements Utopia::Grid< Space >.
|
inlineoverrideprotectedvirtual |
Retrieve the neighborhood function depending on the mode.
Implements Utopia::Grid< Space >.
|
inlineoverridevirtual |
Returns the multi index of the cell with the given ID.
Implements Utopia::Grid< Space >.
|
inlineoverridevirtual |
Number of triangular cells required to fill the physical space.
Implements Utopia::Grid< Space >.
|
inlineoverridevirtual |
Get shape of the triangular grid.
Implements Utopia::Grid< Space >.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Returns the vertices of the cell with the given ID.
Implements Utopia::Grid< Space >.
|
staticconstexpr |
The dimensionality of the space to be discretized (for easier access)