17 #ifndef __deal2__tria_accessor_h 18 #define __deal2__tria_accessor_h 21 #include <deal.II/base/config.h> 23 #include <deal.II/base/geometry_info.h> 24 #include <deal.II/base/point.h> 25 #include <deal.II/grid/tria_iterator_base.h> 26 #include <deal.II/grid/tria_iterator_selector.h> 27 #include <deal.II/grid/cell_id.h> 39 template <
int dim,
int spacedim>
class Boundary;
46 template <
int dim>
class TriaObject;
47 template <
typename G>
class TriaObjects;
48 struct Implementation;
53 struct Implementation;
95 void operator ++ ()
const 100 void operator -- ()
const 124 template <
int structdim,
int dim,
int spacedim>
class TriaAccessor;
125 template <
int dim,
int spacedim>
class TriaAccessor<0, dim, spacedim>;
126 template <
int spacedim>
class TriaAccessor<0, 1, spacedim>;
182 <<
"You can only set the child index if the cell has no " 183 <<
"children, or clear it. The given " 184 <<
"index was " << arg1 <<
" (-1 means: clear children)");
233 <<
"You can only set the child index of an even numbered child." 234 <<
"The number of the child given was " << arg1 <<
".");
263 template <
int structdim,
int dim,
int spacedim=dim>
278 static const unsigned int space_dimension = spacedim;
289 static const unsigned int dimension = dim;
301 static const unsigned int structure_dimension = structdim;
321 const int level = -1,
322 const int index = -1,
323 const AccessorData * = 0);
516 typename ::internal::TriaAccessor::PresentLevelType<structdim,dim>::type
present_level;
563 template <
int structdim,
int dim,
int spacedim=dim>
587 const int level = -1,
588 const int index = -1,
589 const AccessorData *local_data = 0);
613 template <
typename OtherAccessor>
631 void operator ++ ()
const;
632 void operator -- ()
const;
646 bool has_children ()
const;
667 template <
int structdim,
int dim,
int spacedim>
683 const int level = -1,
684 const int index = -1,
708 template <
int structdim2,
int dim2,
int spacedim2>
717 template <
int structdim2,
int dim2,
int spacedim2>
744 int parent_index ()
const;
777 unsigned int vertex_index (
const unsigned int i)
const;
789 typename ::internal::Triangulation::Iterators<dim,spacedim>::line_iterator
790 line (
const unsigned int i)
const;
801 unsigned int line_index (
const unsigned int i)
const;
807 typename ::internal::Triangulation::Iterators<dim,spacedim>::quad_iterator
808 quad (
const unsigned int i)
const;
819 unsigned int quad_index (
const unsigned int i)
const;
853 bool face_orientation (
const unsigned int face)
const;
869 bool face_flip (
const unsigned int face)
const;
885 bool face_rotation (
const unsigned int face)
const;
904 bool line_orientation (
const unsigned int line)
const;
920 bool has_children ()
const;
928 unsigned int n_children()
const;
954 unsigned int number_of_children ()
const;
977 unsigned int max_refinement_depth ()
const;
984 child (
const unsigned int i)
const;
1001 isotropic_child (
const unsigned int i)
const;
1019 int child_index (
const unsigned int i)
const;
1028 int isotropic_child_index (
const unsigned int i)
const;
1151 bool at_boundary ()
const;
1180 bool user_flag_set ()
const;
1186 void set_user_flag ()
const;
1192 void clear_user_flag ()
const;
1199 void recursively_set_user_flag ()
const;
1206 void recursively_clear_user_flag ()
const;
1213 void clear_user_data ()
const;
1229 void set_user_pointer (
void *p)
const;
1236 void clear_user_pointer ()
const;
1260 void *user_pointer ()
const;
1299 void recursively_set_user_pointer (
void *p)
const;
1310 void recursively_clear_user_pointer ()
const;
1325 void set_user_index (
const unsigned int p)
const;
1331 void clear_user_index ()
const;
1347 unsigned int user_index ()
const;
1377 void recursively_set_user_index (
const unsigned int p)
const;
1389 void recursively_clear_user_index ()
const;
1411 double diameter ()
const;
1428 double extent_in_direction (
const unsigned int axis)
const;
1434 double minimum_vertex_distance ()
const;
1463 double measure ()
const;
1506 void set (const ::internal::Triangulation::TriaObject<structdim> &o)
const;
1518 void set_line_orientation (
const unsigned int line,
1519 const bool orientation)
const;
1540 void set_face_orientation (
const unsigned int face,
1541 const bool orientation)
const;
1553 void set_face_flip (
const unsigned int face,
1554 const bool flip)
const;
1566 void set_face_rotation (
const unsigned int face,
1567 const bool rotation)
const;
1574 void set_used_flag ()
const;
1581 void clear_used_flag ()
const;
1611 void clear_refinement_case ()
const;
1616 void set_parent (
const unsigned int parent_index);
1631 void set_children (
const unsigned int i,
const int index)
const;
1639 void clear_children ()
const;
1663 friend struct ::internal::Triangulation::Implementation;
1664 friend struct ::internal::TriaAccessor::Implementation;
1678 template<
int dim,
int spacedim>
1701 template <
int spacedim>
1716 static const unsigned int space_dimension = spacedim;
1727 static const unsigned int dimension = 1;
1739 static const unsigned int structure_dimension = 0;
1781 const unsigned int vertex_index);
1795 const AccessorData * = 0);
1802 template <
int structdim2,
int dim2,
int spacedim2>
1810 template <
int structdim2,
int dim2,
int spacedim2>
1824 void copy_from (
const TriaAccessor &);
1842 static int level ();
1865 void operator ++ ()
const;
1875 void operator -- ()
const;
1879 bool operator == (
const TriaAccessor &)
const;
1884 bool operator != (
const TriaAccessor &)
const;
1894 static int parent_index ();
1927 unsigned int vertex_index (
const unsigned int i = 0)
const;
1952 typename ::internal::Triangulation::Iterators<1,spacedim>::line_iterator
1953 static line (
const unsigned int);
1964 static unsigned int line_index (
const unsigned int i);
1971 typename ::internal::Triangulation::Iterators<1,spacedim>::quad_iterator
1972 quad (
const unsigned int i);
1983 static unsigned int quad_index (
const unsigned int i);
1996 bool at_boundary ()
const;
2026 static bool face_orientation (
const unsigned int face);
2031 static bool face_flip (
const unsigned int face);
2036 static bool face_rotation (
const unsigned int face);
2041 static bool line_orientation (
const unsigned int line);
2058 static bool has_children ();
2065 static unsigned int n_children();
2072 static unsigned int number_of_children ();
2079 static unsigned int max_refinement_depth ();
2086 child (
const unsigned int);
2093 isotropic_child (
const unsigned int);
2105 int child_index (
const unsigned int i);
2111 int isotropic_child_index (
const unsigned int i);
2221 template <
int dim,
int spacedim=dim>
2248 const int level = -1,
2249 const int index = -1,
2250 const AccessorData *local_data = 0);
2278 template <
int structdim2,
int dim2,
int spacedim2>
2287 template <
int structdim2,
int dim2,
int spacedim2>
2308 child (
const unsigned int i)
const;
2315 face (
const unsigned int i)
const;
2329 face_index (
const unsigned int i)
const;
2423 neighbor_child_on_subface (
const unsigned int face_no,
2424 const unsigned int subface_no)
const;
2438 neighbor (
const unsigned int i)
const;
2446 int neighbor_index (
const unsigned int i)
const;
2454 int neighbor_level (
const unsigned int i)
const;
2477 unsigned int neighbor_of_neighbor (
const unsigned int neighbor)
const;
2500 bool neighbor_is_coarser (
const unsigned int neighbor)
const;
2520 std::pair<unsigned int, unsigned int>
2521 neighbor_of_coarser_neighbor (
const unsigned int neighbor)
const;
2532 unsigned int neighbor_face_no (
const unsigned int neighbor)
const;
2553 bool at_boundary (
const unsigned int i)
const;
2573 bool at_boundary ()
const;
2588 bool has_boundary_lines ()
const;
2619 void clear_refine_flag ()
const;
2632 bool flag_for_face_refinement (
const unsigned int face_no,
2643 bool flag_for_line_refinement (
const unsigned int line_no)
const;
2665 bool coarsen_flag_set ()
const;
2673 void set_coarsen_flag ()
const;
2678 void clear_coarsen_flag ()
const;
2828 bool direction_flag ()
const;
2859 bool active ()
const;
2868 bool operator < (const CellAccessor<dim, spacedim> &other)
const;
2892 bool is_locally_owned ()
const;
2898 bool is_locally_owned_on_level ()
const;
2933 bool is_ghost ()
const;
2977 bool is_artificial ()
const;
3017 void set_neighbor (
const unsigned int i,
3081 unsigned int neighbor_of_neighbor_internal (
const unsigned int neighbor)
const;
3089 template<
int dim_,
int spacedim_ >
3102 void set_direction_flag (
const bool new_direction_flag)
const;
3127 friend struct ::internal::Triangulation::Implementation;
3136 template <
int structdim,
int dim,
int spacedim>
3137 template <
typename OtherAccessor>
3142 ExcMessage (
"You are attempting an illegal conversion between " 3143 "iterator/accessor types. The constructor you call " 3144 "only exists to make certain template constructs " 3145 "easier to write as dimension independent code but " 3146 "the conversion is not valid in the current context."));
3151 template <
int structdim,
int dim,
int spacedim>
3152 template <
int structdim2,
int dim2,
int spacedim2>
3157 ExcMessage (
"You are attempting an illegal conversion between " 3158 "iterator/accessor types. The constructor you call " 3159 "only exists to make certain template constructs " 3160 "easier to write as dimension independent code but " 3161 "the conversion is not valid in the current context."));
3166 template <
int dim,
int spacedim>
3167 template <
int structdim2,
int dim2,
int spacedim2>
3172 ExcMessage (
"You are attempting an illegal conversion between " 3173 "iterator/accessor types. The constructor you call " 3174 "only exists to make certain template constructs " 3175 "easier to write as dimension independent code but " 3176 "the conversion is not valid in the current context."));
3181 template <
int structdim,
int dim,
int spacedim>
3182 template <
int structdim2,
int dim2,
int spacedim2>
3187 ExcMessage (
"You are attempting an illegal conversion between " 3188 "iterator/accessor types. The constructor you call " 3189 "only exists to make certain template constructs " 3190 "easier to write as dimension independent code but " 3191 "the conversion is not valid in the current context."));
3196 template <
int dim,
int spacedim>
3197 template <
int structdim2,
int dim2,
int spacedim2>
3202 ExcMessage (
"You are attempting an illegal conversion between " 3203 "iterator/accessor types. The constructor you call " 3204 "only exists to make certain template constructs " 3205 "easier to write as dimension independent code but " 3206 "the conversion is not valid in the current context."));
3209 template <
int dim,
int spacedim>
3213 std::vector<unsigned char> id(this->level(), -1);
3214 unsigned int coarse_index;
3217 while (ptr.
level()>0)
3221 for (
unsigned int c=0; c<ptr.
parent()->n_children(); ++c)
3231 id[ptr.
level()-1] = v;
3237 coarse_index = ptr.
index();
3239 return CellId(coarse_index,
id);
3255 DEAL_II_NAMESPACE_CLOSE
3258 # include "tria_accessor.templates.h"
TriaAccessor< dim, dim, spacedim >::AccessorData AccessorData
unsigned char material_id
TriaAccessorBase< structdim, dim, spacedim >::AccessorData AccessorData
::ExceptionBase & ExcMessage(std::string arg1)
void copy_from(const TriaAccessorBase &)
const Triangulation< 1, spacedim > * tria
TriaAccessorBase< structdim, dim, spacedim >::AccessorData AccessorData
#define DeclException1(Exception1, type1, outsequence)
#define Assert(cond, exc)
TriaAccessor(const Triangulation< dim, spacedim > *parent=0, const int level=-1, const int index=-1, const AccessorData *local_data=0)
const Triangulation< dim, spacedim > * tria
#define DeclException0(Exception0)
typename::internal::TriaAccessor::PresentLevelType< structdim, dim >::type present_level
TriaIterator< CellAccessor< dim, spacedim > > parent() const
unsigned int subdomain_id
bool point_inside(const Point< spacedim > &p) const
CellAccessor(const Triangulation< dim, spacedim > *parent=0, const int level=-1, const int index=-1, const AccessorData *local_data=0)
Triangulation< dim, spacedim > Container
InvalidAccessor(const Triangulation< dim, spacedim > *parent=0, const int level=-1, const int index=-1, const AccessorData *local_data=0)
unsigned char boundary_id
unsigned int global_vertex_index
::ExceptionBase & ExcInternalError()