*/
void set_material_id (const unsigned char new_material_id) const;
+ /**
+ * Set the material id of this
+ * cell and all its children (and
+ * grand-children, and so on) to
+ * the given value.
+ */
+ void recursively_set_material_id (const unsigned char new_material_id) const;
+
/**
* Return the subdomain id of
* this cell.
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 <>
+void CellAccessor<1>::recursively_set_material_id (const unsigned char mat_id) const
+{
+ set_material_id (mat_id);
+
+ if (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 <>
std::pair<unsigned int, unsigned int>
CellAccessor<1>::neighbor_of_coarser_neighbor (const unsigned int) const
+template <>
+void CellAccessor<2>::recursively_set_material_id (const unsigned char mat_id) const
+{
+ set_material_id (mat_id);
+
+ if (has_children())
+ for (unsigned int c=0; c<4; ++c)
+ child(c)->recursively_set_material_id (mat_id);
+}
+
+
+
template <>
bool CellAccessor<2>::point_inside (const Point<2> &p) const
{
return this->tria->levels[this->present_level]->hexes.material_id[this->present_index];
}
-
-
template <>
void CellAccessor<3>::set_material_id (const unsigned char mat_id) const
{
template <>
-bool CellAccessor<3>::point_inside (const Point<3> &) const
+void CellAccessor<3>::recursively_set_material_id (const unsigned char mat_id) const
+{
+ set_material_id (mat_id);
+
+ if (has_children())
+ for (unsigned int c=0; c<8; ++c)
+ child(c)->recursively_set_material_id (mat_id);
+}
+
+
+
+template <>
+bool CellAccessor<3>::point_inside (const Point<3> &p) const
{
Assert (false, ExcNotImplemented() );
return false;
<h3>deal.II</h3>
<ol>
+ <li> <p> New: The <code class="class">TriaAccessor</code>::<code
+ class="member">recursively_set_material_id</code> function sets
+ the material id of the present cell and of all its children,
+ grandchildren, etc to the given value.
+ <br>
+ (WB 2002/09/04)
+ </p>
+
<li> <p> New: The new <code class="class">FETools</code>::<code
class="member">get_fe_from_name</code> function can do the
reverse of the <code class="class">FiniteElement</code>::<code