16 #ifndef dealii_tria_accessor_h 17 #define dealii_tria_accessor_h 33 #include <boost/container/small_vector.hpp> 43 template <
int dim,
int spacedim>
45 template <
typename Accessor>
47 template <
typename Accessor>
49 template <
typename Accessor>
54 template <
int dim,
int spacedim>
55 class TriangulationBase;
58 template <
int dim,
int spacedim>
61 template <
int dim,
int spacedim>
67 namespace TriangulationImplementation
70 struct Implementation;
71 struct ImplementationMixedMesh;
74 namespace TriaAccessorImplementation
76 struct Implementation;
83 template <
int structdim,
int dim>
137 template <
int structdim,
int dim,
int spacedim>
139 template <
int dim,
int spacedim>
141 template <
int spacedim>
159 "The operation you are attempting can only be performed for " 160 "(cell, face, or edge) iterators that point to valid " 161 "objects. These objects need not necessarily be active, " 162 "i.e., have no children, but they need to be part of a " 163 "triangulation. (The objects pointed to by an iterator " 164 "may -- after coarsening -- also be objects that used " 165 "to be part of a triangulation, but are now no longer " 166 "used. Their memory location may have been retained " 167 "for re-use upon the next mesh refinement, but is " 168 "currently unused.)");
179 "The operation you are attempting can only be performed for " 180 "(cell, face, or edge) iterators that point to 'active' " 181 "objects. 'Active' objects are those that do not have " 182 "children (in the case of cells), or that are part of " 183 "an active cell (in the case of faces or edges). However, " 184 "the object on which you are trying the current " 185 "operation is not 'active' in this sense.");
192 "The operation you are attempting can only be performed for " 193 "(cell, face, or edge) iterators that have children, " 194 "but the object on which you are trying the current " 195 "operation does not have any.");
203 "The operation you are attempting can only be performed for " 204 "(cell, face, or edge) iterators that have a parent object, " 205 "but the object on which you are trying the current " 206 "operation does not have one -- i.e., it is on the " 207 "coarsest level of the triangulation.");
213 <<
"You can only set the child index if the cell does not " 214 <<
"currently have children registered; or you can clear it. " 215 <<
"The given index was " << arg1
216 <<
" (-1 means: clear children).");
220 template <
typename AccessorType>
223 <<
"You tried to dereference an iterator for which this " 224 <<
"is not possible. More information on this iterator: " 225 <<
"index=" << arg1.index() <<
", state=" 235 "Iterators can only be compared if they point to the same " 236 "triangulation, or if neither of them are associated " 237 "with a triangulation.");
270 <<
"You can only set the child index of an even numbered child." 271 <<
"The number of the child given was " << arg1 <<
".");
300 template <
int structdim,
int dim,
int spacedim = dim>
309 static const unsigned int space_dimension = spacedim;
316 static const unsigned int dimension = dim;
323 static const unsigned int structure_dimension = structdim;
349 const int level = -1,
350 const int index = -1,
510 get_triangulation()
const;
520 typename ::internal::TriaAccessorImplementation::
535 template <
typename Accessor>
537 template <
typename Accessor>
539 template <
typename Accessor>
565 template <
int structdim,
int dim,
int spacedim = dim>
583 const int level = -1,
584 const int index = -1,
600 template <
typename OtherAccessor>
637 has_children()
const;
655 set_user_index(
const unsigned int p)
const;
667 vertex(
const unsigned int i)
const;
673 typename ::internal::TriangulationImplementation::
674 Iterators<dim, spacedim>::line_iterator
675 line(
const unsigned int i)
const;
681 typename ::internal::TriangulationImplementation::
682 Iterators<dim, spacedim>::quad_iterator
683 quad(
const unsigned int i)
const;
705 template <
int structdim,
int dim,
int spacedim>
719 const int level = -1,
720 const int index = -1,
735 template <
int structdim2,
int dim2,
int spacedim2>
742 template <
int structdim2,
int dim2,
int spacedim2>
778 vertex_iterator(
const unsigned int i)
const;
796 vertex_index(
const unsigned int i)
const;
836 vertex(
const unsigned int i)
const;
841 typename ::internal::TriangulationImplementation::
842 Iterators<dim, spacedim>::line_iterator
843 line(
const unsigned int i)
const;
852 line_index(
const unsigned int i)
const;
857 typename ::internal::TriangulationImplementation::
858 Iterators<dim, spacedim>::quad_iterator
859 quad(
const unsigned int i)
const;
868 quad_index(
const unsigned int i)
const;
892 face_orientation(
const unsigned int face)
const;
904 face_flip(
const unsigned int face)
const;
916 face_rotation(
const unsigned int face)
const;
929 line_orientation(
const unsigned int line)
const;
945 has_children()
const;
968 number_of_children()
const;
984 max_refinement_depth()
const;
990 child(
const unsigned int i)
const;
997 child_iterator_to_index(
1009 isotropic_child(
const unsigned int i)
const;
1015 refinement_case()
const;
1023 child_index(
const unsigned int i)
const;
1031 isotropic_child_index(
const unsigned int i)
const;
1129 at_boundary()
const;
1141 get_manifold()
const;
1219 user_flag_set()
const;
1227 set_user_flag()
const;
1235 clear_user_flag()
const;
1243 recursively_set_user_flag()
const;
1251 recursively_clear_user_flag()
const;
1259 clear_user_data()
const;
1273 set_user_pointer(
void *p)
const;
1281 clear_user_pointer()
const;
1299 user_pointer()
const;
1323 recursively_set_user_pointer(
void *p)
const;
1332 recursively_clear_user_pointer()
const;
1344 set_user_index(
const unsigned int p)
const;
1352 clear_user_index()
const;
1386 recursively_set_user_index(
const unsigned int p)
const;
1397 recursively_clear_user_index()
const;
1461 std::pair<Point<spacedim>,
double>
1462 enclosing_ball()
const;
1473 bounding_box()
const;
1485 extent_in_direction(
const unsigned int axis)
const;
1491 minimum_vertex_distance()
const;
1569 center(
const bool respect_manifold =
false,
1570 const bool interpolate_from_surrounding =
false)
const;
1669 vertex_indices()
const;
1676 line_indices()
const;
1685 face_indices()
const;
1707 set_bounding_object_indices(
1708 const std::initializer_list<int> &new_indices)
const;
1714 set_bounding_object_indices(
1715 const std::initializer_list<unsigned int> &new_indices)
const;
1725 set_line_orientation(
const unsigned int line,
const bool orientation)
const;
1738 set_face_orientation(
const unsigned int face,
const bool orientation)
const;
1747 set_face_flip(
const unsigned int face,
const bool flip)
const;
1756 set_face_rotation(
const unsigned int face,
const bool rotation)
const;
1762 set_used_flag()
const;
1768 clear_used_flag()
const;
1789 clear_refinement_case()
const;
1798 set_children(
const unsigned int i,
const int index)
const;
1805 clear_children()
const;
1811 friend struct ::internal::TriangulationImplementation::Implementation;
1812 friend struct ::internal::TriangulationImplementation::
1813 ImplementationMixedMesh;
1814 friend struct ::internal::TriaAccessorImplementation::Implementation;
1837 template <
int dim,
int spacedim>
1846 static const unsigned int space_dimension = spacedim;
1853 static const unsigned int dimension = dim;
1860 static const unsigned int structure_dimension = 0;
1872 const unsigned int vertex_index);
1880 const int level = 0,
1881 const int index = 0,
1887 template <
int structdim2,
int dim2,
int spacedim2>
1893 template <
int structdim2,
int dim2,
int spacedim2>
1921 get_triangulation()
const;
1980 vertex_index(
const unsigned int i = 0)
const;
1988 vertex(
const unsigned int i = 0)
const;
1994 typename ::internal::TriangulationImplementation::
1995 Iterators<dim, spacedim>::line_iterator
static line(
const unsigned int);
2001 line_index(
const unsigned int i);
2006 static typename ::internal::TriangulationImplementation::
2007 Iterators<dim, spacedim>::quad_iterator
2008 quad(
const unsigned int i);
2014 quad_index(
const unsigned int i);
2042 extent_in_direction(
const unsigned int axis)
const;
2052 center(
const bool respect_manifold =
false,
2053 const bool interpolate_from_surrounding =
false)
const;
2080 face_orientation(
const unsigned int face);
2086 face_flip(
const unsigned int face);
2092 face_rotation(
const unsigned int face);
2098 line_orientation(
const unsigned int line);
2129 number_of_children();
2135 max_refinement_depth();
2147 child(
const unsigned int);
2153 isotropic_child(
const unsigned int);
2165 child_index(
const unsigned int i);
2171 isotropic_child_index(
const unsigned int i);
2215 template <
typename Accessor>
2217 template <
typename Accessor>
2219 template <
typename Accessor>
2241 template <
int spacedim>
2250 static const unsigned int space_dimension = spacedim;
2257 static const unsigned int dimension = 1;
2264 static const unsigned int structure_dimension = 0;
2304 const unsigned int vertex_index);
2319 template <
int structdim2,
int dim2,
int spacedim2>
2325 template <
int structdim2,
int dim2,
int spacedim2>
2362 get_triangulation()
const;
2433 vertex_index(
const unsigned int i = 0)
const;
2441 vertex(
const unsigned int i = 0)
const;
2454 typename ::internal::TriangulationImplementation::
2455 Iterators<1, spacedim>::line_iterator
static line(
const unsigned int);
2464 line_index(
const unsigned int i);
2469 static typename ::internal::TriangulationImplementation::
2470 Iterators<1, spacedim>::quad_iterator
2471 quad(
const unsigned int i);
2480 quad_index(
const unsigned int i);
2492 at_boundary()
const;
2515 get_manifold()
const;
2538 face_orientation(
const unsigned int face);
2544 face_flip(
const unsigned int face);
2550 face_rotation(
const unsigned int face);
2556 line_orientation(
const unsigned int line);
2587 number_of_children();
2593 max_refinement_depth();
2605 child(
const unsigned int);
2611 isotropic_child(
const unsigned int);
2623 child_index(
const unsigned int i);
2629 isotropic_child_index(
const unsigned int i);
2734 vertex_indices()
const;
2741 line_indices()
const;
2778 template <
int dim,
int spacedim = dim>
2803 const int level = -1,
2804 const int index = -1,
2824 template <
int structdim2,
int dim2,
int spacedim2>
2831 template <
int structdim2,
int dim2,
int spacedim2>
2862 child(
const unsigned int i)
const;
2867 boost::container::small_vector<TriaIterator<CellAccessor<dim, spacedim>>,
2869 child_iterators()
const;
2875 face(
const unsigned int i)
const;
2882 face_iterator_to_index(
2888 boost::container::small_vector<
2891 face_iterators()
const;
2903 face_index(
const unsigned int i)
const;
2953 neighbor_child_on_subface(
const unsigned int face_no,
2954 const unsigned int subface_no)
const;
2981 neighbor(
const unsigned int face_no)
const;
2991 neighbor_index(
const unsigned int face_no)
const;
3001 neighbor_level(
const unsigned int face_no)
const;
3015 neighbor_of_neighbor(
const unsigned int face_no)
const;
3028 neighbor_is_coarser(
const unsigned int face_no)
const;
3044 std::pair<unsigned int, unsigned int>
3045 neighbor_of_coarser_neighbor(
const unsigned int neighbor)
const;
3054 neighbor_face_no(
const unsigned int neighbor)
const;
3076 has_periodic_neighbor(
const unsigned int i)
const;
3095 periodic_neighbor(
const unsigned int i)
const;
3105 neighbor_or_periodic_neighbor(
const unsigned int i)
const;
3122 periodic_neighbor_child_on_subface(
const unsigned int face_no,
3123 const unsigned int subface_no)
const;
3135 std::pair<unsigned int, unsigned int>
3136 periodic_neighbor_of_coarser_periodic_neighbor(
const unsigned face_no)
const;
3144 periodic_neighbor_index(
const unsigned int i)
const;
3152 periodic_neighbor_level(
const unsigned int i)
const;
3169 periodic_neighbor_of_periodic_neighbor(
const unsigned int i)
const;
3177 periodic_neighbor_face_no(
const unsigned int i)
const;
3186 periodic_neighbor_is_coarser(
const unsigned int i)
const;
3205 at_boundary(
const unsigned int i)
const;
3216 at_boundary()
const;
3226 has_boundary_lines()
const;
3253 refine_flag_set()
const;
3280 clear_refine_flag()
const;
3290 flag_for_face_refinement(
3291 const unsigned int face_no,
3301 flag_for_line_refinement(
const unsigned int line_no)
const;
3312 subface_case(
const unsigned int face_no)
const;
3318 coarsen_flag_set()
const;
3325 set_coarsen_flag()
const;
3331 clear_coarsen_flag()
const;
3436 level_subdomain_id()
const;
3443 set_level_subdomain_id(
3463 recursively_set_subdomain_id(
3482 global_active_cell_index()
const;
3490 global_level_cell_index()
const;
3506 direction_flag()
const;
3534 active_cell_index()
const;
3544 parent_index()
const;
3613 is_locally_owned()
const;
3620 is_locally_owned_on_level()
const;
3675 is_artificial()
const;
3702 set_neighbor(
const unsigned int i,
3764 neighbor_of_neighbor_internal(
const unsigned int neighbor)
const;
3771 template <
int dim_,
int spacedim_>
3783 set_active_cell_index(
const unsigned int active_cell_index)
const;
3801 set_parent(
const unsigned int parent_index);
3810 set_direction_flag(
const bool new_direction_flag)
const;
3818 friend struct ::internal::TriangulationImplementation::Implementation;
3819 friend struct ::internal::TriangulationImplementation::
3820 ImplementationMixedMesh;
3828 template <
int structdim,
int dim,
int spacedim>
3829 template <
typename OtherAccessor>
3831 const OtherAccessor &)
3834 ExcMessage(
"You are attempting an illegal conversion between " 3835 "iterator/accessor types. The constructor you call " 3836 "only exists to make certain template constructs " 3837 "easier to write as dimension independent code but " 3838 "the conversion is not valid in the current context."));
3843 template <
int structdim,
int dim,
int spacedim>
3844 template <
int structdim2,
int dim2,
int spacedim2>
3849 ExcMessage(
"You are attempting an illegal conversion between " 3850 "iterator/accessor types. The constructor you call " 3851 "only exists to make certain template constructs " 3852 "easier to write as dimension independent code but " 3853 "the conversion is not valid in the current context."));
3858 template <
int dim,
int spacedim>
3859 template <
int structdim2,
int dim2,
int spacedim2>
3864 ExcMessage(
"You are attempting an illegal conversion between " 3865 "iterator/accessor types. The constructor you call " 3866 "only exists to make certain template constructs " 3867 "easier to write as dimension independent code but " 3868 "the conversion is not valid in the current context."));
3873 template <
int structdim,
int dim,
int spacedim>
3874 template <
int structdim2,
int dim2,
int spacedim2>
3879 ExcMessage(
"You are attempting an illegal conversion between " 3880 "iterator/accessor types. The constructor you call " 3881 "only exists to make certain template constructs " 3882 "easier to write as dimension independent code but " 3883 "the conversion is not valid in the current context."));
3888 template <
int dim,
int spacedim>
3889 template <
int structdim2,
int dim2,
int spacedim2>
3894 ExcMessage(
"You are attempting an illegal conversion between " 3895 "iterator/accessor types. The constructor you call " 3896 "only exists to make certain template constructs " 3897 "easier to write as dimension independent code but " 3898 "the conversion is not valid in the current context."));
3933 #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()
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
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)
void reference_cell(const ReferenceCell &reference_cell, Triangulation< dim, spacedim > &tria)
Abstract base class for mapping classes.
boost::integer_range< IncrementableType > iota_view
#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_ENABLE_EXTRA_DIAGNOSTICS
#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()