deal.II version GIT relicensing-7182-g951947b1c4 2026-11-26 10:30:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
RefinementChoice< dim > Class Template Reference

A class which enumerates refinement possibilities for all supported ReferenceCell objects. More...

#include <deal.II/grid/refinement_choice.h>

Detailed Description

template<int dim>
class RefinementChoice< dim >

A class which enumerates refinement possibilities for all supported ReferenceCell objects.

Not every RefinementChoice can be used with every reference cell. For example, RefinementChoices::CutX<dim> only makes sense for quadrilaterals and hexahedra. See ReferenceCell::is_compatible() for more information.

Definition at line 64 of file refinement_choice.h.

Public Member Functions

constexpr RefinementChoice ()
 
constexpr operator std::uint8_t () const
 
constexpr bool operator== (const RefinementChoice< dim > &other_choice) const
 
constexpr bool operator!= (const RefinementChoice< dim > &other_choice) const
 
std::string to_string () const
 
constexpr RefinementChoice< dim > operator| (const RefinementChoice< dim > &other_choice) const
 
constexpr RefinementChoice< dim > operator& (const RefinementChoice< dim > &other_choice) const
 
constexpr RefinementChoice< dim > operator~ () const
 
constexpr bool is_anisotropic () const
 
constexpr bool is_tetrahedral () const
 
constexpr unsigned int new_tetrahedron_line () const
 

Static Public Member Functions

static constexpr RefinementChoice< dim > cut_axis (const unsigned int i)
 

Private Member Functions

constexpr RefinementChoice (const std::uint8_t kind)
 

Private Attributes

std::uint8_t kind
 

Static Private Attributes

static constexpr std::uint8_t isotropic_kind = dim == 0 ? 1 : (1 << dim) - 1
 

Friends

template<int dim_>
constexpr RefinementChoice< dim_ > internal::make_refinement_choice_from_int (const std::uint8_t)
 

Constructor & Destructor Documentation

◆ RefinementChoice() [1/2]

template<int dim>
constexpr RefinementChoice< dim >::RefinementChoice ( )
inlineconstexpr

Default constructor. Creates a RefinementChoices::None<dim>.

Definition at line 204 of file refinement_choice.h.

◆ RefinementChoice() [2/2]

template<int dim>
constexpr RefinementChoice< dim >::RefinementChoice ( const std::uint8_t  kind)
inlineexplicitconstexprprivate

Constructor.

Definition at line 211 of file refinement_choice.h.

Member Function Documentation

◆ operator std::uint8_t()

template<int dim>
constexpr RefinementChoice< dim >::operator std::uint8_t ( ) const
inlineconstexpr

Conversion operator to the underlying integral type.

Note
Since RefinementChoices::None<dim> is always 0, the subsequent conversion from an integer to a boolean may be used to check if any refinement should be done (e.g., in an if-statement).
This function is intended for converting to a boolean, serialization, and switch statements. In most applications (such as indices into arrays of prolongation or restriction matrices) the more useful integer value is the one provided by ReferenceCell::refinement_choice_index().

Definition at line 350 of file refinement_choice.h.

◆ operator==()

template<int dim>
constexpr bool RefinementChoice< dim >::operator== ( const RefinementChoice< dim > &  other_choice) const
inlineconstexpr

Comparison operator.

Definition at line 360 of file refinement_choice.h.

◆ operator!=()

template<int dim>
constexpr bool RefinementChoice< dim >::operator!= ( const RefinementChoice< dim > &  other_choice) const
inlineconstexpr

Comparison operator.

Definition at line 369 of file refinement_choice.h.

◆ to_string()

template<int dim>
std::string RefinementChoice< dim >::to_string ( ) const

Return a string representation of the present object, e.g., "CutX".

Definition at line 19 of file refinement_choice.cc.

◆ operator|()

