30 template <
int spacedim>
33 : has_pyramids(dim == 3 &&
std::find(tria.get_reference_cells().
begin(),
34 tria.get_reference_cells().
end(),
36 tria.get_reference_cells().
end())
37 , max_children_per_cell(
41 , n_coarse_cells(tria.n_global_coarse_cells())
42 , n_global_levels(tria.n_global_levels())
51 std::uint64_t max_cell_index = 0;
61 max_cell_index <= std::numeric_limits<types::global_cell_index>::max(),
63 "You have exceeded the maximal number of possible indices this function "
64 "can handle. The current setup (n_coarse_cells=" +
66 ", n_global_levels=" + std::to_string(
n_global_levels) +
") requires " +
67 std::to_string(max_cell_index + 1) +
68 " indices but the current deal.II configuration only supports " +
69 std::to_string(std::numeric_limits<types::global_cell_index>::max()) +
70 " indices. You may want to consider to build deal.II with 64bit "
71 "indices (-D DEAL_II_WITH_64BIT_INDICES=\"ON\") to increase the limit "
93 std::uint8_t
level = 0;
95 if (
id < tree_sizes[
level])
101 for (std::uint8_t l = 0; l <
level; ++l)
107 constexpr unsigned int pyramid_max_children_per_cell =
109 Assert(max_children_per_cell <= pyramid_max_children_per_cell,
111 child_indices.push_back(id_temp % pyramid_max_children_per_cell);
112 id_temp /= pyramid_max_children_per_cell;
116 constexpr unsigned int hypercube_max_children_per_cell =
117 ReferenceCells::get_hypercube<dim>().n_isotropic_children();
121 Assert(max_children_per_cell <= hypercube_max_children_per_cell,
123 child_indices.push_back(id_temp % hypercube_max_children_per_cell);
124 id_temp /= hypercube_max_children_per_cell;
128 std::reverse(child_indices.begin(), child_indices.end());
131 static_cast<unsigned int>(child_indices.size()),
132 child_indices.data());
144 level_cell_id = level_cell_id * max_children_per_cell + child_index;
146 return level_cell_id;
153#include "grid/cell_id_translator.inst"
ArrayView< const std::uint8_t > get_child_indices() const
types::coarse_cell_id get_coarse_cell_id() const
const types::global_cell_index n_global_levels
const unsigned int max_children_per_cell
CellIDTranslator(const Triangulation< dim, spacedim > &tria)
std::vector< types::global_cell_index > tree_sizes
CellId to_cell_id(const types::global_cell_index id) const
const types::global_cell_index n_coarse_cells
types::global_cell_index to_level_cell_index(const CellId &cell_id) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
constexpr ReferenceCell< 3 > Pyramid
constexpr std::uint8_t max_n_levels