11#ifndef QUGAR_LIBRARY_CART_GRID_TP_HPP
12#define QUGAR_LIBRARY_CART_GRID_TP_HPP
49 explicit CartGridTP(
const std::array<std::vector<real>, dim> &breaks);
60 explicit CartGridTP(
const std::array<std::size_t, dim> &n_intrvs_dir);
69 [[nodiscard]]
const std::vector<real> &
get_breaks(
int dir)
const;
99 [[nodiscard]]
bool on_boundary(
int cell_id,
int local_facet_id)
const;
220 [[nodiscard]] std::array<std::shared_ptr<const SubCartGridTP<dim>>, 2>
split()
const;
Definition of Cartesian bounding box class.
Class representing a dim-dimensional Cartesian product bounding box.
Definition bbox.hpp:38
Class representing a dim-dimensional Cartesian tensor-product grid.
Definition cart_grid_tp.hpp:40
TensorIndexRangeTP< dim > range_
Indices range.
Definition cart_grid_tp.hpp:147
std::array< std::vector< real >, dim > breaks_
Breaks definining the cell intervals along the dim parametric directions.
Definition cart_grid_tp.hpp:143
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.
qugar::BoundBox< dim > domain_
Domain of the grid.
Definition cart_grid_tp.hpp:145
int get_num_cells() const
Gets the total number of cell.
std::vector< int > get_boundary_cells(int facet_id) const
Gets the list of cells belonging to given facet of the grid.
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.
const std::vector< real > & get_breaks(int dir) const
Gets the breaks along the given direction dir.
TensorSizeTP< dim > get_num_cells_dir() const
Gets the number of cells per direction.
int get_cell_id(const PointType &point, const Tolerance &tolerance=Tolerance()) const
Get the id of the cell the given point belongs to.
const BoundBox< dim > & get_domain() const
Gets the grid's domain.
int to_flat(const TensorIndexTP< dim > &tid) const
Gets the flat index of a grid cell from the tensor index.
Point< dim > PointType
Point type.
Definition cart_grid_tp.hpp:42
BoundBox< dim > get_cell_domain(int cell_fid) const
Gets an cell's domain.
TensorIndexTP< dim > to_tensor(int fid) const
Gets the tensor index of a grid cell from the flat index.
CartGridTP(const std::array< std::vector< real >, dim > &breaks)
Construct a new CartGridTP object from its breaks.
Subgrid of a Cartesian grid TP. It is a subset of the cells of a given grid.
Definition cart_grid_tp.hpp:156
const CartGridTP< dim > & grid_
Parent grid.
Definition cart_grid_tp.hpp:182
SubCartGridTP(const CartGridTP< dim > &grid, const TensorIndexTP< dim > &indices_start, const TensorIndexTP< dim > &indices_end)
Constructor.
int get_single_cell() const
Gets the single cell in the subgrid.
TensorIndexRangeTP< dim > range_
Indices range.
Definition cart_grid_tp.hpp:184
BoundBox< dim > get_domain() const
Creates the bounding box of the subgrid's domain.
const CartGridTP< dim > & get_grid() const
Gets the parent grid.
TensorSizeTP< dim > get_num_cells_dir() const
Gets the number of cells (spans) per direction of the subgrid.
int get_num_cells() const
Gets the total number of cells of the subgrid.
int to_flat(const TensorIndexTP< dim > &tid) const
Gets the flat index of a grid cells from the tensor index.
bool is_unique_cell() const
Checks if the subgrid has only one cell.
std::array< std::shared_ptr< const SubCartGridTP< dim > >, 2 > split() const
Splits the current subgrid along the direction with a largest number of cells.
SubCartGridTP(const CartGridTP< dim > &grid, const TensorIndexRangeTP< dim > &indices_range)
Constructor.
SubCartGridTP(const CartGridTP< dim > &grid)
Constructor. Creates a subgrid containing the full grid.
const TensorIndexRangeTP< dim > & get_range() const
Gets a range describing the range of the subrid.
Class representing a dim-dimensional range defined by lower and upper tensor bounds.
Definition tensor_index_tp.hpp:243
Class representing a dim-dimensional tensor-product indices.
Definition tensor_index_tp.hpp:95
Class representing a dim-dimensional tensor-product sizes container.
Definition tensor_index_tp.hpp:38
Class for tolerance related computations.
Definition tolerance.hpp:33
QUGaR's main namespace.
Definition affine_transf.hpp:28
Vector< T, dim > Point
Class representing a dim-dimensional Point.
Definition point.hpp:34
Definition and implementation of Point class.
Declaration of tensor-product index and size related classes.
Definition of tolerance related functionalities.