template<int dim>
constexpr RefinementChoice< dim > RefinementChoice< dim >::operator| ( const RefinementChoice< dim > &  other_choice) const
inlineconstexpr

Create a new RefinementChoice which is the union of the current object and other_choice.

Note
This function is intended to be used with anisotropic refinement. As all tetrahedral refinement possibilities are mutually exclusive, this operation is only defined for tetrahedra when other_choice == *this.

Definition at line 378 of file refinement_choice.h.

◆ operator&()

template<int dim>
constexpr RefinementChoice< dim > RefinementChoice< dim >::operator& ( const RefinementChoice< dim > &  other_choice) const
inlineconstexpr

Create a new RefinementChoice which is the intersection of the current object and other_choice.

Note
This function is intended to be used with anisotropic refinement. As all tetrahedral refinement possibilities are mutually exclusive, for those choices if other_choice == *this then this returns *this and otherwise it returns RefinementChoices::None<3>.

Definition at line 411 of file refinement_choice.h.

◆ operator~()

template<int dim>
constexpr RefinementChoice< dim > RefinementChoice< dim >::operator~ ( ) const
inlineconstexpr

Invert the RefinementChoice.

Note
This function is intended to be used with anisotropic refinement. Hence, even though RefinementChoices::None<3> is valid for both hexahedra and tetrahedra, this function assumes the caller is refining a hexahedron and will (for that value) return RefinementChoices::Isotropic<3> (which is not valid for tetrahedra).

Definition at line 442 of file refinement_choice.h.

◆ is_anisotropic()

template<int dim>
constexpr bool RefinementChoice< dim >::is_anisotropic ( ) const
inlineconstexpr

Return whether or not the refinement is anisotropic.

Note
Since tetrahedra have multiple isotropic refinements, generic code should use this function instead of comparing with RefinementChoices::Isotropic<dim> (which is not a valid refinement choice for tetrahedra).

Definition at line 454 of file refinement_choice.h.

◆ cut_axis()

template<int dim>
constexpr RefinementChoice< dim > RefinementChoice< dim >::cut_axis ( const unsigned int  i)
inlinestaticconstexpr

Return the RefinementChoice corresponding to cutting a hypercube along the axis i. For example, if i == 0 and dim == 3 then the returned value is RefinementChoices::CutX<3>.

Definition at line 465 of file refinement_choice.h.

◆ is_tetrahedral()

template<int dim>
constexpr bool RefinementChoice< dim >::is_tetrahedral ( ) const
inlineconstexpr

Return whether or not the present object is one of the RefinementChoices specific to tetrahedra.

Definition at line 479 of file refinement_choice.h.

◆ new_tetrahedron_line()

template<int dim>
constexpr unsigned int RefinementChoice< dim >::new_tetrahedron_line ( ) const
inlineconstexpr

Return the internal line for tetrahedral refinement. This function may only be called when *this is one of RefinementChoices::Cut49<3>, RefinementChoices::Cut57<3>, or RefinementChoices::Cut68<3>.

Definition at line 488 of file refinement_choice.h.

Friends And Related Symbol Documentation

◆ internal::make_refinement_choice_from_int

template<int dim>
template<int dim_>
constexpr RefinementChoice< dim_ > internal::make_refinement_choice_from_int ( const std::uint8_t  )
friend

A kind of constructor – not quite private because it can be called by anyone, but at least hidden in an internal namespace.

Member Data Documentation

◆ isotropic_kind

template<int dim>
constexpr std::uint8_t RefinementChoice< dim >::isotropic_kind = dim == 0 ? 1 : (1 << dim) - 1
staticconstexprprivate

The value of RefinementChoice::kind corresponding to isotropic refinement.

Definition at line 178 of file refinement_choice.h.

◆ kind

template<int dim>
std::uint8_t RefinementChoice< dim >::kind
private

The variable that stores what this object actually corresponds to.

Definition at line 183 of file refinement_choice.h.


The documentation for this class was generated from the following files: