class Line;
class Quad;
class Hexahedron;
+ template <typename G> class TriaObjects;
}
}
template <int celldim, int dim> class TriaObjectAccessor;
*/
void operator = (const TriaObjectAccessor<1, dim> &);
-
protected:
/**@name Advancement of iterators*/
* previous level is accessed.
*/
void operator -- ();
+
+ /**
+ * Access to the lines of a
+ * Triangulation. This function
+ * is specialized for dim==1
+ * because lines are stored in
+ * TriaLevel<1> for dim==1 but in
+ * TriaFace<dim> for dim!=1. All
+ * accessor functions using this
+ * function can be implemented
+ * for all dim without
+ * specialization.
+ */
+ internal::Triangulation::TriaObjects<internal::Triangulation::Line> & lines() const;
+
/*@}*/
/**
* previous level is accessed.
*/
void operator -- ();
+
+ /**
+ * Access to the quads of a
+ * Triangulation. This function
+ * is specialized for dim==2 and
+ * dim==3 because quads are
+ * stored in TriaLevel<2> for
+ * dim==2 but in TriaFace<3> for
+ * dim==3. All accessor functions
+ * using this function can be
+ * implemented for all dimensions
+ * without specialization.
+ */
+ internal::Triangulation::TriaObjects<internal::Triangulation::Quad> & quads() const;
/*@}*/
/**
template <> Point<2> TriaObjectAccessor<2, 2>::barycenter () const;
template <> Point<3> TriaObjectAccessor<2, 3>::barycenter () const;
template <> Point<3> TriaObjectAccessor<3, 3>::barycenter () const;
-template <> void TriaObjectAccessor<1, 1>::set (const internal::Triangulation::Line &line) const;
-template <> int TriaObjectAccessor<1, 1>::vertex_index (const unsigned int i) const;
-template <> void TriaObjectAccessor<1, 1>::set_used_flag () const;
-template <> void TriaObjectAccessor<1, 1>::clear_used_flag () const;
-template <> void TriaObjectAccessor<1, 1>::set_user_pointer (void *p) const;
-template <> void TriaObjectAccessor<1, 1>::clear_user_pointer () const;
-template <> void * TriaObjectAccessor<1, 1>::user_pointer () const;
-template <> void TriaObjectAccessor<1, 1>::set_children (const int index) const;
-template <> unsigned char TriaObjectAccessor<1, 1>::boundary_indicator () const;
-template <> void TriaObjectAccessor<1, 1>::set_boundary_indicator (const unsigned char) const;
+template <> internal::Triangulation::TriaObjects<internal::Triangulation::Line> &TriaObjectAccessor<1, 1>::lines() const;
+template <> internal::Triangulation::TriaObjects<internal::Triangulation::Quad> &TriaObjectAccessor<2, 2>::quads() const;
template <> bool CellAccessor<1>::at_boundary () const;
template <> unsigned char CellAccessor<1>::material_id () const;
template <> void CellAccessor<1>::set_material_id (const unsigned char mat_id) const;
{}
-
-template <int dim>
+// first implement the lines functions as they are used by many
+// subsequent accessor functions
+template <>
inline
-bool
-TriaObjectAccessor<1,dim>::used () const
+internal::Triangulation::TriaObjects<internal::Triangulation::Line> &
+TriaObjectAccessor<1,1>::lines() const
{
- Assert (this->state() == IteratorState::valid,
- typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return this->tria->faces->lines.used[this->present_index];
+ return this->tria->levels[this->present_level]->lines;
}
-template <>
+template <int dim>
inline
-bool
-TriaObjectAccessor<1,1>::used () const
+internal::Triangulation::TriaObjects<internal::Triangulation::Line> &
+TriaObjectAccessor<1,dim>::lines() const
{
- const int dim=1;
- Assert (this->state() == IteratorState::valid,
- TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return this->tria->levels[this->present_level]->lines.used[this->present_index];
+ return this->tria->faces->lines;
}
template <int dim>
inline
bool
-TriaObjectAccessor<1,dim>::user_flag_set () const
+TriaObjectAccessor<1,dim>::used () const
{
- Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->faces->lines.user_flags[this->present_index];
+ Assert (this->state() == IteratorState::valid,
+ typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
+ return lines().used[this->present_index];
}
-template <>
+template <int dim>
inline
bool
-TriaObjectAccessor<1,1>::user_flag_set () const
+TriaObjectAccessor<1,dim>::user_flag_set () const
{
- const int dim=1;
- Assert (this->used(), TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->levels[this->present_level]->lines.user_flags[this->present_index];
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ return lines().user_flags[this->present_index];
}
TriaObjectAccessor<1,dim>::set_user_flag () const
{
Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->lines.user_flags[this->present_index] = true;
-}
-
-
-
-template <>
-inline
-void
-TriaObjectAccessor<1,1>::set_user_flag () const
-{
- const int dim=1;
- Assert (this->used(), TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->lines.user_flags[this->present_index] = true;
+ lines().user_flags[this->present_index] = true;
}
TriaObjectAccessor<1,dim>::clear_user_flag () const
{
Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->lines.user_flags[this->present_index] = false;
-}
-
-
-
-template <>
-inline
-void
-TriaObjectAccessor<1,1>::clear_user_flag () const
-{
- const int dim=1;
- Assert (this->used(), TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->lines.user_flags[this->present_index] = false;
+ lines().user_flags[this->present_index] = false;
}
{
Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return (this->tria->faces->lines.children[this->present_index] != -1);
-}
-
-
-
-template <>
-inline
-bool
-TriaObjectAccessor<1,1>::has_children () const
-{
- const int dim=1;
- Assert (this->state() == IteratorState::valid,
- TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return (this->tria->levels[this->present_level]->lines.children[this->present_index] != -1);
+ return (lines().children[this->present_index] != -1);
}
{
Assert (i<2, ExcIndexRange(i,0,2));
Assert (has_children(), typename TriaAccessor<dim>::ExcCellHasNoChildren());
- return this->tria->faces->lines.children[this->present_index]+i;
-}
-
-
-
-template <>
-inline
-int
-TriaObjectAccessor<1,1>::child_index (unsigned const int i) const
-{
- const int dim=1;
- Assert (i<2, ExcIndexRange(i,0,2));
- Assert (has_children(), TriaAccessor<dim>::ExcCellHasNoChildren());
- return this->tria->levels[this->present_level]->lines.children[this->present_index]+i;
+ return lines().children[this->present_index]+i;
}
-template <int dim>
+// first implement the quads functions as they are used by many
+// subsequent accessor functions
+template <>
inline
-bool
-TriaObjectAccessor<2,dim>::used () const
+internal::Triangulation::TriaObjects<internal::Triangulation::Quad> &
+TriaObjectAccessor<2,2>::quads() const
{
- Assert (this->state() == IteratorState::valid,
- typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return this->tria->faces->quads.used[this->present_index];
+ return this->tria->levels[this->present_level]->quads;
}
-template <>
+template <int dim>
inline
-bool
-TriaObjectAccessor<2,2>::used () const
+internal::Triangulation::TriaObjects<internal::Triangulation::Quad> &
+TriaObjectAccessor<2,dim>::quads() const
{
- const int dim=2;
- Assert (this->state() == IteratorState::valid,
- TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return this->tria->levels[this->present_level]->quads.used[this->present_index];
+ return this->tria->faces->quads;
}
template <int dim>
inline
bool
-TriaObjectAccessor<2,dim>::user_flag_set () const
+TriaObjectAccessor<2,dim>::used () const
{
- Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->faces->quads.user_flags[this->present_index];
+ Assert (this->state() == IteratorState::valid,
+ typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
+ return quads().used[this->present_index];
}
-template <>
+template <int dim>
inline
bool
-TriaObjectAccessor<2,2>::user_flag_set () const
+TriaObjectAccessor<2,dim>::user_flag_set () const
{
- const int dim=2;
- Assert (this->used(), TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->levels[this->present_level]->quads.user_flags[this->present_index];
+ Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
+ return quads().user_flags[this->present_index];
}
TriaObjectAccessor<2,dim>::set_user_flag () const
{
Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->quads.user_flags[this->present_index] = true;
-}
-
-
-
-template <>
-inline
-void
-TriaObjectAccessor<2,2>::set_user_flag () const
-{
- const int dim=2;
- Assert (this->used(), TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->quads.user_flags[this->present_index] = true;
+ quads().user_flags[this->present_index] = true;
}
TriaObjectAccessor<2,dim>::clear_user_flag () const
{
Assert (this->used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->quads.user_flags[this->present_index] = false;
-}
-
-
-
-template <>
-inline
-void
-TriaObjectAccessor<2,2>::clear_user_flag () const
-{
- const int dim=2;
- Assert (this->used(), TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->quads.user_flags[this->present_index] = false;
+ quads().user_flags[this->present_index] = false;
}
TriaObjectAccessor<2,dim>::line_index (const unsigned int i) const
{
Assert (i<4, ExcIndexRange(i,0,4));
- return this->tria->faces->quads.cells[this->present_index].line(i);
+ return quads().cells[this->present_index].line(i);
}
-template <>
-inline
-unsigned int
-TriaObjectAccessor<2,2>::line_index (const unsigned int i) const
-{
-Assert (i<4, ExcIndexRange(i,0,4));
- return this->tria->levels[this->present_level]->quads.cells[this->present_index].line(i);
-}
template <int dim>
{
Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return (this->tria->faces->quads.children[this->present_index] != -1);
-}
-
-
-
-template <>
-inline
-bool
-TriaObjectAccessor<2,2>::has_children () const
-{
- const int dim=2;
- Assert (this->state() == IteratorState::valid,
- TriaAccessor<dim>::ExcDereferenceInvalidObject());
- return (this->tria->levels[this->present_level]->quads.children[this->present_index] != -1);
+ return (quads().children[this->present_index] != -1);
}
{
Assert (i<4, ExcIndexRange(i,0,4));
Assert (has_children(), typename TriaAccessor<dim>::ExcCellHasNoChildren());
- return this->tria->faces->quads.children[this->present_index]+i;
-}
-
-
-
-template <>
-inline
-int TriaObjectAccessor<2,2>::child_index (const unsigned int i) const
-{
- const int dim=2;
- Assert (i<4, ExcIndexRange(i,0,4));
- Assert (has_children(), TriaAccessor<dim>::ExcCellHasNoChildren());
- return this->tria->levels[this->present_level]->quads.children[this->present_index]+i;
+ return quads().children[this->present_index]+i;
}
// the vector?
if (this->present_index
>=
- static_cast<int>(this->tria->faces->quads.cells.size()))
+ static_cast<int>(quads().cells.size()))
this->present_level = this->present_index = -1;
}
// the vector?
while (this->present_index
>=
- static_cast<int>(this->tria->levels[this->present_level]->quads.cells.size()))
+ static_cast<int>(quads().cells.size()))
{
// no -> go one level up
++this->present_level;
return;
}
// else
- this->present_index = this->tria->levels[this->present_level]->quads.cells.size()-1;
+ this->present_index = quads().cells.size()-1;
}
}
void
TriaObjectAccessor<1, dim>::set (const internal::Triangulation::Line &line) const
{
- this->tria->faces->lines.cells[this->present_index] = line;
+ lines().cells[this->present_index] = line;
}
-#if deal_II_dimension == 1
-
-template <>
-void
-TriaObjectAccessor<1, 1>::set (const internal::Triangulation::Line &line) const
-{
- this->tria->levels[this->present_level]
- ->lines.cells[this->present_index] = line;
-}
-
-template <>
-int TriaObjectAccessor<1, 1>::vertex_index (const unsigned int i) const
-{
- Assert (i<2, ExcIndexRange(i,0,2));
- return this->tria->levels[this->present_level]->lines.cells[this->present_index].vertex (i);
-}
-
-#else
template <int dim>
int TriaObjectAccessor<1, dim>::vertex_index (const unsigned int i) const
{
Assert (i<2, ExcIndexRange(i,0,2));
- return this->tria->faces->lines.cells[this->present_index].vertex (i);
+ return lines().cells[this->present_index].vertex (i);
}
-#endif
+
template <int dim>
Point<dim> &
{
Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- this->tria->faces->lines.used[this->present_index] = true;
+ lines().used[this->present_index] = true;
}
-#if deal_II_dimension == 1
-
-template <>
-void TriaObjectAccessor<1, 1>::set_used_flag () const
-{ const int dim =1;
- Assert (this->state() == IteratorState::valid,
- TriaAccessor<dim>::ExcDereferenceInvalidObject());
- this->tria->levels[this->present_level]->lines.used[this->present_index] = true;
-}
-
-#endif
template <int dim>
void TriaObjectAccessor<1, dim>::clear_used_flag () const
{
Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- this->tria->faces->lines.used[this->present_index] = false;
+ lines().used[this->present_index] = false;
}
-#if deal_II_dimension == 1
-
-template <>
-void TriaObjectAccessor<1, 1>::clear_used_flag () const
-{
- const int dim=1;
- Assert (this->state() == IteratorState::valid,
- TriaAccessor<dim>::ExcDereferenceInvalidObject());
- this->tria->levels[this->present_level]->lines.used[this->present_index] = false;
-}
-
-#endif
template <int dim>
void TriaObjectAccessor<1, dim>::recursively_set_user_flag () const
void TriaObjectAccessor<1, dim>::set_user_pointer (void *p) const
{
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->lines.user_pointers[this->present_index] = p;
+ lines().user_pointers[this->present_index] = p;
}
-#if deal_II_dimension == 1
-
-template <>
-void TriaObjectAccessor<1, 1>::set_user_pointer (void *p) const
-{
- const int dim=1;
- Assert (used(), TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->lines.user_pointers[this->present_index] = p;
-}
-
-#endif
template <int dim>
void TriaObjectAccessor<1, dim>::clear_user_pointer () const
{
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->lines.user_pointers[this->present_index] = 0;
-}
-
-
-#if deal_II_dimension == 1
-
-template <>
-void TriaObjectAccessor<1, 1>::clear_user_pointer () const
-{
- const int dim=1;
- Assert (used(), TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->lines.user_pointers[this->present_index] = 0;
+ lines().user_pointers[this->present_index] = 0;
}
-#endif
template <int dim>
void * TriaObjectAccessor<1, dim>::user_pointer () const
{
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->faces->lines.user_pointers[this->present_index];
+ return lines().user_pointers[this->present_index];
}
-#if deal_II_dimension == 1
-
-template <>
-void * TriaObjectAccessor<1, 1>::user_pointer () const
-{
- const int dim=1;
- Assert (used(), TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->levels[this->present_level]->lines.user_pointers[this->present_index];
-}
-
-#endif
-
template <int dim>
void
(!has_children() && (index>=0)),
typename TriaAccessor<dim>::ExcCantSetChildren(index));
- this->tria->faces->lines.children[this->present_index] = index;
+ lines().children[this->present_index] = index;
}
-#if deal_II_dimension == 1
-
-template <>
-void TriaObjectAccessor<1, 1>::set_children (const int index) const
-{
- const int dim=1;
- Assert (used(), TriaAccessor<dim>::ExcCellNotUsed());
- Assert ((index==-1) ||
- (!has_children() && (index>=0)),
- TriaAccessor<dim>::ExcCantSetChildren(index));
-
- this->tria->levels[this->present_level]->lines.children[this->present_index] = index;
-}
-
-#endif
template <int dim>
void TriaObjectAccessor<1, dim>::clear_children () const
Assert (dim>=2, ExcImpossibleInDim(dim));
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->faces->lines.material_id[this->present_index];
-}
-
-
-#if deal_II_dimension == 1
-
-template <>
-unsigned char TriaObjectAccessor<1, 1>::boundary_indicator () const
-{
- Assert (false, ExcImpossibleInDim(1));
- return 0;
+ return lines().material_id[this->present_index];
}
-#endif
template <int dim>
Assert (dim>=2, ExcImpossibleInDim(dim));
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->lines.material_id[this->present_index] = boundary_ind;
+ lines().material_id[this->present_index] = boundary_ind;
}
-#if deal_II_dimension == 1
-
-template <>
-void TriaObjectAccessor<1, 1>::set_boundary_indicator (const unsigned char) const
-{
- Assert (false, ExcImpossibleInDim(1));
-}
-
-#endif
-
template <int dim>
bool TriaObjectAccessor<1, dim>::at_boundary () const
void
TriaObjectAccessor<2, dim>::set (const internal::Triangulation::Quad &quad) const
{
- this->tria->faces->quads.cells[this->present_index] = quad;
-}
-
-
-#if deal_II_dimension == 2
-
-template <>
-void
-TriaObjectAccessor<2, 2>::set (const internal::Triangulation::Quad &quad) const
-{
- this->tria->levels[this->present_level]
- ->quads.cells[this->present_index] = quad;
+ quads().cells[this->present_index] = quad;
}
-#endif
template <int dim>
{
Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- this->tria->faces->quads.used[this->present_index] = true;
+ quads().used[this->present_index] = true;
}
-#if deal_II_dimension == 2
-
-template <>
-void
-TriaObjectAccessor<2, 2>::set_used_flag () const
-{
- const int dim=2;
- Assert (this->state() == IteratorState::valid,
- TriaAccessor<dim>::ExcDereferenceInvalidObject());
- this->tria->levels[this->present_level]->quads.used[this->present_index] = true;
-}
-
-#endif
-
template <int dim>
void TriaObjectAccessor<2, dim>::clear_used_flag () const
{
Assert (this->state() == IteratorState::valid,
typename TriaAccessor<dim>::ExcDereferenceInvalidObject());
- this->tria->faces->quads.used[this->present_index] = false;
+ quads().used[this->present_index] = false;
}
-#if deal_II_dimension == 2
-
-template <>
-void TriaObjectAccessor<2, 2>::clear_used_flag () const
-{
- const int dim=2;
- Assert (this->state() == IteratorState::valid,
- TriaAccessor<dim>::ExcDereferenceInvalidObject());
- this->tria->levels[this->present_level]->quads.used[this->present_index] = false;
-}
-
-#endif
template <int dim>
void TriaObjectAccessor<2, dim>::recursively_set_user_flag () const
void TriaObjectAccessor<2, dim>::set_user_pointer (void *p) const
{
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->quads.user_pointers[this->present_index] = p;
-}
-
-
-#if deal_II_dimension == 2
-
-template <>
-void TriaObjectAccessor<2, 2>::set_user_pointer (void *p) const
-{
- const int dim=2;
- Assert (used(), TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->quads.user_pointers[this->present_index] = p;
+ quads().user_pointers[this->present_index] = p;
}
-#endif
template <int dim>
void TriaObjectAccessor<2, dim>::clear_user_pointer () const
{
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->quads.user_pointers[this->present_index] = 0;
-}
-
-
-#if deal_II_dimension == 2
-
-template <>
-void TriaObjectAccessor<2, 2>::clear_user_pointer () const
-{
- const int dim=2;
- Assert (used(), TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->quads.user_pointers[this->present_index] = 0;
+ quads().user_pointers[this->present_index] = 0;
}
-#endif
template <int dim>
void * TriaObjectAccessor<2, dim>::user_pointer () const
{
Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->faces->quads.user_pointers[this->present_index];
-}
-
-
-#if deal_II_dimension == 2
-
-template <>
-void * TriaObjectAccessor<2, 2>::user_pointer () const
-{
- const int dim=2;
- Assert (used(), TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->levels[this->present_level]->quads.user_pointers[this->present_index];
+ return quads().user_pointers[this->present_index];
}
-#endif
template <int dim>
(!has_children() && (index>=0)),
typename TriaAccessor<dim>::ExcCantSetChildren(index));
- this->tria->faces->quads.children[this->present_index] = index;
+ quads().children[this->present_index] = index;
}
-#if deal_II_dimension == 2
-
-template <>
-void TriaObjectAccessor<2, 2>::set_children (const int index) const
-{
- const int dim=2;
- Assert (used(),
- TriaAccessor<dim>::ExcCellNotUsed());
- Assert ((index==-1) ||
- (!has_children() && (index>=0)),
- TriaAccessor<dim>::ExcCantSetChildren(index));
-
- this->tria->levels[this->present_level]->quads.children[this->present_index] = index;
-}
-
-#endif
-
template <int dim>
void TriaObjectAccessor<2, dim>::clear_children () const
template <int dim>
unsigned char TriaObjectAccessor<2, dim>::boundary_indicator () const
{
- Assert (false, ExcImpossibleInDim(dim));
- return 255;
-}
-
-
-#if deal_II_dimension == 3
-
-template <>
-unsigned char TriaObjectAccessor<2, 3>::boundary_indicator () const
-{
- Assert (used(), TriaAccessor<3>::ExcCellNotUsed());
+ Assert (dim>2, ExcImpossibleInDim(dim));
+ Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- return this->tria->faces->quads.material_id[this->present_index];
+ return quads().material_id[this->present_index];
}
-#endif
template <int dim>
-void TriaObjectAccessor<2, dim>::set_boundary_indicator (const unsigned char) const
+void TriaObjectAccessor<2, dim>::set_boundary_indicator (const unsigned char boundary_ind) const
{
- Assert (false, ExcImpossibleInDim(dim));
-}
-
-
-#if deal_II_dimension == 3
-
-template <>
-void TriaObjectAccessor<2, 3>::set_boundary_indicator (const unsigned char boundary_ind) const
-{
- Assert (used(), TriaAccessor<3>::ExcCellNotUsed());
+ Assert (dim>2, ExcImpossibleInDim(dim));
+ Assert (used(), typename TriaAccessor<dim>::ExcCellNotUsed());
- this->tria->faces->quads.material_id[this->present_index] = boundary_ind;
+ quads().material_id[this->present_index] = boundary_ind;
}
-#endif
template <int dim>
unsigned char CellAccessor<1>::material_id () const
{
Assert (this->used(), TriaAccessor<1>::ExcCellNotUsed());
- return this->tria->levels[this->present_level]
- ->lines.material_id[this->present_index];
+ return lines().material_id[this->present_index];
}
void CellAccessor<1>::set_material_id (const unsigned char mat_id) const
{
Assert (this->used(), TriaAccessor<1>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->lines.material_id[this->present_index]
- = mat_id;
+ lines().material_id[this->present_index] = mat_id;
}
unsigned char CellAccessor<2>::material_id () const
{
Assert (this->used(), TriaAccessor<2>::ExcCellNotUsed());
- return this->tria->levels[this->present_level]->quads.material_id[this->present_index];
+ return quads().material_id[this->present_index];
}
void CellAccessor<2>::set_material_id (const unsigned char mat_id) const
{
Assert (this->used(), TriaAccessor<2>::ExcCellNotUsed());
- this->tria->levels[this->present_level]->quads.material_id[this->present_index]
- = mat_id;
+ quads().material_id[this->present_index] = mat_id;
}