13#ifndef dealii_grid_refinement_choice_h
14#define dealii_grid_refinement_choice_h
85 operator std::uint8_t()
const;
171 constexpr unsigned int
212 const std::uint8_t kind)
215 static_assert(0 <= dim && dim <= 3,
"Only implemented for 0d - 3d.");
218 if constexpr (dim == 0)
220 ExcMessage(
"The only valid RefinementChoices in 0d are None and "
222 else if constexpr (dim == 1)
224 ExcMessage(
"The only valid RefinementChoices in 1d are None and "
226 else if constexpr (dim == 2)
228 ExcMessage(
"The only valid RefinementChoices in 2d are None, "
229 "CutX, CutY, and Isotropic."));
230 else if constexpr (dim == 3)
232 ExcMessage(
"This RefinementChoice isn't implemented in 3d."));
257 internal::make_refinement_choice_from_int<dim>(0);
267 internal::make_refinement_choice_from_int<dim>(1);
276 internal::make_refinement_choice_from_int<dim>(2);
286 internal::make_refinement_choice_from_int<dim>(3);
293 internal::make_refinement_choice_from_int<dim>(4);
300 internal::make_refinement_choice_from_int<dim>(5);
307 internal::make_refinement_choice_from_int<dim>(6);
319 internal::make_refinement_choice_from_int<dim>(dim == 0 ? 1 :
328 internal::make_refinement_choice_from_int<dim>(8);
336 internal::make_refinement_choice_from_int<dim>(9);
344 internal::make_refinement_choice_from_int<dim>(10);
351operator std::uint8_t()
const
362 return this->kind == other.
kind;
371 return !(*
this == other);
382 if (*
this == other_choice)
384 if (this->kind > other_choice.
kind)
385 return other_choice.operator|(*this);
387 if (*
this == RefinementChoices::None<dim>)
396 Assert(this->is_tetrahedral(),
397 ExcMessage(
"Tetrahedral refinements (e.g., Cut49) cannot be combined "
398 "with refinements of other cells (e.g., CutX or "
400 Assert(*
this == other_choice,
401 ExcMessage(
"The union of distinct tetrahedral refinements, e.g., "
402 "Cut49 with Cut57, is not defined since these are mutually "
403 "exclusive operations."));
404 return RefinementChoices::None<dim>;
415 if (*
this == other_choice)
417 if (this->kind > other_choice.
kind)
418 return other_choice.operator&(*this);
420 if (*
this == RefinementChoices::None<dim>)
430 Assert(this->is_tetrahedral(),
431 ExcMessage(
"Tetrahedral refinements (e.g., Cut49) cannot be combined "
432 "with refinements of other cells (e.g., CutX or "
435 return RefinementChoices::None<dim>;
444 if (this->is_tetrahedral())
445 return RefinementChoices::None<dim>;
456 return !(*
this == RefinementChoices::None<dim> ||
457 *
this == RefinementChoices::Isotropic<dim> ||
458 this->is_tetrahedral());
481 return dim == 3 && this->kind > isotropic_kind;
487inline constexpr unsigned int
491 ExcMessage(
"This function may only be called on tetrahedral "
492 "refinement choices."));
495 case RefinementChoices::Cut49<3>:
497 case RefinementChoices::Cut57<3>:
499 case RefinementChoices::Cut68<3>:
A class which enumerates refinement possibilities for all supported ReferenceCell objects.
constexpr RefinementChoice< dim > operator|(const RefinementChoice< dim > &other_choice) const
constexpr RefinementChoice< dim > operator&(const RefinementChoice< dim > &other_choice) const
static constexpr RefinementChoice< dim > cut_axis(const unsigned int i)
constexpr unsigned int new_tetrahedron_line() const
constexpr bool is_anisotropic() const
constexpr bool operator==(const RefinementChoice< dim > &other_choice) const
constexpr bool is_tetrahedral() const
constexpr bool operator!=(const RefinementChoice< dim > &other_choice) const
constexpr RefinementChoice()
std::string to_string() const
constexpr RefinementChoice< dim > operator~() const
static constexpr std::uint8_t isotropic_kind
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
constexpr RefinementChoice< dim > CutXZ
constexpr RefinementChoice< dim > CutZ
constexpr RefinementChoice< dim > Cut57
constexpr RefinementChoice< dim > CutXY
constexpr RefinementChoice< dim > CutX
constexpr RefinementChoice< dim > Isotropic
constexpr RefinementChoice< dim > CutYZ
constexpr RefinementChoice< dim > CutY
constexpr RefinementChoice< dim > Cut49
constexpr RefinementChoice< dim > Cut68
constexpr RefinementChoice< dim > None
constexpr RefinementChoice< dim > make_refinement_choice_from_int(const std::uint8_t kind)
constexpr unsigned int invalid_unsigned_int