16 #ifndef dealii_tria_accessor_h 17 #define dealii_tria_accessor_h 38 template <
int dim,
int spacedim>
40 template <
typename Accessor>
42 template <
typename Accessor>
44 template <
typename Accessor>
47 template <
int dim,
int spacedim>
53 namespace TriangulationImplementation
62 namespace TriaAccessorImplementation
64 struct Implementation;
71 template <
int structdim,
int dim>
126 template <
int structdim,
int dim,
int spacedim>
128 template <
int dim,
int spacedim>
130 template <
int spacedim>
148 "The operation you are attempting can only be performed for " 149 "(cell, face, or edge) iterators that point to valid " 150 "objects. These objects need not necessarily be active, " 151 "i.e., have no children, but they need to be part of a " 152 "triangulation. (The objects pointed to by an iterator " 153 "may -- after coarsening -- also be objects that used " 154 "to be part of a triangulation, but are now no longer " 155 "used. Their memory location may have been retained " 156 "for re-use upon the next mesh refinement, but is " 157 "currently unused.)");
168 "The operation you are attempting can only be performed for " 169 "(cell, face, or edge) iterators that point to 'active' " 170 "objects. 'Active' objects are those that do not have " 171 "children (in the case of cells), or that are part of " 172 "an active cell (in the case of faces or edges). However, " 173 "the object on which you are trying the current " 174 "operation is not 'active' in this sense.");
181 "The operation you are attempting can only be performed for " 182 "(cell, face, or edge) iterators that have children, " 183 "but the object on which you are trying the current " 184 "operation does not have any.");
192 "The operation you are attempting can only be performed for " 193 "(cell, face, or edge) iterators that have a parent object, " 194 "but the object on which you are trying the current " 195 "operation does not have one -- i.e., it is on the " 196 "coarsest level of the triangulation.");
202 <<
"You can only set the child index if the cell does not " 203 <<
"currently have children registered; or you can clear it. " 204 <<
"The given index was " << arg1
205 <<
" (-1 means: clear children).");
209 template <
typename AccessorType>
212 <<
"You tried to dereference an iterator for which this " 213 <<
"is not possible. More information on this iterator: " 214 <<
"index=" << arg1.index() <<
", state=" 224 "Iterators can only be compared if they point to the same " 225 "triangulation, or if neither of them are associated " 226 "with a triangulation.");
259 <<
"You can only set the child index of an even numbered child." 260 <<
"The number of the child given was " << arg1 <<
".");
290 template <
int structdim,
int dim,
int spacedim = dim>
299 static const unsigned int space_dimension = spacedim;
306 static const unsigned int dimension = dim;
313 static const unsigned int structure_dimension = structdim;
339 const int level = -1,
340 const int index = -1,
501 get_triangulation()
const;
511 typename ::internal::TriaAccessorImplementation::
526 template <
typename Accessor>
528 template <
typename Accessor>
530 template <
typename Accessor>
557 template <
int structdim,
int dim,
int spacedim = dim>
575 const int level = -1,
576 const int index = -1,
592 template <
typename OtherAccessor>
629 has_children()
const;
647 set_user_index(
const unsigned int p)
const;
659 vertex(
const unsigned int i)
const;
665 typename ::internal::TriangulationImplementation::
666 Iterators<dim, spacedim>::line_iterator
667 line(
const unsigned int i)
const;
673 typename ::internal::TriangulationImplementation::
674 Iterators<dim, spacedim>::quad_iterator
675 quad(
const unsigned int i)
const;
698 template <
int structdim,
int dim,
int spacedim>
712 const int level = -1,
713 const int index = -1,
728 template <
int structdim2,
int dim2,
int spacedim2>
735 template <
int structdim2,
int dim2,
int spacedim2>
771 vertex_iterator(
const unsigned int i)
const;
789 vertex_index(
const unsigned int i)
const;
829 vertex(
const unsigned int i)
const;
834 typename ::internal::TriangulationImplementation::
835 Iterators<dim, spacedim>::line_iterator
836 line(
const unsigned int i)
const;
845 line_index(
const unsigned int i)
const;
850 typename ::internal::TriangulationImplementation::
851 Iterators<dim, spacedim>::quad_iterator
852 quad(
const unsigned int i)
const;
861 quad_index(
const unsigned int i)
const;
885 face_orientation(
const unsigned int face)
const;
897 face_flip(
const unsigned int face)
const;
909 face_rotation(
const unsigned int face)
const;
922 line_orientation(
const unsigned int line)
const;
938 has_children()
const;
961 number_of_children()
const;
977 max_refinement_depth()
const;
983 child(
const unsigned int i)
const;
990 child_iterator_to_index(
1002 isotropic_child(
const unsigned int i)
const;
1008 refinement_case()
const;
1016 child_index(
const unsigned int i)
const;
1024 isotropic_child_index(
const unsigned int i)
const;
1122 at_boundary()
const;
1134 get_manifold()
const;
1212 user_flag_set()
const;
1220 set_user_flag()
const;
1228 clear_user_flag()
const;
1236 recursively_set_user_flag()
const;
1244 recursively_clear_user_flag()
const;
1252 clear_user_data()
const;
1266 set_user_pointer(
void *p)
const;
1274 clear_user_pointer()
const;
1292 user_pointer()
const;
1316 recursively_set_user_pointer(
void *p)
const;
1325 recursively_clear_user_pointer()
const;
1337 set_user_index(
const unsigned int p)
const;
1345 clear_user_index()
const;
1379 recursively_set_user_index(
const unsigned int p)
const;
1390 recursively_clear_user_index()
const;
1438 std::pair<Point<spacedim>,
double>
1439 enclosing_ball()
const;
1450 bounding_box()
const;
1462 extent_in_direction(
const unsigned int axis)
const;
1468 minimum_vertex_distance()
const;
1546 center(
const bool respect_manifold =
false,
1547 const bool interpolate_from_surrounding =
false)
const;
1633 set(const ::internal::TriangulationImplementation::TriaObject<structdim>
1644 set_line_orientation(
const unsigned int line,
const bool orientation)
const;
1657 set_face_orientation(
const unsigned int face,
const bool orientation)
const;
1666 set_face_flip(
const unsigned int face,
const bool flip)
const;
1675 set_face_rotation(
const unsigned int face,
const bool rotation)
const;
1681 set_used_flag()
const;
1687 clear_used_flag()
const;
1708 clear_refinement_case()
const;
1717 set_children(
const unsigned int i,
const int index)
const;
1724 clear_children()
const;
1730 friend struct ::internal::TriangulationImplementation::Implementation;
1731 friend struct ::internal::TriaAccessorImplementation::Implementation;
1755 template <
int dim,
int spacedim>
1764 static const unsigned int space_dimension = spacedim;
1771 static const unsigned int dimension = dim;
1778 static const unsigned int structure_dimension = 0;
1790 const unsigned int vertex_index);
1798 const int level = 0,
1799 const int index = 0,
1805 template <
int structdim2,
int dim2,
int spacedim2>
1811 template <
int structdim2,
int dim2,
int spacedim2>
1839 get_triangulation()
const;
1898 vertex_index(
const unsigned int i = 0)
const;
1906 vertex(
const unsigned int i = 0)
const;
1912 typename ::internal::TriangulationImplementation::
1913 Iterators<dim, spacedim>::line_iterator
static line(
const unsigned int);
1919 line_index(
const unsigned int i);
1924 static typename ::internal::TriangulationImplementation::
1925 Iterators<dim, spacedim>::quad_iterator
1926 quad(
const unsigned int i);
1932 quad_index(
const unsigned int i);
1960 extent_in_direction(
const unsigned int axis)
const;
1970 center(
const bool respect_manifold =
false,
1971 const bool interpolate_from_surrounding =
false)
const;
1998 face_orientation(
const unsigned int face);
2004 face_flip(
const unsigned int face);
2010 face_rotation(
const unsigned int face);
2016 line_orientation(
const unsigned int line);
2047 number_of_children();
2053 max_refinement_depth();
2065 child(
const unsigned int);
2071 isotropic_child(
const unsigned int);
2083 child_index(
const unsigned int i);
2089 isotropic_child_index(
const unsigned int i);
2133 template <
typename Accessor>
2135 template <
typename Accessor>
2137 template <
typename Accessor>
2160 template <
int spacedim>
2169 static const unsigned int space_dimension = spacedim;
2176 static const unsigned int dimension = 1;
2183 static const unsigned int structure_dimension = 0;
2223 const unsigned int vertex_index);
2238 template <
int structdim2,
int dim2,
int spacedim2>
2244 template <
int structdim2,
int dim2,
int spacedim2>
2281 get_triangulation()
const;
2352 vertex_index(
const unsigned int i = 0)
const;
2360 vertex(
const unsigned int i = 0)
const;
2373 typename ::internal::TriangulationImplementation::
2374 Iterators<1, spacedim>::line_iterator
static line(
const unsigned int);
2383 line_index(
const unsigned int i);
2388 static typename ::internal::TriangulationImplementation::
2389 Iterators<1, spacedim>::quad_iterator
2390 quad(
const unsigned int i);
2399 quad_index(
const unsigned int i);
2411 at_boundary()
const;
2434 get_manifold()
const;
2457 face_orientation(
const unsigned int face);
2463 face_flip(
const unsigned int face);
2469 face_rotation(
const unsigned int face);
2475 line_orientation(
const unsigned int line);
2506 number_of_children();
2512 max_refinement_depth();
2524 child(
const unsigned int);
2530 isotropic_child(
const unsigned int);
2542 child_index(
const unsigned int i);
2548 isotropic_child_index(
const unsigned int i);
2666 template <
int dim,
int spacedim = dim>
2691 const int level = -1,
2692 const int index = -1,
2712 template <
int structdim2,
int dim2,
int spacedim2>
2719 template <
int structdim2,
int dim2,
int spacedim2>
2750 child(
const unsigned int i)
const;
2756 face(
const unsigned int i)
const;
2763 face_iterator_to_index(
2771 face_iterators()
const;
2783 face_index(
const unsigned int i)
const;
2833 neighbor_child_on_subface(
const unsigned int face_no,
2834 const unsigned int subface_no)
const;
2858 neighbor(
const unsigned int i)
const;
2865 neighbor_index(
const unsigned int i)
const;
2872 neighbor_level(
const unsigned int i)
const;
2886 neighbor_of_neighbor(
const unsigned int neighbor)
const;
2899 neighbor_is_coarser(
const unsigned int neighbor)
const;
2915 std::pair<unsigned int, unsigned int>
2916 neighbor_of_coarser_neighbor(
const unsigned int neighbor)
const;
2925 neighbor_face_no(
const unsigned int neighbor)
const;
2947 has_periodic_neighbor(
const unsigned int i)
const;
2966 periodic_neighbor(
const unsigned int i)
const;
2976 neighbor_or_periodic_neighbor(
const unsigned int i)
const;
2993 periodic_neighbor_child_on_subface(
const unsigned int face_no,
2994 const unsigned int subface_no)
const;
3006 std::pair<unsigned int, unsigned int>
3007 periodic_neighbor_of_coarser_periodic_neighbor(
const unsigned face_no)
const;
3015 periodic_neighbor_index(
const unsigned int i)
const;
3023 periodic_neighbor_level(
const unsigned int i)
const;
3040 periodic_neighbor_of_periodic_neighbor(
const unsigned int i)
const;
3048 periodic_neighbor_face_no(
const unsigned int i)
const;
3057 periodic_neighbor_is_coarser(
const unsigned int i)
const;
3076 at_boundary(
const unsigned int i)
const;
3087 at_boundary()
const;
3097 has_boundary_lines()
const;
3124 refine_flag_set()
const;
3151 clear_refine_flag()
const;
3161 flag_for_face_refinement(
3162 const unsigned int face_no,
3172 flag_for_line_refinement(
const unsigned int line_no)
const;
3183 subface_case(
const unsigned int face_no)
const;
3189 coarsen_flag_set()
const;
3196 set_coarsen_flag()
const;
3202 clear_coarsen_flag()
const;
3307 level_subdomain_id()
const;
3314 set_level_subdomain_id(
3334 recursively_set_subdomain_id(
3354 direction_flag()
const;
3382 active_cell_index()
const;
3392 parent_index()
const;
3461 is_locally_owned()
const;
3468 is_locally_owned_on_level()
const;
3523 is_artificial()
const;
3550 set_neighbor(
const unsigned int i,
3604 neighbor_of_neighbor_internal(
const unsigned int neighbor)
const;
3611 template <
int dim_,
int spacedim_>
3623 set_active_cell_index(
const unsigned int active_cell_index);
3629 set_parent(
const unsigned int parent_index);
3638 set_direction_flag(
const bool new_direction_flag)
const;
3643 friend struct ::internal::TriangulationImplementation::Implementation;
3651 template <
int structdim,
int dim,
int spacedim>
3652 template <
typename OtherAccessor>
3654 const OtherAccessor &)
3657 ExcMessage(
"You are attempting an illegal conversion between " 3658 "iterator/accessor types. The constructor you call " 3659 "only exists to make certain template constructs " 3660 "easier to write as dimension independent code but " 3661 "the conversion is not valid in the current context."));
3666 template <
int structdim,
int dim,
int spacedim>
3667 template <
int structdim2,
int dim2,
int spacedim2>
3672 ExcMessage(
"You are attempting an illegal conversion between " 3673 "iterator/accessor types. The constructor you call " 3674 "only exists to make certain template constructs " 3675 "easier to write as dimension independent code but " 3676 "the conversion is not valid in the current context."));
3681 template <
int dim,
int spacedim>
3682 template <
int structdim2,
int dim2,
int spacedim2>
3687 ExcMessage(
"You are attempting an illegal conversion between " 3688 "iterator/accessor types. The constructor you call " 3689 "only exists to make certain template constructs " 3690 "easier to write as dimension independent code but " 3691 "the conversion is not valid in the current context."));
3696 template <
int structdim,
int dim,
int spacedim>
3697 template <
int structdim2,
int dim2,
int spacedim2>
3702 ExcMessage(
"You are attempting an illegal conversion between " 3703 "iterator/accessor types. The constructor you call " 3704 "only exists to make certain template constructs " 3705 "easier to write as dimension independent code but " 3706 "the conversion is not valid in the current context."));
3711 template <
int dim,
int spacedim>
3712 template <
int structdim2,
int dim2,
int spacedim2>
3717 ExcMessage(
"You are attempting an illegal conversion between " 3718 "iterator/accessor types. The constructor you call " 3719 "only exists to make certain template constructs " 3720 "easier to write as dimension independent code but " 3721 "the conversion is not valid in the current context."));
3756 #include "tria_accessor.templates.h"
static ::ExceptionBase & ExcCellHasNoChildren()
InvalidAccessor(const Triangulation< dim, spacedim > *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
static ::ExceptionBase & ExcNeighborIsNotCoarser()
const Triangulation< dim, spacedim > * tria
unsigned int global_vertex_index
static ::ExceptionBase & ExcNeighborIsCoarser()
static ::ExceptionBase & ExcDereferenceInvalidObject(AccessorType arg1)
bool operator!=(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
const Triangulation< 1, spacedim > * tria
void set_all_manifold_ids(const types::manifold_id) const
bool operator<(const SynchronousIterators< Iterators > &a, const SynchronousIterators< Iterators > &b)
static ::ExceptionBase & ExcFacesHaveNoLevel()
bool operator==(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
static ::ExceptionBase & ExcCellNotUsed()
static ::ExceptionBase & ExcMessage(std::string arg1)
unsigned int subdomain_id
#define DeclException1(Exception1, type1, outsequence)
const Triangulation< dim, spacedim > * tria
static ::ExceptionBase & ExcSetOnlyEvenChildren(int arg1)
#define Assert(cond, exc)
#define DeclExceptionMsg(Exception, defaulttext)
#define DeclException0(Exception0)
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcCellNotActive()
SynchronousIterators< Iterators > operator++(SynchronousIterators< Iterators > &a)
static ::ExceptionBase & ExcNoPeriodicNeighbor()
static ::ExceptionBase & ExcCantSetChildren(int arg1)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
CellAccessor(const Triangulation< dim, spacedim > *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
static ::ExceptionBase & ExcCellHasNoParent()
bool point_inside(const Point< spacedim > &p) const
#define DEAL_II_NAMESPACE_OPEN
TriaAccessor(const Triangulation< dim, spacedim > *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
Iterator reached end of container.
Iterator points to a valid object.
unsigned int global_vertex_index
#define DEAL_II_DEPRECATED
typename ::internal::TriaAccessorImplementation::PresentLevelType< structdim, dim >::type present_level
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcCantCompareIterators()