Subgrid of a Cartesian grid TP. It is a subset of the cells of a given grid. More...
#include <cart_grid_tp.hpp>
Public Types | |
using | GridPtr = std::shared_ptr<const CartGridTP<dim>> |
Shared-pointer to Cartesian grid type. | |
Public Member Functions | |
SubCartGridTP (const GridPtr grid, const TensorIndexTP< dim > &indices_start, const TensorIndexTP< dim > &indices_end) | |
Constructor. | |
SubCartGridTP (const GridPtr grid, const TensorIndexRangeTP< dim > &indices_range) | |
Constructor. | |
SubCartGridTP (const GridPtr grid) | |
Constructor. Creates a subgrid containing the full grid. | |
TensorSizeTP< dim > | get_num_cells_dir () const |
Gets the number of cells (spans) per direction of the subgrid. | |
std::int64_t | to_flat (const TensorIndexTP< dim > &tid) const |
Gets the flat index of a grid cells from the tensor index. | |
std::size_t | get_num_cells () const |
Gets the total number of cells of the subgrid. | |
bool | is_full () const |
Checks if the subgrid corresponds to the total grid. | |
bool | is_unique_cell () const |
Checks if the subgrid has only one cell. | |
const TensorIndexRangeTP< dim > & | get_range () const |
Gets a range describing the range of the subrid. | |
std::array< std::shared_ptr< const SubCartGridTP< dim > >, 2 > | split () const |
Splits the current subgrid along the direction with a largest number of cells. | |
BoundBox< dim > | get_domain () const |
Creates the bounding box of the subgrid's domain. | |
GridPtr | get_grid () const |
Gets the parent grid. | |
std::int64_t | get_single_cell () const |
Gets the single cell in the subgrid. | |
Private Attributes | |
GridPtr | grid_ |
Parent grid. | |
TensorIndexRangeTP< dim > | range_ |
Indices range. | |
Subgrid of a Cartesian grid TP. It is a subset of the cells of a given grid.
dim | Parametric dimension. |
using qugar::SubCartGridTP< dim >::GridPtr = std::shared_ptr<const CartGridTP<dim>> |
Shared-pointer to Cartesian grid type.
qugar::SubCartGridTP< dim >::SubCartGridTP | ( | const GridPtr | grid, |
const TensorIndexTP< dim > & | indices_start, | ||
const TensorIndexTP< dim > & | indices_end ) |
Constructor.
grid | Parent grid. |
indices_start | Start indices of the coordinates of the parent grid. |
indices_end | End indices of the coordinates of the parent grid. |
qugar::SubCartGridTP< dim >::SubCartGridTP | ( | const GridPtr | grid, |
const TensorIndexRangeTP< dim > & | indices_range ) |
Constructor.
grid | Parent grid. |
indices_range | Indices range. |
|
explicit |
Constructor. Creates a subgrid containing the full grid.
grid | Parent grid. |
|
nodiscard |
Creates the bounding box of the subgrid's domain.
|
nodiscard |
Gets the parent grid.
|
nodiscard |
Gets the total number of cells of the subgrid.
|
nodiscard |
Gets the number of cells (spans) per direction of the subgrid.
The ordering is such that dimension 0 is inner-most, i.e., iterates the fastest, while dimension dim-1 is outer-most and iterates the slowest.
|
nodiscard |
Gets a range describing the range of the subrid.
|
nodiscard |
Gets the single cell in the subgrid.
|
nodiscard |
Checks if the subgrid corresponds to the total grid.
|
nodiscard |
Checks if the subgrid has only one cell.
|
nodiscard |
Splits the current subgrid along the direction with a largest number of cells.
|
nodiscard |
Gets the flat index of a grid cells from the tensor index.
tid | Tensor cell index to transform. |
|
private |
Parent grid.
|
private |
Indices range.