QUGaR 0.0.4
|
Class representing a dim
-dimensional Cartesian tensor-product grid.
More...
#include <cart_grid_tp.hpp>
Public Member Functions | |
Constructors | |
CartGridTP (const std::array< std::vector< real >, dim > &breaks) | |
Construct a new CartGridTP object from its breaks. | |
CartGridTP (const BoundBox< dim > &domain, const std::array< std::size_t, dim > &n_intrvs_dir) | |
Construct a new CartGridTP object from a domain and the number of intervals per direction. | |
CartGridTP (const std::array< std::size_t, dim > &n_intrvs_dir) | |
Construct a new CartGridTP object from a [0,1] domain and the number of intervals per direction. | |
Query methods | |
const std::vector< real > & | get_breaks (int dir) const |
Gets the breaks along the given direction dir . | |
const BoundBox< dim > & | get_domain () const |
Gets the grid's domain. | |
int | get_cell_id (const PointType &point, const Tolerance &tolerance=Tolerance()) const |
Get the id of the cell the given point belongs to. | |
std::optional< int > | at_cells_boundary (const PointType &point, const Tolerance &tolerance=Tolerance()) const |
Checks if the given point is on the boundary of two cells (up to tolerance ). | |
bool | on_boundary (int cell_id, int local_facet_id) const |
Checks if a cell's facet is on the grids boundary. | |
std::vector< int > | get_boundary_cells (int facet_id) const |
Gets the list of cells belonging to given facet of the grid. | |
int | to_flat (const TensorIndexTP< dim > &tid) const |
Gets the flat index of a grid cell from the tensor index. | |
TensorIndexTP< dim > | to_tensor (int fid) const |
Gets the tensor index of a grid cell from the flat index. | |
TensorSizeTP< dim > | get_num_cells_dir () const |
Gets the number of cells per direction. | |
int | get_num_cells () const |
Gets the total number of cell. | |
BoundBox< dim > | get_cell_domain (int cell_fid) const |
Gets an cell's domain. | |
Private Types | |
using | PointType = Point<dim> |
Point type. | |
Private Attributes | |
Members | |
std::array< std::vector< real >, dim > | breaks_ |
Breaks definining the cell intervals along the dim parametric directions. | |
qugar::BoundBox< dim > | domain_ |
Domain of the grid. | |
TensorIndexRangeTP< dim > | range_ |
Indices range. | |
Class representing a dim
-dimensional Cartesian tensor-product grid.
dim | Dimension of the grid's domain. |
|
private |
Point type.
|
explicit |
Construct a new CartGridTP object from its breaks.
breaks | Breaks defining the cell intervals along the dim parametric directions. |
qugar::CartGridTP< dim >::CartGridTP | ( | const BoundBox< dim > & | domain, |
const std::array< std::size_t, dim > & | n_intrvs_dir ) |
Construct a new CartGridTP object from a domain and the number of intervals per direction.
domain | Domain of the grid. |
n_intrvs_dir | Number of cell intervals along the dim parametric directions. |
|
explicit |
Construct a new CartGridTP object from a [0,1] domain and the number of intervals per direction.
n_intrvs_dir | Number of cell intervals along the dim parametric directions. |
|
nodiscard |
Checks if the given point
is on the boundary of two cells (up to tolerance
).
point | Point to query. |
tolerance | Tolerance to be used in checkings. |
optiona
type has no value. Otherwise, it contains the index of the constant direction (from 0
to dim-1
) of the boundary. For instance, in a 2D grid, if the point lays in a vertical boundary between two cells, it returns 0, but if the boundary is horizontal, returns 1.
|
nodiscard |
Gets the list of cells belonging to given facet of the grid.
facet_id | Id of the grid facet. It must be in the range [0, dim*2). |
|
nodiscard |
Gets the breaks along the given direction dir
.
dir | Direction along which the breaks are extracted. |
dir
.
|
nodiscard |
Gets an cell's domain.
cell_fid | Flat id of the cell. |
|
nodiscard |
Get the id of the cell the given point
belongs to.
point | Point to query. |
tolerance | Tolerance to be used in checkings. |
point
belongs to more than one cell, it returns the lowest index of the neighbor cells.
|
nodiscard |
Gets the grid's domain.
|
nodiscard |
Gets the total number of cell.
|
nodiscard |
Gets the number of cells per direction.
|
nodiscard |
Checks if a cell's facet is on the grids boundary.
cell_id | Id of the cell whose facet is checked. |
local_facet_id | Id of the local facet of the cell. |
|
nodiscard |
Gets the flat index of a grid cell from the tensor index.
tid | Tensor cell index to transform. |
|
nodiscard |
Gets the tensor index of a grid cell from the flat index.
fid | Flat cell index to transform. |
|
private |
Breaks definining the cell intervals along the dim
parametric directions.
|
private |
Domain of the grid.
|
private |
Indices range.