17 #ifndef __deal2__geometry_info_h
18 #define __deal2__geometry_info_h
21 #include <deal.II/base/config.h>
23 #include <deal.II/base/point.h>
83 isotropic_refinement =
static_cast<unsigned char>(-1)
141 isotropic_refinement = cut_x
200 cut_xy = cut_x | cut_y,
202 isotropic_refinement = cut_xy
262 cut_xy = cut_x | cut_y,
264 cut_xz = cut_x | cut_z,
265 cut_yz = cut_y | cut_z,
266 cut_xyz = cut_x | cut_y | cut_z,
268 isotropic_refinement = cut_xyz
339 operator unsigned char ()
const;
392 static std::size_t memory_consumption ();
398 template <
class Archive>
399 void serialize(Archive &ar,
400 const unsigned int version);
407 <<
"The refinement flags given (" << arg1 <<
") contain set bits that do not "
408 <<
"make sense for the space dimension of the object to which they are applied.");
417 unsigned char value :
459 case_isotropic =
static_cast<unsigned char>(-1)
488 case_isotropic = case_none
521 case_isotropic = case_none
559 case_isotropic = case_x
686 case_isotropic = case_xy
740 operator unsigned char ()
const;
747 static std::size_t memory_consumption ();
754 <<
"The subface case given (" << arg1 <<
") does not make sense "
755 <<
"for the space dimension of the object to which they are applied.");
764 unsigned char value :
812 static const unsigned int max_children_per_cell = 1;
817 static const unsigned int faces_per_cell = 0;
830 static const unsigned int max_children_per_face = 0;
845 static const unsigned int vertices_per_cell = 1;
856 static const unsigned int vertices_per_face = 0;
861 static const unsigned int lines_per_face = 0;
866 static const unsigned int quads_per_face = 0;
871 static const unsigned int lines_per_cell = 0;
877 static const unsigned int quads_per_cell = 0;
883 static const unsigned int hexes_per_cell = 0;
1437 static const unsigned int max_children_per_cell = 1 << dim;
1442 static const unsigned int faces_per_cell = 2 * dim;
1455 static const unsigned int max_children_per_face =
GeometryInfo<dim-1>::max_children_per_cell;
1460 static const unsigned int vertices_per_cell = 1 << dim;
1466 static const unsigned int vertices_per_face =
GeometryInfo<dim-1>::vertices_per_cell;
1471 static const unsigned int lines_per_face
1477 static const unsigned int quads_per_face
1492 static const unsigned int lines_per_cell
1506 static const unsigned int quads_per_cell
1514 static const unsigned int hexes_per_cell
1544 static const unsigned int ucd_to_deal[vertices_per_cell];
1565 static const unsigned int dx_to_deal[vertices_per_cell];
1584 static const unsigned int vertex_to_face[vertices_per_cell][dim];
1623 const unsigned int subface_no);
1636 const unsigned int face_no,
1637 const bool face_orientation =
true,
1638 const bool face_flip =
false,
1639 const bool face_rotation =
false);
1651 min_cell_refinement_case_for_face_refinement
1653 const unsigned int face_no,
1654 const bool face_orientation =
true,
1655 const bool face_flip =
false,
1656 const bool face_rotation =
false);
1668 const unsigned int line_no);
1678 min_cell_refinement_case_for_line_refinement(
const unsigned int line_no);
1748 const unsigned int face,
1749 const unsigned int subface,
1750 const bool face_orientation =
true,
1751 const bool face_flip =
false,
1752 const bool face_rotation =
false,
1779 line_to_cell_vertices (
const unsigned int line,
1780 const unsigned int vertex);
1818 face_to_cell_vertices (
const unsigned int face,
1819 const unsigned int vertex,
1820 const bool face_orientation =
true,
1821 const bool face_flip =
false,
1822 const bool face_rotation =
false);
1845 face_to_cell_lines (
const unsigned int face,
1846 const unsigned int line,
1847 const bool face_orientation =
true,
1848 const bool face_flip =
false,
1849 const bool face_rotation =
false);
1866 standard_to_real_face_vertex (
const unsigned int vertex,
1867 const bool face_orientation =
true,
1868 const bool face_flip =
false,
1869 const bool face_rotation =
false);
1886 real_to_standard_face_vertex (
const unsigned int vertex,
1887 const bool face_orientation =
true,
1888 const bool face_flip =
false,
1889 const bool face_rotation =
false);
1906 standard_to_real_face_line (
const unsigned int line,
1907 const bool face_orientation =
true,
1908 const bool face_flip =
false,
1909 const bool face_rotation =
false);
1926 real_to_standard_face_line (
const unsigned int line,
1927 const bool face_orientation =
true,
1928 const bool face_flip =
false,
1929 const bool face_rotation =
false);
1940 unit_cell_vertex (
const unsigned int vertex);
1977 cell_to_child_coordinates (
const Point<dim> &p,
1978 const unsigned int child_index,
1992 child_to_cell_coordinates (
const Point<dim> &p,
1993 const unsigned int child_index,
2062 d_linear_shape_function (
const Point<dim> &xi,
2063 const unsigned int i);
2072 d_linear_shape_function_gradient (
const Point<dim> &xi,
2073 const unsigned int i);
2171 template <
int spacedim>
2173 alternating_form_at_vertices
2174 #ifndef DEAL_II_CONSTEXPR_BUG
2179 Tensor<spacedim-dim,spacedim> *forms);
2199 static const unsigned int unit_normal_direction[faces_per_cell];
2232 static const int unit_normal_orientation[faces_per_cell];
2241 static const unsigned int opposite_face[faces_per_cell];
2249 <<
"The coordinates must satisfy 0 <= x_i <= 1, "
2250 <<
"but here we have x_i=" << arg1);
2257 <<
"RefinementCase<dim> " << arg1 <<
": face " << arg2
2258 <<
" has no subface " << arg3);
2269 #ifndef DEAL_II_MEMBER_ARRAY_SPECIALIZATION_BUG
2303 const unsigned int i);
2308 const unsigned int i);
2313 const unsigned int i);
2325 SubfaceCase<dim>::SubfaceCase (
const typename SubfacePossibilities<dim>::Possibilities subface_possibility)
2327 value (subface_possibility)
2333 SubfaceCase<dim>::operator
unsigned char ()
const
2348 return static_cast<unsigned char>(-1);
2357 const unsigned int dim = 1;
2371 const unsigned int dim = 2;
2387 const unsigned int dim = 3;
2413 value (refinement_case)
2421 ExcInvalidRefinementCase (refinement_case));
2430 value (refinement_case)
2438 ExcInvalidRefinementCase (refinement_case));
2495 template <
class Archive>
2501 unsigned char uchar_value = value;
2503 value = uchar_value;
2514 Assert (vertex < vertices_per_cell,
2517 return Point<1>(
static_cast<double>(vertex));
2527 Assert (vertex < vertices_per_cell,
2530 return Point<2>(vertex%2, vertex/2);
2540 Assert (vertex < vertices_per_cell,
2543 return Point<3>(vertex%2, vertex/2%2, vertex/4);
2565 Assert ((p[0] >= 0) && (p[0] <= 1), ExcInvalidCoordinate(p[0]));
2567 return (p[0] <= 0.5 ? 0 : 1);
2577 Assert ((p[0] >= 0) && (p[0] <= 1), ExcInvalidCoordinate(p[0]));
2578 Assert ((p[1] >= 0) && (p[1] <= 1), ExcInvalidCoordinate(p[1]));
2580 return (p[0] <= 0.5 ?
2581 (p[1] <= 0.5 ? 0 : 2) :
2582 (p[1] <= 0.5 ? 1 : 3));
2592 Assert ((p[0] >= 0) && (p[0] <= 1), ExcInvalidCoordinate(p[0]));
2593 Assert ((p[1] >= 0) && (p[1] <= 1), ExcInvalidCoordinate(p[1]));
2594 Assert ((p[2] >= 0) && (p[2] <= 1), ExcInvalidCoordinate(p[2]));
2596 return (p[0] <= 0.5 ?
2598 (p[2] <= 0.5 ? 0 : 4) :
2599 (p[2] <= 0.5 ? 2 : 6)) :
2601 (p[2] <= 0.5 ? 1 : 5) :
2602 (p[2] <= 0.5 ? 3 : 7)));
2622 const unsigned int child_index,
2632 return p*2.0-unit_cell_vertex(child_index);
2641 const unsigned int child_index,
2649 switch (refine_case)
2663 point-=unit_cell_vertex(child_index);
2678 const unsigned int child_index,
2691 switch (refine_case)
2711 if (child_index%2==1)
2713 if (child_index/2==1)
2723 if (child_index/2==1)
2725 if (child_index%2==1)
2731 if (child_index%2==1)
2733 if (child_index/2==1)
2738 point-=unit_cell_vertex(child_index);
2753 const unsigned int ,
2767 const unsigned int child_index,
2777 return (p+unit_cell_vertex(child_index))*0.5;
2786 const unsigned int child_index,
2799 switch (refine_case)
2817 if (child_index%2==1)
2819 if (child_index/2==1)
2829 if (child_index/2==1)
2831 if (child_index%2==1)
2837 if (child_index%2==1)
2839 if (child_index/2==1)
2845 point+=unit_cell_vertex(child_index);
2861 const unsigned int child_index,
2868 switch (refine_case)
2881 point+=unit_cell_vertex(child_index);
2897 const unsigned int ,
2911 return (p[0] >= 0.) && (p[0] <= 1.);
2921 return (p[0] >= 0.) && (p[0] <= 1.) &&
2922 (p[1] >= 0.) && (p[1] <= 1.);
2932 return (p[0] >= 0.) && (p[0] <= 1.) &&
2933 (p[1] >= 0.) && (p[1] <= 1.) &&
2934 (p[2] >= 0.) && (p[2] <= 1.);
2943 return (p[0] >= -eps) && (p[0] <= 1.+eps);
2954 const double l = -eps, u = 1+eps;
2955 return (p[0] >= l) && (p[0] <= u) &&
2956 (p[1] >= l) && (p[1] <= u);
2967 const double l = -eps, u = 1.0+eps;
2968 return (p[0] >= l) && (p[0] <= u) &&
2969 (p[1] >= l) && (p[1] <= u) &&
2970 (p[2] >= l) && (p[2] <= u);
2975 DEAL_II_NAMESPACE_CLOSE
static Point< dim > child_to_cell_coordinates(const Point< dim > &p, const unsigned int child_index, const RefinementCase< dim > refine_case=RefinementCase< dim >::isotropic_refinement)
UpdateFlags operator&(UpdateFlags f1, UpdateFlags f2)
static unsigned int child_cell_from_point(const Point< dim > &p)
RefinementCase operator|(const RefinementCase &r) const
static bool is_inside_unit_cell(const Point< dim > &p)
void serialize(Archive &ar, const unsigned int version)
static Point< dim > cell_to_child_coordinates(const Point< dim > &p, const unsigned int child_index, const RefinementCase< dim > refine_case=RefinementCase< dim >::isotropic_refinement)
static Point< dim > unit_cell_vertex(const unsigned int vertex)
#define AssertThrow(cond, exc)
static Tensor< 1, dim > d_linear_shape_function_gradient(const Point< dim > &xi, const unsigned int i)
RefinementCase operator~() const
#define DeclException1(Exception1, type1, outsequence)
#define Assert(cond, exc)
UpdateFlags operator|(UpdateFlags f1, UpdateFlags f2)
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
static std::size_t memory_consumption()
RefinementCase operator&(const RefinementCase &r) const
::ExceptionBase & ExcNotImplemented()
#define DeclException3(Exception3, type1, type2, type3, outsequence)
::ExceptionBase & ExcInternalError()
static RefinementCase cut_axis(const unsigned int i)