void operator -- ();
/**
- * Access to the lines of a
- * Triangulation. This function
- * is specialized for dim==1
- * because lines are stored in
+ * Access to the other objects of
+ * a Triangulation with same
+ * dimension. 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
* for all dim without
* specialization.
*/
- internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<1> > & lines() const;
+ internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<1> > & objects() const;
private:
void operator -- ();
/**
- * Access to the quads of a
- * Triangulation. This function
- * is specialized for dim==2 and
+ * Access to the other objects of
+ * a Triangulation of same
+ * dimension. 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
* implemented for all dimensions
* without specialization.
*/
- internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<2> > & quads() const;
+ internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<2> > & objects() const;
private:
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 <> internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<1> > &TriaObjectAccessor<1, 1>::lines() const;
-template <> internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<2> > &TriaObjectAccessor<2, 2>::quads() const;
+template <> internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<1> >&
+TriaObjectAccessor<1, 1>::objects() const;
+template <> internal::Triangulation::TriaObjects<internal::Triangulation::TriaObject<2> >&
+TriaObjectAccessor<2, 2>::objects() 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 <> void CellAccessor<1>::recursively_set_material_id (const unsigned char mat_id) const;
template <> bool CellAccessor<1>::point_inside (const Point<1> &p) const;
template <> bool CellAccessor<2>::at_boundary () const;
-template <> unsigned char CellAccessor<2>::material_id () const;
-template <> void CellAccessor<2>::set_material_id (const unsigned char mat_id) const;
-template <> void CellAccessor<2>::recursively_set_material_id (const unsigned char mat_id) const;
template <> bool CellAccessor<2>::point_inside (const Point<2> &p) const;
template <> bool CellAccessor<3>::at_boundary () const;
-template <> unsigned char CellAccessor<3>::material_id () const;
-template <> void CellAccessor<3>::set_material_id (const unsigned char mat_id) const;
-template <> void CellAccessor<3>::recursively_set_material_id (const unsigned char mat_id) const;
template <> bool CellAccessor<3>::point_inside (const Point<3> &) const;
template <> bool CellAccessor<1>::has_boundary_lines () const;
template <>
inline
internal::Triangulation::TriaObjects<internal::Triangulation::Line> &
-TriaObjectAccessor<1,1>::lines() const
+TriaObjectAccessor<1,1>::objects() const
{
return this->tria->levels[this->present_level]->cells;
}
template <int dim>
inline
internal::Triangulation::TriaObjects<internal::Triangulation::Line> &
-TriaObjectAccessor<1,dim>::lines() const
+TriaObjectAccessor<1,dim>::objects() const
{
return this->tria->faces->lines;
}
{
Assert (this->state() == IteratorState::valid,
TriaAccessorExceptions::ExcDereferenceInvalidObject());
- return lines().used[this->present_index];
+ return objects().used[this->present_index];
}
TriaObjectAccessor<1,dim>::user_flag_set () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- return lines().user_flags[this->present_index];
+ return objects().user_flags[this->present_index];
}
TriaObjectAccessor<1,dim>::set_user_flag () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- lines().user_flags[this->present_index] = true;
+ objects().user_flags[this->present_index] = true;
}
TriaObjectAccessor<1,dim>::clear_user_flag () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- lines().user_flags[this->present_index] = false;
+ objects().user_flags[this->present_index] = false;
}
{
Assert (this->state() == IteratorState::valid,
TriaAccessorExceptions::ExcDereferenceInvalidObject());
- return (lines().children[this->present_index] != -1);
+ return (objects().children[this->present_index] != -1);
}
{
Assert (i<2, ExcIndexRange(i,0,2));
Assert (has_children(), TriaAccessorExceptions::ExcCellHasNoChildren());
- return lines().children[this->present_index]+i;
+ return objects().children[this->present_index]+i;
}
template <>
inline
internal::Triangulation::TriaObjects<internal::Triangulation::Quad> &
-TriaObjectAccessor<2,2>::quads() const
+TriaObjectAccessor<2,2>::objects() const
{
return this->tria->levels[this->present_level]->cells;
}
template <int dim>
inline
internal::Triangulation::TriaObjects<internal::Triangulation::Quad> &
-TriaObjectAccessor<2,dim>::quads() const
+TriaObjectAccessor<2,dim>::objects() const
{
return this->tria->faces->quads;
}
{
Assert (this->state() == IteratorState::valid,
TriaAccessorExceptions::ExcDereferenceInvalidObject());
- return quads().used[this->present_index];
+ return objects().used[this->present_index];
}
TriaObjectAccessor<2,dim>::user_flag_set () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- return quads().user_flags[this->present_index];
+ return objects().user_flags[this->present_index];
}
TriaObjectAccessor<2,dim>::set_user_flag () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- quads().user_flags[this->present_index] = true;
+ objects().user_flags[this->present_index] = true;
}
TriaObjectAccessor<2,dim>::clear_user_flag () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- quads().user_flags[this->present_index] = false;
+ objects().user_flags[this->present_index] = false;
}
TriaObjectAccessor<2,dim>::line_index (const unsigned int i) const
{
Assert (i<4, ExcIndexRange(i,0,4));
- return quads().cells[this->present_index].face(i);
+ return objects().cells[this->present_index].face(i);
}
{
Assert (this->state() == IteratorState::valid,
TriaAccessorExceptions::ExcDereferenceInvalidObject());
- return (quads().children[this->present_index] != -1);
+ return (objects().children[this->present_index] != -1);
}
{
Assert (i<4, ExcIndexRange(i,0,4));
Assert (has_children(), TriaAccessorExceptions::ExcCellHasNoChildren());
- return quads().children[this->present_index]+i;
+ return objects().children[this->present_index]+i;
}
bool
TriaObjectAccessor<2,3>::line_orientation (const unsigned int line) const
{
- // we cannot use the quads() function here,
+ // we cannot use the objects() function here,
// since it returns a reference to
// TriaObjects<Quad>, but we need a
// (reference to) TriaObjectsQuad3D
// has no level)
if (this->present_index
>=
- static_cast<int>(quads().cells.size()))
+ static_cast<int>(objects().cells.size()))
this->present_index = -1;
}
// the vector?
while (this->present_index
>=
- static_cast<int>(quads().cells.size()))
+ static_cast<int>(objects().cells.size()))
{
// no -> go one level up
++this->present_level;
return;
}
// else
- this->present_index = quads().cells.size()-1;
+ this->present_index = objects().cells.size()-1;
}
}
void
TriaObjectAccessor<1, dim>::set (const internal::Triangulation::Line &line) const
{
- lines().cells[this->present_index] = line;
+ objects().cells[this->present_index] = line;
}
int TriaObjectAccessor<1, dim>::vertex_index (const unsigned int i) const
{
Assert (i<2, ExcIndexRange(i,0,2));
- return lines().cells[this->present_index].face (i);
+ return objects().cells[this->present_index].face (i);
}
{
Assert (this->state() == IteratorState::valid,
TriaAccessorExceptions::ExcDereferenceInvalidObject());
- lines().used[this->present_index] = true;
+ objects().used[this->present_index] = true;
}
{
Assert (this->state() == IteratorState::valid,
TriaAccessorExceptions::ExcDereferenceInvalidObject());
- lines().used[this->present_index] = false;
+ objects().used[this->present_index] = false;
}
void TriaObjectAccessor<1, dim>::set_user_pointer (void *p) const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- lines().user_pointer(this->present_index) = p;
+ objects().user_pointer(this->present_index) = p;
}
void TriaObjectAccessor<1, dim>::clear_user_pointer () const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- lines().user_pointer(this->present_index) = 0;
+ objects().user_pointer(this->present_index) = 0;
}
void * TriaObjectAccessor<1, dim>::user_pointer () const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- return lines().user_pointer(this->present_index);
+ return objects().user_pointer(this->present_index);
}
void TriaObjectAccessor<1, dim>::set_user_index (unsigned int p) const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- lines().user_index(this->present_index) = p;
+ objects().user_index(this->present_index) = p;
}
void TriaObjectAccessor<1, dim>::clear_user_index () const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- lines().user_index(this->present_index) = 0;
+ objects().user_index(this->present_index) = 0;
}
unsigned int TriaObjectAccessor<1, dim>::user_index () const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- return lines().user_index(this->present_index);
+ return objects().user_index(this->present_index);
}
(!has_children() && (index>=0)),
TriaAccessorExceptions::ExcCantSetChildren(index));
- lines().children[this->present_index] = index;
+ objects().children[this->present_index] = index;
}
Assert (dim>=2, ExcImpossibleInDim(dim));
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- return lines().material_id[this->present_index];
+ return objects().material_id[this->present_index];
}
Assert (dim>=2, ExcImpossibleInDim(dim));
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- lines().material_id[this->present_index] = boundary_ind;
+ objects().material_id[this->present_index] = boundary_ind;
}
void
TriaObjectAccessor<2, dim>::set (const internal::Triangulation::Quad &quad) const
{
- quads().cells[this->present_index] = quad;
+ objects().cells[this->present_index] = quad;
}
{
Assert (this->state() == IteratorState::valid,
TriaAccessorExceptions::ExcDereferenceInvalidObject());
- quads().used[this->present_index] = true;
+ objects().used[this->present_index] = true;
}
{
Assert (this->state() == IteratorState::valid,
TriaAccessorExceptions::ExcDereferenceInvalidObject());
- quads().used[this->present_index] = false;
+ objects().used[this->present_index] = false;
}
void TriaObjectAccessor<2, dim>::set_user_pointer (void *p) const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- quads().user_pointer(this->present_index) = p;
+ objects().user_pointer(this->present_index) = p;
}
void TriaObjectAccessor<2, dim>::clear_user_pointer () const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- quads().user_pointer(this->present_index) = 0;
+ objects().user_pointer(this->present_index) = 0;
}
void * TriaObjectAccessor<2, dim>::user_pointer () const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- return quads().user_pointer(this->present_index);
+ return objects().user_pointer(this->present_index);
}
void TriaObjectAccessor<2, dim>::set_user_index (unsigned int p) const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- quads().user_index(this->present_index) = p;
+ objects().user_index(this->present_index) = p;
}
void TriaObjectAccessor<2, dim>::clear_user_index () const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- quads().user_index(this->present_index) = 0;
+ objects().user_index(this->present_index) = 0;
}
unsigned int TriaObjectAccessor<2, dim>::user_index () const
{
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- return quads().user_index(this->present_index);
+ return objects().user_index(this->present_index);
}
(!has_children() && (index>=0)),
TriaAccessorExceptions::ExcCantSetChildren(index));
- quads().children[this->present_index] = index;
+ objects().children[this->present_index] = index;
}
Assert (dim>2, ExcImpossibleInDim(dim));
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- return quads().material_id[this->present_index];
+ return objects().material_id[this->present_index];
}
Assert (dim>2, ExcImpossibleInDim(dim));
Assert (used(), TriaAccessorExceptions::ExcCellNotUsed());
- quads().material_id[this->present_index] = boundary_ind;
+ objects().material_id[this->present_index] = boundary_ind;
}
-template <>
-unsigned char CellAccessor<1>::material_id () const
-{
- Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- return lines().material_id[this->present_index];
-}
-
-
-
-template <>
-void CellAccessor<1>::set_material_id (const unsigned char mat_id) const
-{
- Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- lines().material_id[this->present_index] = mat_id;
-}
-
-
-
-template <>
-void CellAccessor<1>::recursively_set_material_id (const unsigned char mat_id) const
-{
- set_material_id (mat_id);
-
- if (this->has_children())
- for (unsigned int c=0; c<2; ++c)
- child(c)->recursively_set_material_id (mat_id);
-}
-
-
-
template <>
bool CellAccessor<1>::point_inside (const Point<1> &p) const
{
-template <>
-unsigned char CellAccessor<2>::material_id () const
-{
- Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- return quads().material_id[this->present_index];
-}
-
-
-
-template <>
-void CellAccessor<2>::set_material_id (const unsigned char mat_id) const
-{
- Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- quads().material_id[this->present_index] = mat_id;
-}
-
-
-
-template <>
-void CellAccessor<2>::recursively_set_material_id (const unsigned char mat_id) const
-{
- set_material_id (mat_id);
-
- if (this->has_children())
- for (unsigned int c=0; c<n_children(); ++c)
- child(c)->recursively_set_material_id (mat_id);
-}
-
-
-
template <>
bool CellAccessor<2>::point_inside (const Point<2> &p) const
{
-template <>
-unsigned char CellAccessor<3>::material_id () const
-{
- Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- return this->tria->levels[this->present_level]->cells.material_id[this->present_index];
-}
-
-template <>
-void CellAccessor<3>::set_material_id (const unsigned char mat_id) const
-{
- Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- this->tria->levels[this->present_level]->cells.material_id[this->present_index]
- = mat_id;
-}
-
-
-template <>
-void CellAccessor<3>::recursively_set_material_id (const unsigned char mat_id) const
-{
- set_material_id (mat_id);
-
- if (this->has_children())
- for (unsigned int c=0; c<n_children(); ++c)
- child(c)->recursively_set_material_id (mat_id);
-}
-
-
-
template <>
bool CellAccessor<3>::point_inside (const Point<3> &p) const
{
/*------------------------ Functions: CellAccessor<dim> -----------------------*/
+template <int dim>
+unsigned char CellAccessor<dim>::material_id () const
+{
+ Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
+ return this->tria->levels[this->present_level]->cells.material_id[this->present_index];
+}
+
+
+
+template <int dim>
+void CellAccessor<dim>::set_material_id (const unsigned char mat_id) const
+{
+ Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
+ this->tria->levels[this->present_level]->cells.material_id[this->present_index] = mat_id;
+}
+
+
+
+template <int dim>
+void CellAccessor<dim>::recursively_set_material_id (const unsigned char mat_id) const
+{
+ set_material_id (mat_id);
+
+ if (this->has_children())
+ for (unsigned int c=0; c<2; ++c)
+ child(c)->recursively_set_material_id (mat_id);
+}
+
+
+
template <int dim>
unsigned int CellAccessor<dim>::subdomain_id () const
{