16 #ifndef dealii_tria_accessor_h 17 #define dealii_tria_accessor_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/bounding_box.h> 23 #include <deal.II/base/exceptions.h> 24 #include <deal.II/base/geometry_info.h> 25 #include <deal.II/base/point.h> 27 #include <deal.II/grid/cell_id.h> 28 #include <deal.II/grid/tria_iterator_base.h> 29 #include <deal.II/grid/tria_iterator_selector.h> 34 DEAL_II_NAMESPACE_OPEN
36 template <
int dim,
int spacedim>
38 template <
typename Accessor>
40 template <
typename Accessor>
42 template <
typename Accessor>
45 template <
int dim,
int spacedim>
51 namespace TriangulationImplementation
60 namespace TriaAccessorImplementation
69 template <
int structdim,
int dim>
124 template <
int structdim,
int dim,
int spacedim>
126 template <
int dim,
int spacedim>
128 template <
int spacedim>
146 "The operation you are attempting can only be performed for " 147 "(cell, face, or edge) iterators that point to valid " 148 "objects. These objects need not necessarily be active, " 149 "i.e., have no children, but they need to be part of a " 150 "triangulation. (The objects pointed to by an iterator " 151 "may -- after coarsening -- also be objects that used " 152 "to be part of a triangulation, but are now no longer " 153 "used. Their memory location may have been retained " 154 "for re-use upon the next mesh refinement, but is " 155 "currently unused.)");
166 "The operation you are attempting can only be performed for " 167 "(cell, face, or edge) iterators that point to 'active' " 168 "objects. 'Active' objects are those that do not have " 169 "children (in the case of cells), or that are part of " 170 "an active cell (in the case of faces or edges). However, " 171 "the object on which you are trying the current " 172 "operation is not 'active' in this sense.");
179 "The operation you are attempting can only be performed for " 180 "(cell, face, or edge) iterators that have children, " 181 "but the object on which you are trying the current " 182 "operation does not have any.");
190 "The operation you are attempting can only be performed for " 191 "(cell, face, or edge) iterators that have a parent object, " 192 "but the object on which you are trying the current " 193 "operation does not have one -- i.e., it is on the " 194 "coarsest level of the triangulation.");
200 <<
"You can only set the child index if the cell does not " 201 <<
"currently have children registered; or you can clear it. " 202 <<
"The given index was " << arg1
203 <<
" (-1 means: clear children).");
207 template <
typename AccessorType>
210 <<
"You tried to dereference an iterator for which this " 211 <<
"is not possible. More information on this iterator: " 212 <<
"index=" << arg1.index() <<
", state=" 222 "Iterators can only be compared if they point to the same " 223 "triangulation, or if neither of them are associated " 224 "with a triangulation.");
257 <<
"You can only set the child index of an even numbered child." 258 <<
"The number of the child given was " << arg1 <<
".");
288 template <
int structdim,
int dim,
int spacedim = dim>
337 const int level = -1,
338 const int index = -1,
509 typename ::internal::TriaAccessorImplementation::
524 template <
typename Accessor>
526 template <
typename Accessor>
528 template <
typename Accessor>
555 template <
int structdim,
int dim,
int spacedim = dim>
573 const int level = -1,
574 const int index = -1,
590 template <
typename OtherAccessor>
657 vertex(
const unsigned int i)
const;
663 typename ::internal::TriangulationImplementation::
664 Iterators<dim, spacedim>::line_iterator
665 line(
const unsigned int i)
const;
671 typename ::internal::TriangulationImplementation::
672 Iterators<dim, spacedim>::quad_iterator
673 quad(
const unsigned int i)
const;
696 template <
int structdim,
int dim,
int spacedim>
710 const int level = -1,
711 const int index = -1,
726 template <
int structdim2,
int dim2,
int spacedim2>
733 template <
int structdim2,
int dim2,
int spacedim2>
827 vertex(
const unsigned int i)
const;
832 typename ::internal::TriangulationImplementation::
833 Iterators<dim, spacedim>::line_iterator
834 line(
const unsigned int i)
const;
848 typename ::internal::TriangulationImplementation::
849 Iterators<dim, spacedim>::quad_iterator
850 quad(
const unsigned int i)
const;
895 face_flip(
const unsigned int face)
const;
981 child(
const unsigned int i)
const;
1428 std::pair<Point<spacedim>,
double>
1536 center(
const bool respect_manifold =
false,
1537 const bool interpolate_from_surrounding =
false)
const;
1623 set(const ::internal::TriangulationImplementation::TriaObject<structdim>
1656 set_face_flip(
const unsigned int face,
const bool flip)
const;
1720 friend struct ::internal::TriangulationImplementation::Implementation;
1721 friend struct ::internal::TriaAccessorImplementation::Implementation;
1745 template <
int dim,
int spacedim>
1788 const int level = 0,
1789 const int index = 0,
1795 template <
int structdim2,
int dim2,
int spacedim2>
1801 template <
int structdim2,
int dim2,
int spacedim2>
1896 vertex(
const unsigned int i = 0)
const;
1902 typename ::internal::TriangulationImplementation::
1903 Iterators<dim, spacedim>::line_iterator
static line(
const unsigned int);
1914 static typename ::internal::TriangulationImplementation::
1915 Iterators<dim, spacedim>::quad_iterator
1916 quad(
const unsigned int i);
1960 center(
const bool respect_manifold =
false,
1961 const bool interpolate_from_surrounding =
false)
const;
2049 child(
const unsigned int);
2117 template <
typename Accessor>
2119 template <
typename Accessor>
2121 template <
typename Accessor>
2144 template <
int spacedim>
2206 const VertexKind vertex_kind,
2222 template <
int structdim2,
int dim2,
int spacedim2>
2228 template <
int structdim2,
int dim2,
int spacedim2>
2344 vertex(
const unsigned int i = 0)
const;
2357 typename ::internal::TriangulationImplementation::
2358 Iterators<1, spacedim>::line_iterator
static line(
const unsigned int);
2372 static typename ::internal::TriangulationImplementation::
2373 Iterators<1, spacedim>::quad_iterator
2374 quad(
const unsigned int i);
2502 child(
const unsigned int);
2644 template <
int dim,
int spacedim = dim>
2669 const int level = -1,
2670 const int index = -1,
2690 template <
int structdim2,
int dim2,
int spacedim2>
2697 template <
int structdim2,
int dim2,
int spacedim2>
2728 child(
const unsigned int i)
const;
2734 face(
const unsigned int i)
const;
2797 const unsigned int subface_no)
const;
2821 neighbor(
const unsigned int i)
const;
2878 std::pair<unsigned int, unsigned int>
2957 const unsigned int subface_no)
const;
2969 std::pair<unsigned int, unsigned int>
3125 const unsigned int face_no,
3553 template <
int dim_,
int spacedim_>
3585 friend struct ::internal::TriangulationImplementation::Implementation;
3593 template <
int structdim,
int dim,
int spacedim>
3594 template <
typename OtherAccessor>
3596 const OtherAccessor &)
3599 ExcMessage(
"You are attempting an illegal conversion between " 3600 "iterator/accessor types. The constructor you call " 3601 "only exists to make certain template constructs " 3602 "easier to write as dimension independent code but " 3603 "the conversion is not valid in the current context."));
3608 template <
int structdim,
int dim,
int spacedim>
3609 template <
int structdim2,
int dim2,
int spacedim2>
3614 ExcMessage(
"You are attempting an illegal conversion between " 3615 "iterator/accessor types. The constructor you call " 3616 "only exists to make certain template constructs " 3617 "easier to write as dimension independent code but " 3618 "the conversion is not valid in the current context."));
3623 template <
int dim,
int spacedim>
3624 template <
int structdim2,
int dim2,
int spacedim2>
3629 ExcMessage(
"You are attempting an illegal conversion between " 3630 "iterator/accessor types. The constructor you call " 3631 "only exists to make certain template constructs " 3632 "easier to write as dimension independent code but " 3633 "the conversion is not valid in the current context."));
3638 template <
int structdim,
int dim,
int spacedim>
3639 template <
int structdim2,
int dim2,
int spacedim2>
3644 ExcMessage(
"You are attempting an illegal conversion between " 3645 "iterator/accessor types. The constructor you call " 3646 "only exists to make certain template constructs " 3647 "easier to write as dimension independent code but " 3648 "the conversion is not valid in the current context."));
3653 template <
int dim,
int spacedim>
3654 template <
int structdim2,
int dim2,
int spacedim2>
3659 ExcMessage(
"You are attempting an illegal conversion between " 3660 "iterator/accessor types. The constructor you call " 3661 "only exists to make certain template constructs " 3662 "easier to write as dimension independent code but " 3663 "the conversion is not valid in the current context."));
3695 DEAL_II_NAMESPACE_CLOSE
3698 #include "tria_accessor.templates.h" unsigned int periodic_neighbor_of_periodic_neighbor(const unsigned int i) const
void clear_used_flag() const
std::pair< Point< spacedim >, double > enclosing_ball() const
static ::ExceptionBase & ExcCellHasNoChildren()
InvalidAccessor(const Triangulation< dim, spacedim > *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
bool point_inside_codim(const Point< spacedim_ > &p) const
void set_face_rotation(const unsigned int face, const bool rotation) const
TriaIterator< CellAccessor< dim, spacedim > > neighbor_or_periodic_neighbor(const unsigned int i) const
static ::ExceptionBase & ExcNeighborIsNotCoarser()
const Triangulation< dim, spacedim > * tria
unsigned int global_vertex_index
void set_active_cell_index(const unsigned int active_cell_index)
void recursively_clear_user_pointer() const
unsigned int active_cell_index() const
typename ::internal::TriangulationImplementation::Iterators< dim, spacedim >::line_iterator line(const unsigned int i) const
void set_manifold_id(const types::manifold_id) const
void set_neighbor(const unsigned int i, const TriaIterator< CellAccessor< dim, spacedim >> &pointer) const
bool operator==(const InvalidAccessor &) const
static ::ExceptionBase & ExcNeighborIsCoarser()
static ::ExceptionBase & ExcRefineCellNotActive()
unsigned int neighbor_of_neighbor_internal(const unsigned int neighbor) const
unsigned int user_index() const
static ::ExceptionBase & ExcDereferenceInvalidObject(AccessorType arg1)
unsigned int user_index() const
static bool is_level_cell()
int isotropic_child_index(const unsigned int i) const
void set_user_index(const unsigned int p) const
const Manifold< dim, spacedim > & get_manifold() const
void * user_pointer() const
types::material_id material_id() const
bool flag_for_line_refinement(const unsigned int line_no) const
void set_line_orientation(const unsigned int line, const bool orientation) const
TriaIterator< TriaAccessor< structdim, dim, spacedim > > isotropic_child(const unsigned int i) const
void copy_from(const TriaAccessorBase &)
double extent_in_direction(const unsigned int axis) const
const Triangulation< 1, spacedim > * tria
bool operator!=(const TriaAccessorBase &) const
unsigned int n_children() const
void set_all_manifold_ids(const types::manifold_id) const
bool is_translation_of(const TriaIterator< TriaAccessor< structdim, dim, spacedim >> &o) const
void set_children(const unsigned int i, const int index) const
void clear_user_pointer() const
unsigned int line_index(const unsigned int i) const
static ::ExceptionBase & ExcFacesHaveNoLevel()
void operator=(const CellAccessor< dim, spacedim > &)=delete
unsigned int face_index(const unsigned int i) const
TriaIterator< CellAccessor< dim, spacedim > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
typename TriaAccessorBase< structdim, dim, spacedim >::AccessorData AccessorData
bool neighbor_is_coarser(const unsigned int neighbor) const
bool has_children() const
unsigned int vertex_index(const unsigned int i) const
types::manifold_id manifold_id() const
bool is_locally_owned() const
bool face_rotation(const unsigned int face) const
static ::ExceptionBase & ExcCellNotUsed()
void copy_from(const InvalidAccessor &)
void clear_user_data() const
TriaIterator< CellAccessor< dim, spacedim > > parent() const
static const unsigned int space_dimension
void set_user_pointer(void *p) const
void set_boundary_id_internal(const types::boundary_id id) const
bool coarsen_flag_set() const
TriaIterator< CellAccessor< dim, spacedim > > neighbor(const unsigned int i) const
typename ::internal::TriangulationImplementation::Iterators< dim, spacedim >::quad_iterator quad(const unsigned int i) const
static ::ExceptionBase & ExcMessage(std::string arg1)
bool has_periodic_neighbor(const unsigned int i) const
void recursively_set_user_flag() const
bool operator==(const TriaAccessorBase &) const
void set_coarsen_flag() const
unsigned int subdomain_id
TriaIterator< TriaAccessor< dim - 1, dim, spacedim > > face(const unsigned int i) const
#define DeclException1(Exception1, type1, outsequence)
void clear_user_flag() const
types::manifold_id manifold_id() const
TriaIterator< TriaAccessor< 0, dim, spacedim > > vertex_iterator(const unsigned int i) const
const Triangulation< dim, spacedim > * tria
bool is_locally_owned_on_level() const
bool periodic_neighbor_is_coarser(const unsigned int i) const
static ::ExceptionBase & ExcCellFlaggedForCoarsening()
static ::ExceptionBase & ExcSetOnlyEvenChildren(int arg1)
#define Assert(cond, exc)
std::pair< unsigned int, unsigned int > periodic_neighbor_of_coarser_periodic_neighbor(const unsigned face_no) const
Point< spacedim > & vertex(const unsigned int i) const
BoundingBox< spacedim > bounding_box() const
bool line_orientation(const unsigned int line) const
void set_material_id(const types::material_id new_material_id) const
Point< spacedim > & vertex(const unsigned int i) const
#define DeclExceptionMsg(Exception, defaulttext)
#define DeclException0(Exception0)
void set_face_orientation(const unsigned int face, const bool orientation) const
unsigned int quad_index(const unsigned int i) const
bool operator<(const TriaAccessorBase &other) const
RefinementCase< dim > refine_flag_set() const
static ::ExceptionBase & ExcCellNotActive()
void operator=(const TriaAccessorBase *)=delete
void operator=(const TriaAccessor &)=delete
IteratorState::IteratorStates state() const
void set_refine_flag(const RefinementCase< dim > ref_case=RefinementCase< dim >::isotropic_refinement) const
static ::ExceptionBase & ExcNoPeriodicNeighbor()
static ::ExceptionBase & ExcCantSetChildren(int arg1)
void clear_refine_flag() const
void recursively_set_material_id(const types::material_id new_material_id) const
void clear_children() const
void recursively_clear_user_index() const
TriaIterator< CellAccessor< dim, spacedim > > periodic_neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
void set_user_index(const unsigned int p) const
double minimum_vertex_distance() const
void clear_user_index() const
bool has_children() const
void recursively_clear_user_flag() const
CellAccessor(const Triangulation< dim, spacedim > *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
Point< spacedim > center(const bool respect_manifold=false, const bool interpolate_from_surrounding=false) const
TriaAccessorBase(const Triangulation< dim, spacedim > *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *=nullptr)
static ::ExceptionBase & ExcCellHasNoParent()
void set_all_boundary_ids(const types::boundary_id) const
typename ::internal::TriangulationImplementation::Iterators< dim, spacedim >::quad_iterator quad(const unsigned int i) const
Point< structdim > real_to_unit_cell_affine_approximation(const Point< spacedim > &point) const
bool is_artificial() const
types::boundary_id boundary_id() const
int periodic_neighbor_level(const unsigned int i) const
const Triangulation< dim, spacedim > & get_triangulation() const
void recursively_set_user_pointer(void *p) const
bool flag_for_face_refinement(const unsigned int face_no, const RefinementCase< dim - 1 > &face_refinement_case=RefinementCase< dim - 1 >::isotropic_refinement) const
std::pair< unsigned int, unsigned int > neighbor_of_coarser_neighbor(const unsigned int neighbor) const
void set_manifold_id(const types::manifold_id) const
void recursively_set_subdomain_id(const types::subdomain_id new_subdomain_id) const
bool face_flip(const unsigned int face) const
::internal::SubfaceCase< dim > subface_case(const unsigned int face_no) const
int neighbor_level(const unsigned int i) const
bool point_inside(const Point< spacedim > &p) const
Point< spacedim > barycenter() const
TriaIterator< TriaAccessor< structdim, dim, spacedim > > child(const unsigned int i) const
void set_direction_flag(const bool new_direction_flag) const
static const unsigned int structure_dimension
unsigned int periodic_neighbor_face_no(const unsigned int i) const
int periodic_neighbor_index(const unsigned int i) const
TriaIterator< CellAccessor< dim, spacedim > > periodic_neighbor(const unsigned int i) const
unsigned int number_of_children() const
void clear_refinement_case() const
int child_index(const unsigned int i) const
void set_parent(const unsigned int parent_index)
void clear_coarsen_flag() const
bool face_orientation(const unsigned int face) const
Point< spacedim > intermediate_point(const Point< structdim > &coordinates) const
void set_boundary_id(const types::boundary_id) const
TriaAccessor(const Triangulation< dim, spacedim > *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
bool direction_flag() const
int neighbor_index(const unsigned int i) const
Iterator reached end of container.
Iterator points to a valid object.
void set_level_subdomain_id(const types::subdomain_id new_level_subdomain_id) const
void recursively_set_user_index(const unsigned int p) const
void set_subdomain_id(const types::subdomain_id new_subdomain_id) const
types::subdomain_id level_subdomain_id() const
void set_user_flag() const
bool user_flag_set() const
void set_face_flip(const unsigned int face, const bool flip) const
unsigned int neighbor_face_no(const unsigned int neighbor) const
types::subdomain_id subdomain_id() const
static ::ExceptionBase & ExcCellFlaggedForRefinement()
static const unsigned int dimension
unsigned int global_vertex_index
void set_refinement_case(const RefinementCase< structdim > &ref_case) const
RefinementCase< structdim > refinement_case() const
unsigned int max_refinement_depth() const
unsigned int neighbor_of_neighbor(const unsigned int neighbor) const
typename ::internal::TriaAccessorImplementation::PresentLevelType< structdim, dim >::type present_level
::internal::TriangulationImplementation::TriaObjects< ::internal::TriangulationImplementation::TriaObject< structdim > > & objects() const
void set_used_flag() const
TriaIterator< CellAccessor< dim, spacedim > > child(const unsigned int i) const
bool has_boundary_lines() const
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcCantCompareIterators()
typename ::internal::TriangulationImplementation::Iterators< dim, spacedim >::line_iterator line(const unsigned int i) const