]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Introduction of types::boundary_id_t and types::material_id_t
authorgoll <goll@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Feb 2012 18:22:33 +0000 (18:22 +0000)
committergoll <goll@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Feb 2012 18:22:33 +0000 (18:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@25179 0785d39b-7218-0410-832d-ea1e28bc413d

32 files changed:
deal.II/doc/news/changes.h
deal.II/include/deal.II/base/types.h
deal.II/include/deal.II/dofs/dof_handler.h
deal.II/include/deal.II/dofs/dof_tools.h
deal.II/include/deal.II/dofs/function_map.h
deal.II/include/deal.II/grid/grid_generator.h
deal.II/include/deal.II/grid/grid_out.h
deal.II/include/deal.II/grid/grid_tools.h
deal.II/include/deal.II/grid/tria.h
deal.II/include/deal.II/grid/tria_accessor.h
deal.II/include/deal.II/grid/tria_accessor.templates.h
deal.II/include/deal.II/grid/tria_objects.h
deal.II/include/deal.II/hp/dof_handler.h
deal.II/include/deal.II/numerics/error_estimator.h
deal.II/include/deal.II/numerics/vectors.h
deal.II/include/deal.II/numerics/vectors.templates.h
deal.II/source/dofs/dof_handler.cc
deal.II/source/dofs/dof_tools.cc
deal.II/source/dofs/dof_tools.inst.in
deal.II/source/grid/grid_generator.cc
deal.II/source/grid/grid_in.cc
deal.II/source/grid/grid_out.cc
deal.II/source/grid/grid_tools.cc
deal.II/source/grid/grid_tools.inst.in
deal.II/source/grid/tria.cc
deal.II/source/grid/tria_accessor.cc
deal.II/source/grid/tria_objects.cc
deal.II/source/hp/dof_handler.cc
deal.II/source/multigrid/mg_tools.cc
deal.II/source/numerics/error_estimator.cc
deal.II/source/numerics/error_estimator.inst.in
deal.II/source/numerics/vectors.inst.in

index 5c25d1f47aa79a19962bb9b619933dd31052c056..14b3ec785197e522b30e8be8e84c1a0b386c4e1b 100644 (file)
@@ -24,7 +24,9 @@ inconvenience this causes.
 </p>
 
 <ol>
-<li> None so far.
+<li> Changed: The the argument material_id of the estimate-functions of the KellyErrorEstimator class  are now of type types::material_id_type with the default value types::invalid_material_id instead of type unsigned int with the default value numbers::invalid_unsigned_int. The member functions Triangulation::set_boundary and Triangulation::get_boundary now take a types::boundary_id_t instead of an unsigned int.
+<br>
+(Wolfgang Bangerth, Christian Goll 2012/02/27)
 </ol>
 
 
@@ -34,6 +36,13 @@ inconvenience this causes.
 <h3>General</h3>
 
 <ol>
+<li> Changed: Material and Boundary indicators have been both of the type unsigned char. Throughout the library, we changed their datatype to <code>types::material_id_t</code> resp. <code>types::boundary_id_t</code>, both typedefs of unsigned char. Internal faces are now characterized by types::internal_face_boundary_id(<code>=static_cast<boundary_id_t>(-1)</code>) instead of 255,
+so we get rid of that mysterious numberin the source code.
+Material_ids are also assumed  to lie in the range from 0 to types::invalid_material_id-1 (where <code>types::invalid_material_id = static_cast<material_id_t>(-1)</code>). With this change, it is now much easier to extend the range of boundary or material ids, if needed. 
+
+<br>
+(Wolfgang Bangerth, Christian Goll 2012/02/27)
+
 <li> New: Functions like FEValues::get_function_values have long been
 able to extract values from pretty much any vector kind given to it (e.g.
 of kind Vector, BlockVector, PETScWrappers::Vector, etc). The list of
index ad51855a31e1174d9ce6f3716e12d5f279081ec2..5e6c16a4efb3b6d2ccc322f09fe7f2e3cabcbf83 100644 (file)
@@ -77,6 +77,29 @@ namespace types
                                    * of freedom.
                                    */
   const global_dof_index invalid_dof_index = static_cast<global_dof_index>(-1);
+
+          /**
+           * The type used to denote boundary_indicators.
+           */
+  typedef unsigned char boundary_id_t;
+
+          /**
+           * The number which we reserve for internal faces.
+           * We assume that all boundary_ids lie in the range [0, internal_face_boundary_id).
+           */
+  const boundary_id_t internal_face_boundary_id = static_cast<boundary_id_t>(-1);
+
+          /**
+           * The type used to denote boundary_indicators.
+           */
+  typedef unsigned char material_id_t;
+
+          /**
+           * Invalid material_id which we need in several places as a default value.
+           * We assume that all material_ids lie in the range [0, invalid_material_id).
+           */
+  const material_id_t invalid_material_id = static_cast<material_id_t>(-1);
+
 }
 
 
index 7b74135fe1c3f5975253f638e333b7f927dedce1..531d00776d57d456fd6e311147548dcc2482cece 100644 (file)
@@ -1073,7 +1073,7 @@ class DoFHandler  :  public Subscriptor
                                      * consideration.
                                      */
     unsigned int
-    n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const;
+    n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const;
 
                                     /**
                                      * Access to an object informing
@@ -1419,7 +1419,7 @@ class DoFHandler  :  public Subscriptor
 
 template <> unsigned int DoFHandler<1>::n_boundary_dofs () const;
 template <> unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const;
-template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &) const;
+template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &) const;
 
 
 /* ----------------------- Inline functions ---------------------------------- */
index d8d3d4e6a1be708f8fc80cfe38bed4b3ef320d98..10c844e3d470db2f4fd0e683dd80d9f3e8c111b3 100644 (file)
@@ -1120,7 +1120,7 @@ namespace DoFTools
   extract_boundary_dofs (const DH                   &dof_handler,
                         const std::vector<bool>    &component_select,
                         std::vector<bool>          &selected_dofs,
-                        const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+                        const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
 
                                   /**
                                    * This function is similar to
@@ -1157,7 +1157,7 @@ namespace DoFTools
   extract_dofs_with_support_on_boundary (const DH                   &dof_handler,
                                         const std::vector<bool>    &component_select,
                                         std::vector<bool>          &selected_dofs,
-                                        const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+                                        const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
 
                                   /**
                                    * @name Hanging Nodes
@@ -2168,7 +2168,7 @@ namespace DoFTools
   template <class DH>
   void
   map_dof_to_boundary_indices (const DH                      &dof_handler,
-                              const std::set<unsigned char> &boundary_indicators,
+                              const std::set<types::boundary_id_t> &boundary_indicators,
                               std::vector<unsigned int>     &mapping);
 
                                   /**
index 1b2fb7f652e2268fcf00464698267b02f221b077..0ed1c1fb1903594edb71fc880f0b23f1ffc01def 100644 (file)
@@ -48,7 +48,7 @@ struct FunctionMap
                                      * name it in the fashion of the
                                      * STL local typedefs.
                                      */
-    typedef std::map<unsigned char, const Function<dim>*> type;
+    typedef std::map<types::boundary_id_t, const Function<dim>*> type;
 };
 
 DEAL_II_NAMESPACE_CLOSE
index 988640668dece8fd36091ea90db220a195a7f506..6f8d623cce42bf727fbe8430554e7a451cfbfe29 100644 (file)
@@ -280,7 +280,7 @@ class GridGenerator
     subdivided_hyper_rectangle (Triangulation<dim>                       &tria,
                                const std::vector< std::vector<double> > &spacing,
                                const Point<dim>                         &p,
-                               const Table<dim,unsigned char>           &material_id,
+                               const Table<dim,types::material_id_t>           &material_id,
                                const bool                               colorize=false);
 
                                     /**
index 742d2ef249e0bfc3512c28a5cd1034c569b68be4..9863ae389468042b5a36256a48313c2f117f808a 100644 (file)
@@ -1530,7 +1530,8 @@ class GridOut
                                      * indicator not equal to zero. Only
                                      * these faces are explicitly printed
                                      * in the <tt>write_*</tt> functions;
-                                     * all faces with indicator 255 are
+                                     * all faces with indicator
+                                     * types::internal_face_boundary_id are
                                      * interior ones and an indicator with
                                      * value zero for faces at the boundary
                                      * are considered default.
@@ -1564,7 +1565,8 @@ class GridOut
                                      * indicator not equal to zero. Only
                                      * these lines are explicitly printed
                                      * in the <tt>write_*</tt> functions;
-                                     * all lines with indicator 255 are
+                                     * all lines with indicator
+                                     * types::internal_face_boundary_id are
                                      * interior ones and an indicator with
                                      * value zero for faces at the boundary
                                      * are considered default.
index f17b2c0f3f920e0670579c0c478e097e4c70aebe..2bcbfe3e85b760b74935331e3068dd4871aa323b 100644 (file)
@@ -898,8 +898,8 @@ namespace GridTools
           typename Container<dim,spacedim>::face_iterator>
   extract_boundary_mesh (const Container<dim,spacedim> &volume_mesh,
                         Container<dim-1,spacedim>     &surface_mesh,
-                        const std::set<unsigned char> &boundary_ids
-                        = std::set<unsigned char>());
+                        const std::set<types::boundary_id_t> &boundary_ids
+                        = std::set<types::boundary_id_t>());
 
                                 /**
                                  * Exception
index 15d04bc3eda0c311fd3842243eaf522242e4a149..c5117562c1c698a8b02fda3dbde6d788fe54c938 100644 (file)
@@ -97,20 +97,22 @@ struct CellData
     unsigned int vertices[GeometryInfo<structdim>::vertices_per_cell];
 
                                     /**
-                                     * Material indicator of this
-                                     * cell. May be used to denote
+                                     * Material or boundary indicator
+                                     * of this cell. The material_id
+                                     * may be used to denote
                                      * different coefficients, etc.
                                      *
                                      * Note that if this object is part of a
                                      * SubCellData object, then it represents
-                                     * a face or edge of a cell. Since
-                                     * deal.II only allows material_id tags
-                                     * on cells, this field is re-interpreted
-                                     * to indicate the boundary_indicator of
-                                     * a face or edge. In other words, for
-                                     * faces, this field is a misnomer.
-                                     */
-    unsigned char material_id;
+                                     * a face or edge of a cell. In this case
+                                     * one should use the field boundary_id
+                                     * instead of material_id.
+                                     */
+    union
+    {
+        types::boundary_id_t boundary_id;
+        types::material_id_t material_id;
+    };
 };
 
 
@@ -133,10 +135,10 @@ struct CellData
  *  boundary component is a list of lines which are given a common
  *  number describing the boundary condition to hold on this part of the
  *  boundary. The triangulation creation function gives lines not in this
- *  list either the boundary indicator zero (if on the boundary) or 255
- *  (if in the interior). Explicitely giving a line the indicator 255
- *  will result in an error, as well as giving an interior line a boundary
- *  indicator.
+ *  list either the boundary indicator zero (if on the boundary) or
+ *  types::internal_face_boundary_id (if in the interior). Explicitely giving a
+ *  line the indicator types::internal_face_boundary_id will result in an error, as well as giving
+ *  an interior line a boundary indicator.
  *
  * @ingroup grid
  */
@@ -338,7 +340,6 @@ namespace internal
                        const unsigned int version);
     };
 
-//TODO: Replace boundary[255] by a std::vector so we can use constructor of SmartPointer
 
 /**
  * Cache class used to store the number of used and active elements
@@ -975,11 +976,13 @@ namespace internal
  *   side vector to indicate these different parts of the model (this
  *   use is like the material id of cells).
 
- *   Material and boundary indicators may be in the range from zero to
- *   254. The value 255 is reserved to denote interior lines (in 2D)
+ *   Boundary indicators may be in the range from zero to
+ *   types::internal_face_boundary_id-1. The value
+ *   types::internal_face_boundary_id is reserved to denote interior lines (in 2D)
  *   and interior lines and quads (in 3D), which do not have a
- *   boundary or material indicator. This way, a program can easily
+ *   boundary indicator. This way, a program can easily
  *   determine, whether such an object is at the boundary or not.
+ *   Material indicators may be in the range from zero to types::invalid_material_id-1.
  *
  *   Lines in two dimensions and quads in three dimensions inherit their
  *   boundary indicator to their children upon refinement. You should therefore
@@ -1806,10 +1809,11 @@ class Triangulation : public Subscriptor
                                      * boundary, for instance the material id
                                      * in a UCD input file. They are not
                                      * necessarily consecutive but must be in
-                                     * the range 0-254.  Material IDs on
-                                     * boundaries are also called boundary
-                                     * indicators and are accessed with
-                                     * accessor functions of that name.
+                                     * the range 0-(types::boundary_id_t-1).
+                                     * Material IDs on boundaries are also
+                                     * called boundary indicators and are
+                                     * accessed with accessor functions
+                                     * of that name.
                                      *
                                      * The @p boundary_object is not copied
                                      * and MUST persist until the
@@ -1832,7 +1836,7 @@ class Triangulation : public Subscriptor
                                      * before by a straight boundary
                                      * approximation.
                                      */
-    void set_boundary (const unsigned int   number,
+    void set_boundary (const types::boundary_id_t   number,
                       const Boundary<dim,spacedim> &boundary_object);
 
                                      /**
@@ -1844,7 +1848,7 @@ class Triangulation : public Subscriptor
                                       * boundary object by the function of
                                       * same name and two arguments.
                                       */
-    void set_boundary (const unsigned int number);
+    void set_boundary (const types::boundary_id_t number);
 
                                     /**
                                      * Return a constant reference to
@@ -1853,7 +1857,7 @@ class Triangulation : public Subscriptor
                                      * the same as in
                                      * @p set_boundary
                                      */
-    const Boundary<dim,spacedim> & get_boundary (const unsigned int number) const;
+    const Boundary<dim,spacedim> & get_boundary (const types::boundary_id_t number) const;
 
                                     /**
                                      * Returns a vector containing
@@ -1868,7 +1872,7 @@ class Triangulation : public Subscriptor
                                      * indicators (which is greater
                                      * or equal one).
                                      */
-    std::vector<unsigned char> get_boundary_indicators() const;
+    std::vector<types::boundary_id_t> get_boundary_indicators() const;
 
                                     /**
                                      *  Copy a triangulation. This
@@ -3699,14 +3703,11 @@ class Triangulation : public Subscriptor
 
                                     /**
                                      *  Collection of boundary
-                                     *  objects. We only need 255
-                                     *  objects rather than 256,
-                                     *  since the indicator 255 is
-                                     *  reserved for interior faces
-                                     *  and can thus never be
-                                     *  associated with a boundary.
+                                     *  objects. We store only
+                                     *  objects, which are not
+                                     *  of type StraightBoundary.
                                      */
-    SmartPointer<const Boundary<dim,spacedim>,Triangulation<dim,spacedim> > boundary[255];
+    std::map<types::boundary_id_t, SmartPointer<const Boundary<dim, spacedim> , Triangulation<dim, spacedim> > >  boundary;
 
                                     /**
                                      * Flag indicating whether
@@ -3765,7 +3766,7 @@ class Triangulation : public Subscriptor
                                      * TriaAccessor::set_boundary_indicator)
                                      * were not a pointer.
                                      */
-    std::map<unsigned int, unsigned char> *vertex_to_boundary_id_map_1d;
+    std::map<unsigned int, types::boundary_id_t> *vertex_to_boundary_id_map_1d;
 
     /**
      * A map that correlates each refinement listener that has been added
index bba126f20e1af0b0f69c68c77ceb0080b7c453a5..0c9afcfa53951abb206765f1fb4a6c25f2653107 100644 (file)
@@ -1018,10 +1018,11 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                      * object.
                                      *
                                      * If the return value is the special
-                                     * value 255, then this object is in the
+                                     * value types::internal_face_boundary_id,
+                                     * then this object is in the
                                      * interior of the domain.
                                      */
-    unsigned char boundary_indicator () const;
+    types::boundary_id_t boundary_indicator () const;
 
                                     /**
                                      * Set the boundary indicator.
@@ -1049,21 +1050,23 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                      * boundary indicator of an interior face
                                      * (a face not at the boundary of the
                                      * domain), or set set the boundary
-                                     * indicator of an exterior face to 255
+                                     * indicator of an exterior face to
+                                     * types::internal_face_boundary_id
                                      * (this value is reserved for another
                                      * purpose). Algorithms may not work or
                                      * produce very confusing results if
                                      * boundary cells have a boundary
-                                     * indicator of 255 or if interior cells
-                                     * have boundary indicators other than
-                                     * 255. Unfortunately, the current object
+                                     * indicator of types::internal_face_boundary_id
+                                     * or if interior cells have boundary
+                                     * indicators other than types::internal_face_boundary_id.
+                                     * Unfortunately, the current object
                                      * has no means of finding out whether it
                                      * really is at the boundary of the
                                      * domain and so cannot determine whether
                                      * the value you are trying to set makes
                                      * sense under the current circumstances.
                                      */
-    void set_boundary_indicator (const unsigned char) const;
+    void set_boundary_indicator (const types::boundary_id_t) const;
 
                                     /**
                                      * Do as set_boundary_indicator()
@@ -1081,7 +1084,7 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                      * at the same time using the
                                      * current function.
                                      */
-    void set_all_boundary_indicators (const unsigned char) const;
+    void set_all_boundary_indicators (const types::boundary_id_t) const;
 
                                     /**
                                      * Return whether this object is at the
@@ -1922,10 +1925,11 @@ class TriaAccessor<0, 1, spacedim>
                                      * boundary indicator one.
                                      *
                                      * If the return value is the special
-                                     * value 255, then this object is in the
+                                     * value types::internal_face_boundary_id,
+                                     * then this object is in the
                                      * interior of the domain.
                                      */
-    unsigned char boundary_indicator () const;
+    types::boundary_id_t boundary_indicator () const;
 
                                     /**
                                      *  @name Orientation of sub-objects
@@ -2034,14 +2038,16 @@ class TriaAccessor<0, 1, spacedim>
                                      * boundary indicator of an interior face
                                      * (a face not at the boundary of the
                                      * domain), or set set the boundary
-                                     * indicator of an exterior face to 255
+                                     * indicator of an exterior face to
+                                     *  types::internal_face_boundary_id
                                      * (this value is reserved for another
                                      * purpose). Algorithms may not work or
                                      * produce very confusing results if
                                      * boundary cells have a boundary
-                                     * indicator of 255 or if interior cells
-                                     * have boundary indicators other than
-                                     * 255. Unfortunately, the current object
+                                     * indicator of types::internal_face_boundary_id
+                                     * or if interior cells have boundary
+                                     * indicators other than types::internal_face_boundary_id.
+                                     * Unfortunately, the current object
                                      * has no means of finding out whether it
                                      * really is at the boundary of the
                                      * domain and so cannot determine whether
@@ -2049,7 +2055,7 @@ class TriaAccessor<0, 1, spacedim>
                                      * sense under the current circumstances.
                                      */
     void
-    set_boundary_indicator (const unsigned char);
+    set_boundary_indicator (const types::boundary_id_t);
 
                                     /**
                                      * Since this object only represents a
@@ -2058,7 +2064,7 @@ class TriaAccessor<0, 1, spacedim>
                                      * argument.
                                      */
     void
-    set_all_boundary_indicators (const unsigned char);
+    set_all_boundary_indicators (const types::boundary_id_t);
 
                                     /**
                                      * Return whether the vertex
@@ -2593,7 +2599,7 @@ class CellAccessor :  public TriaAccessor<dim,dim,spacedim>
                                      * "glossary" for more
                                      * information.
                                      */
-    unsigned char material_id () const;
+    types::material_id_t material_id () const;
 
                                     /**
                                      * Set the material id of this
@@ -2607,7 +2613,7 @@ class CellAccessor :  public TriaAccessor<dim,dim,spacedim>
                                      * "glossary" for more
                                      * information.
                                      */
-    void set_material_id (const unsigned char new_material_id) const;
+    void set_material_id (const types::material_id_t new_material_id) const;
 
                                     /**
                                      * Set the material id of this
@@ -2619,7 +2625,7 @@ class CellAccessor :  public TriaAccessor<dim,dim,spacedim>
                                      * "glossary" for more
                                      * information.
                                      */
-    void recursively_set_material_id (const unsigned char new_material_id) const;
+    void recursively_set_material_id (const types::material_id_t new_material_id) const;
                                     /**
                                      * @}
                                      */
index 06ab8003ea36934c5e5e3cd324078a4f68e5e568..dcbc34982d4f4d3429b69a1e844df5e5f3e1d2b6 100644 (file)
@@ -1812,13 +1812,13 @@ TriaAccessor<structdim, dim, spacedim>::number_of_children () const
 
 
 template <int structdim, int dim, int spacedim>
-unsigned char
+types::boundary_id_t
 TriaAccessor<structdim, dim, spacedim>::boundary_indicator () const
 {
   Assert (structdim<dim, ExcImpossibleInDim(dim));
   Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
 
-  return this->objects().material_id[this->present_index];
+  return this->objects().boundary_or_material_id[this->present_index].boundary_id;
 }
 
 
@@ -1826,12 +1826,12 @@ TriaAccessor<structdim, dim, spacedim>::boundary_indicator () const
 template <int structdim, int dim, int spacedim>
 void
 TriaAccessor<structdim, dim, spacedim>::
-set_boundary_indicator (const unsigned char boundary_ind) const
+set_boundary_indicator (const types::boundary_id_t boundary_ind) const
 {
   Assert (structdim<dim, ExcImpossibleInDim(dim));
   Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
 
-  this->objects().material_id[this->present_index] = boundary_ind;
+  this->objects().boundary_or_material_id[this->present_index].boundary_id = boundary_ind;
 }
 
 
@@ -1839,10 +1839,9 @@ set_boundary_indicator (const unsigned char boundary_ind) const
 template <int structdim, int dim, int spacedim>
 void
 TriaAccessor<structdim, dim, spacedim>::
-set_all_boundary_indicators (const unsigned char boundary_ind) const
+set_all_boundary_indicators (const types::boundary_id_t boundary_ind) const
 {
   set_boundary_indicator (boundary_ind);
-  set_boundary_indicator (boundary_ind);
 
   switch (structdim)
     {
@@ -1871,7 +1870,7 @@ TriaAccessor<structdim, dim, spacedim>::at_boundary () const
 {
                                   // error checking is done
                                   // in boundary_indicator()
-  return (boundary_indicator() != 255);
+  return (boundary_indicator() != types::internal_face_boundary_id);
 }
 
 
@@ -1884,7 +1883,7 @@ TriaAccessor<structdim, dim, spacedim>::get_boundary () const
   Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
 
   return this->tria->get_boundary(this->objects()
-                                 .material_id[this->present_index]);
+                                 .boundary_or_material_id[this->present_index].boundary_id);
 }
 
 
@@ -2229,7 +2228,7 @@ TriaAccessor<0, 1, spacedim>::at_boundary () const
 
 template <int spacedim>
 inline
-unsigned char
+types::boundary_id_t
 TriaAccessor<0, 1, spacedim>::boundary_indicator () const
 {
   switch (vertex_kind)
@@ -2245,7 +2244,7 @@ TriaAccessor<0, 1, spacedim>::boundary_indicator () const
       }
 
       default:
-           return 255;
+           return types::internal_face_boundary_id;
     }
 
 }
@@ -2366,7 +2365,7 @@ int TriaAccessor<0, 1, spacedim>::isotropic_child_index (const unsigned int)
 template <int spacedim>
 inline
 void
-TriaAccessor<0, 1, spacedim>::set_boundary_indicator (const unsigned char b)
+TriaAccessor<0, 1, spacedim>::set_boundary_indicator (const types::boundary_id_t b)
 {
   Assert (tria->vertex_to_boundary_id_map_1d->find (this->vertex_index())
          != tria->vertex_to_boundary_id_map_1d->end(),
@@ -2379,7 +2378,7 @@ TriaAccessor<0, 1, spacedim>::set_boundary_indicator (const unsigned char b)
 
 template <int spacedim>
 inline
-void TriaAccessor<0, 1, spacedim>::set_all_boundary_indicators (const unsigned char b)
+void TriaAccessor<0, 1, spacedim>::set_all_boundary_indicators (const types::boundary_id_t b)
 {
   set_boundary_indicator (b);
 }
index 646655e491686e0b6a013a353da768ea92c473f0..214d13ee99b093f9aa7febd02f1ffe0148fcc08e 100644 (file)
@@ -127,12 +127,29 @@ namespace internal
                                          *  Triangulation::clear_user_flags().
                                          */
        std::vector<bool> user_flags;
-       
+
+
+       /**
+        * We use this union to store boundary and material
+        * data. Because only one one out of these two is 
+        * actually needed here, we use an union.
+        */
+  union BoundaryOrMaterialId
+    {
+        types::boundary_id_t boundary_id;
+        types::material_id_t material_id;
+
+        std::size_t memory_consumption () const
+        {
+          return std::max(sizeof(material_id),sizeof(boundary_id));
+        }
+    };
                                         /**
                                          * Store boundary and material data. For
                                          * example, in one dimension, this field
                                          * stores the material id of a line, which
-                                         * is a number between 0 and 254. In more
+                                         * is a number between 0 and
+                                         * types::invalid_material_id-1. In more
                                          * than one dimension, lines have no
                                          * material id, but they may be at the
                                          * boundary; then, we store the
@@ -141,36 +158,39 @@ namespace internal
                                          * boundary this line belongs and which
                                          * boundary conditions hold on this
                                          * part. The boundary indicator also
-                                         * is a number between zero and 254;
-                                         * the id 255 is reserved for lines
+                                         * is a number between zero and
+                                         * types::internal_face_boundary_id-1;
+                                         * the id types::internal_face_boundary_id
+                                         * is reserved for lines
                                          * in the interior and may be used
                                          * to check whether a line is at the
                                          * boundary or not, which otherwise
                                          * is not possible if you don't know
                                          * which cell it belongs to.
                                          */
-       std::vector<unsigned char> material_id;
        
-                                         /**
-                                          *  Assert that enough space
-                                          *  is allocated to
-                                          *  accomodate
-                                          *  <code>new_objs_in_pairs</code>
-                                          *  new objects, stored in
-                                          *  pairs, plus
-                                          *  <code>new_obj_single</code>
-                                          *  stored individually.
-                                          *  This function does not
-                                          *  only call
-                                          *  <code>vector::reserve()</code>,
-                                          *  but does really append
-                                          *  the needed elements.
-                                         *
-                                         *  In 2D e.g. refined lines have to be
-                                         *  stored in pairs, whereas new lines in the
-                                         *  interior of refined cells can be stored as
-                                         *  single lines.
-                                          */
+       std::vector<BoundaryOrMaterialId> boundary_or_material_id;
+
+            /**
+             *  Assert that enough space
+             *  is allocated to
+             *  accomodate
+             *  <code>new_objs_in_pairs</code>
+             *  new objects, stored in
+             *  pairs, plus
+             *  <code>new_obj_single</code>
+             *  stored individually.
+             *  This function does not
+             *  only call
+             *  <code>vector::reserve()</code>,
+             *  but does really append
+             *  the needed elements.
+             *
+             *  In 2D e.g. refined lines have to be
+             *  stored in pairs, whereas new lines in the
+             *  interior of refined cells can be stored as
+             *  single lines.
+             */
         void reserve_space (const unsigned int new_objs_in_pairs,
                            const unsigned int new_objs_single = 0);
 
@@ -792,7 +812,7 @@ namespace internal
       ar & refinement_cases;
       ar & used;
       ar & user_flags;
-      ar & material_id;
+      ar & boundary_or_material_id;
       ar & next_free_single & next_free_pair & reverse_order_next_free_single;
       ar & user_data & user_data_type;
     }
index 80f7d2bd3b13e14ee1c8f230a09891b78b394fa6..302593fed053647b5f979c3b47705f45b6b41fc5 100644 (file)
@@ -863,7 +863,7 @@ namespace hp
                                         * consideration.
                                         */
       unsigned int
-      n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const;
+      n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const;
 
                                       /**
                                        * Return the number of
index b5b9049a08f2d6e29fc5ee7feb5d1818b52c72a7..6fdb184536d86ad8b5ce378033156c3ed85aed43 100644 (file)
@@ -285,12 +285,12 @@ class KellyErrorEstimator
                                      * neighboring cells as well, even if
                                      * they belong to a different subdomain.
                                      *
-                                     * The @p material_id parameter has a
-                                     * similar meaning: if not set to its
-                                     * default value, it means that
-                                     * indicators will only be computed for
-                                     * cells with this particular material
-                                     * id.
+                                     * The @p material_id parameter has a similar
+                                     * meaning: if not set to its default value
+                                     * (which is types::invalid_material_id),
+                                     * it means that indicators will only be
+                                     * computed for cells with this particular
+                                     * material id.
                                      *
                                      * The @p n_threads parameter used to
                                      * indicate the number of threads to be
@@ -336,7 +336,7 @@ class KellyErrorEstimator
                          const Function<spacedim>     *coefficients   = 0,
                          const unsigned int       n_threads = numbers::invalid_unsigned_int,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int       material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t       material_id = types::invalid_material_id);
 
                                     /**
                                      * Calls the @p estimate
@@ -353,7 +353,7 @@ class KellyErrorEstimator
                          const Function<spacedim>     *coefficients   = 0,
                          const unsigned int       n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int       material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t       material_id = types::invalid_material_id);
 
                                     /**
                                      * Same function as above, but
@@ -393,7 +393,7 @@ class KellyErrorEstimator
                          const Function<spacedim>         *coefficients   = 0,
                          const unsigned int           n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int           material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t           material_id = types::invalid_material_id);
 
                                     /**
                                      * Calls the @p estimate
@@ -410,7 +410,7 @@ class KellyErrorEstimator
                          const Function<spacedim>         *coefficients   = 0,
                          const unsigned int           n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int           material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t          material_id = types::invalid_material_id);
 
 
                                     /**
@@ -430,7 +430,7 @@ class KellyErrorEstimator
                          const Function<spacedim>     *coefficients   = 0,
                          const unsigned int       n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int       material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t       material_id = types::invalid_material_id);
 
 
                                     /**
@@ -449,7 +449,7 @@ class KellyErrorEstimator
                          const Function<spacedim>     *coefficients   = 0,
                          const unsigned int       n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int       material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t       material_id = types::invalid_material_id);
 
 
                                     /**
@@ -469,7 +469,7 @@ class KellyErrorEstimator
                          const Function<spacedim>         *coefficients   = 0,
                          const unsigned int           n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int           material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t           material_id = types::invalid_material_id);
 
 
                                     /**
@@ -488,7 +488,7 @@ class KellyErrorEstimator
                          const Function<spacedim>*    coefficients   = 0,
                          const unsigned int           n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int           material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t           material_id = types::invalid_material_id);
 
 
                                     /**
@@ -599,7 +599,7 @@ class KellyErrorEstimator<1,spacedim>
                          const Function<spacedim>     *coefficients   = 0,
                          const unsigned int       n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int       material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t       material_id = types::invalid_material_id);
 
                                     /**
                                      * Calls the @p estimate
@@ -616,7 +616,7 @@ class KellyErrorEstimator<1,spacedim>
                          const Function<spacedim>     *coefficients   = 0,
                          const unsigned int       n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int       material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t       material_id = types::invalid_material_id);
 
                                     /**
                                      * Same function as above, but
@@ -656,7 +656,7 @@ class KellyErrorEstimator<1,spacedim>
                          const Function<spacedim>         *coefficients   = 0,
                          const unsigned int           n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int           material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t           material_id = types::invalid_material_id);
 
                                     /**
                                      * Calls the @p estimate
@@ -673,7 +673,7 @@ class KellyErrorEstimator<1,spacedim>
                          const Function<spacedim>         *coefficients   = 0,
                          const unsigned int           n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int           material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t           material_id = types::invalid_material_id);
 
 
                                     /**
@@ -693,7 +693,7 @@ class KellyErrorEstimator<1,spacedim>
                          const Function<spacedim>     *coefficients   = 0,
                          const unsigned int       n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int       material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t       material_id = types::invalid_material_id);
 
 
                                     /**
@@ -712,7 +712,7 @@ class KellyErrorEstimator<1,spacedim>
                          const Function<spacedim>     *coefficients   = 0,
                          const unsigned int       n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int       material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t       material_id = types::invalid_material_id);
 
 
                                     /**
@@ -732,7 +732,7 @@ class KellyErrorEstimator<1,spacedim>
                          const Function<spacedim>         *coefficients   = 0,
                          const unsigned int           n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int           material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t           material_id = types::invalid_material_id);
 
 
                                     /**
@@ -751,7 +751,7 @@ class KellyErrorEstimator<1,spacedim>
                          const Function<spacedim>         *coefficients   = 0,
                          const unsigned int           n_threads = multithread_info.n_default_threads,
                           const types::subdomain_id_t subdomain_id = types::invalid_subdomain_id,
-                          const unsigned int           material_id = numbers::invalid_unsigned_int);
+                          const types::material_id_t           material_id = types::invalid_material_id);
 
                                     /**
                                      * Exception
index d34c18b8884e9eaf22044856fd723f07f8a1cf44..93dcc69c1a747d1b2ee7f8fa9b05da800590bdcc 100644 (file)
@@ -121,8 +121,9 @@ class ConstraintMatrix;
  *   the trace of the function to the boundary is done with the
  *   VectorTools::project_boundary_values() (see below) function,
  *   which is called with a map of boundary functions FunctioMap in
- *   which all boundary indicators from zero to 254 (255 is used for
- *   other purposes, see the Triangulation class documentation) point
+ *   which all boundary indicators from zero to types::internal_face_boundary_id-1
+ *   (types::internal_face_boundary_id is used for other purposes,
+ *   see the Triangulation class documentation) point
  *   to the function to be projected. The projection to the boundary
  *   takes place using a second quadrature formula on the boundary
  *   given to the project() function. The first quadrature formula is
@@ -193,7 +194,7 @@ class ConstraintMatrix;
  *   of boundary nodes and their values. You can get such a list by interpolation
  *   of a boundary function using the interpolate_boundary_values() function.
  *   To use it, you have to
- *   specify a list of pairs of boundary indicators (of type <tt>unsigned char</tt>;
+ *   specify a list of pairs of boundary indicators (of type <tt>types::boundary_id_t</tt>;
  *   see the section in the documentation of the Triangulation class for more
  *   details) and the according functions denoting the dirichlet boundary values
  *   of the nodes on boundary faces with this boundary indicator.
@@ -688,9 +689,9 @@ namespace VectorTools
                                    * @p boundary_component
                                    * corresponds to the number
                                    * @p boundary_indicator of the
-                                   * face.  255 is an illegal
-                                   * value, since it is reserved
-                                   * for interior faces.
+                                   * face.  types::internal_face_boundary_id
+                                   * is an illegal value, since
+                                   * it is reserved for interior faces.
                                    *
                                    * The flags in the last
                                    * parameter, @p component_mask
@@ -762,7 +763,7 @@ namespace VectorTools
   void
   interpolate_boundary_values (const Mapping<DH::dimension,DH::space_dimension>            &mapping,
                               const DH                 &dof,
-                              const unsigned char            boundary_component,
+                              const types::boundary_id_t            boundary_component,
                               const Function<DH::space_dimension>           &boundary_function,
                               std::map<unsigned int,double> &boundary_values,
                               const std::vector<bool>       &component_mask = std::vector<bool>());
@@ -777,7 +778,7 @@ namespace VectorTools
 
   void
   interpolate_boundary_values (const DH        &dof,
-                              const unsigned char            boundary_component,
+                              const types::boundary_id_t            boundary_component,
                               const Function<DH::space_dimension>           &boundary_function,
                               std::map<unsigned int,double> &boundary_values,
                               const std::vector<bool>       &component_mask = std::vector<bool>());
@@ -837,7 +838,8 @@ namespace VectorTools
                                    *
                                    * The parameter @p boundary_component
                                    * corresponds to the number @p
-                                   * boundary_indicator of the face.  255
+                                   * boundary_indicator of the face.
+                                   * types::internal_face_boundary_id
                                    * is an illegal value, since it is
                                    * reserved for interior faces.
                                    *
@@ -905,7 +907,7 @@ namespace VectorTools
   void
   interpolate_boundary_values (const Mapping<DH::dimension,DH::space_dimension> &mapping,
                               const DH                            &dof,
-                              const unsigned char                  boundary_component,
+                              const types::boundary_id_t                  boundary_component,
                               const Function<DH::space_dimension> &boundary_function,
                               ConstraintMatrix                    &constraints,
                               const std::vector<bool>             &component_mask = std::vector<bool>());
@@ -922,7 +924,7 @@ namespace VectorTools
 
   void
   interpolate_boundary_values (const DH                            &dof,
-                              const unsigned char                  boundary_component,
+                              const types::boundary_id_t                  boundary_component,
                               const Function<DH::space_dimension> &boundary_function,
                               ConstraintMatrix                    &constraints,
                               const std::vector<bool>             &component_mask = std::vector<bool>());
@@ -1145,7 +1147,8 @@ namespace VectorTools
                                    *
                                    * The parameter @p boundary_component
                                    * corresponds to the number
-                                   * @p boundary_indicator of the face. 255
+                                   * @p boundary_indicator of the face.
+                                   * types::internal_face_boundary_id
                                    * is an illegal value, since it is
                                    * reserved for interior faces.
                                    *
@@ -1177,7 +1180,7 @@ namespace VectorTools
   void project_boundary_values_curl_conforming (const DoFHandler<dim>& dof_handler,
                                                const unsigned int first_vector_component,
                                                const Function<dim>& boundary_function,
-                                               const unsigned char boundary_component,
+                                               const types::boundary_id_t boundary_component,
                                                ConstraintMatrix& constraints,
                                                const Mapping<dim>& mapping = StaticMappingQ1<dim>::mapping);
 
@@ -1190,7 +1193,7 @@ namespace VectorTools
   void project_boundary_values_curl_conforming (const hp::DoFHandler<dim>& dof_handler,
                                                const unsigned int first_vector_component,
                                                const Function<dim>& boundary_function,
-                                               const unsigned char boundary_component,
+                                               const types::boundary_id_t boundary_component,
                                                ConstraintMatrix& constraints,
                                                const hp::MappingCollection<dim, dim>& mapping_collection = hp::StaticMappingQ1<dim>::mapping_collection);
 
@@ -1239,7 +1242,8 @@ namespace VectorTools
                                    *
                                    * The parameter @p boundary_component
                                    * corresponds to the number
-                                   * @p boundary_indicator of the face. 255
+                                   * @p boundary_indicator of the face.
+                                   *  types::internal_face_boundary_id
                                    * is an illegal value, since it is
                                    * reserved for interior faces.
                                    *
@@ -1262,7 +1266,7 @@ namespace VectorTools
   void project_boundary_values_div_conforming (const DoFHandler<dim>& dof_handler,
                                               const unsigned int first_vector_component,
                                               const Function<dim>& boundary_function,
-                                              const unsigned char boundary_component,
+                                              const types::boundary_id_t boundary_component,
                                               ConstraintMatrix& constraints,
                                               const Mapping<dim>& mapping = StaticMappingQ1<dim>::mapping);
 
@@ -1275,7 +1279,7 @@ namespace VectorTools
   void project_boundary_values_div_conforming (const hp::DoFHandler<dim>& dof_handler,
                                               const unsigned int first_vector_component,
                                               const Function<dim>& boundary_function,
-                                              const unsigned char boundary_component,
+                                              const types::boundary_id_t boundary_component,
                                               ConstraintMatrix& constraints,
                                               const hp::MappingCollection<dim, dim>& mapping_collection = hp::StaticMappingQ1<dim>::mapping_collection);
 
@@ -1600,7 +1604,7 @@ namespace VectorTools
   void
   compute_no_normal_flux_constraints (const DH<dim,spacedim>         &dof_handler,
                                      const unsigned int     first_vector_component,
-                                     const std::set<unsigned char> &boundary_ids,
+                                     const std::set<types::boundary_id_t> &boundary_ids,
                                      ConstraintMatrix      &constraints,
                                      const Mapping<dim, spacedim>    &mapping = StaticMappingQ1<dim>::mapping);
 
@@ -1726,7 +1730,7 @@ namespace VectorTools
                                        const Quadrature<dim-1> &q,
                                        const Function<spacedim>     &rhs,
                                        Vector<double>          &rhs_vector,
-                                       const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+                                       const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
 
                                   /**
                                    * Calls the
@@ -1739,7 +1743,7 @@ namespace VectorTools
                                        const Quadrature<dim-1> &q,
                                        const Function<spacedim>     &rhs,
                                        Vector<double>          &rhs_vector,
-                                       const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+                                       const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
 
                                   /**
                                    * Same as the set of functions above,
@@ -1751,7 +1755,7 @@ namespace VectorTools
                                        const hp::QCollection<dim-1> &q,
                                        const Function<spacedim>     &rhs,
                                        Vector<double>          &rhs_vector,
-                                       const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+                                       const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
 
                                   /**
                                    * Calls the
@@ -1768,7 +1772,7 @@ namespace VectorTools
                                        const hp::QCollection<dim-1> &q,
                                        const Function<spacedim>     &rhs,
                                        Vector<double>          &rhs_vector,
-                                       const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+                                       const std::set<types::boundary_id_t> &boundary_indicators = std::set<types::boundary_id_t>());
 
                                   //@}
                                   /**
index 8cb8243a066362d93002113f21b3c32fad81773c..cebeaefb478f3b1dae0bf7911d169e833fb0ad43 100644 (file)
@@ -306,7 +306,7 @@ namespace VectorTools
 
                                             // count, how often we have
                                             // added to this dof
-           Assert (touch_count[local_dof_indices[j]] < 255,
+           Assert (touch_count[local_dof_indices[j]] < types::internal_face_boundary_id,
                    ExcInternalError());
            ++touch_count[local_dof_indices[j]];
          };
@@ -569,7 +569,7 @@ namespace VectorTools
                                           // function to hold on
                                           // all parts of the boundary
          typename FunctionMap<spacedim>::type boundary_functions;
-         for (unsigned char c=0; c<255; ++c)
+         for (types::boundary_id_t c=0; c<types::internal_face_boundary_id; ++c)
            boundary_functions[c] = &function;
          project_boundary_values (dof, boundary_functions, q_boundary,
                                   boundary_values);
@@ -1016,7 +1016,7 @@ namespace VectorTools
                                   const Quadrature<0>   &,
                                   const Function<1>     &,
                                   Vector<double>        &,
-                                  const std::set<unsigned char> &)
+                                  const std::set<types::boundary_id_t> &)
   {
     Assert (false, ExcImpossibleInDim(1));
   }
@@ -1030,7 +1030,7 @@ namespace VectorTools
                                   const Quadrature<0>   &,
                                   const Function<2>     &,
                                   Vector<double>        &,
-                                  const std::set<unsigned char> &)
+                                  const std::set<types::boundary_id_t> &)
   {
     Assert (false, ExcImpossibleInDim(1));
   }
@@ -1044,7 +1044,7 @@ namespace VectorTools
                                   const Quadrature<dim-1> &quadrature,
                                   const Function<spacedim>     &rhs_function,
                                   Vector<double>          &rhs_vector,
-                                  const std::set<unsigned char> &boundary_indicators)
+                                  const std::set<types::boundary_id_t> &boundary_indicators)
   {
     const FiniteElement<dim> &fe  = dof_handler.get_fe();
     Assert (fe.n_components() == rhs_function.n_components,
@@ -1166,7 +1166,7 @@ namespace VectorTools
                                   const Quadrature<dim-1> &quadrature,
                                   const Function<spacedim>     &rhs_function,
                                   Vector<double>          &rhs_vector,
-                                  const std::set<unsigned char> &boundary_indicators)
+                                  const std::set<types::boundary_id_t> &boundary_indicators)
   {
     Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
 
@@ -1187,7 +1187,7 @@ namespace VectorTools
                                   const hp::QCollection<0> &,
                                   const Function<1>     &,
                                   Vector<double>          &,
-                                  const std::set<unsigned char> &)
+                                  const std::set<types::boundary_id_t> &)
   {
     Assert (false, ExcImpossibleInDim(1));
   }
@@ -1201,7 +1201,7 @@ namespace VectorTools
                                   const hp::QCollection<0> &,
                                   const Function<2>     &,
                                   Vector<double>          &,
-                                  const std::set<unsigned char> &)
+                                  const std::set<types::boundary_id_t> &)
   {
     Assert (false, ExcImpossibleInDim(1));
   }
@@ -1215,7 +1215,7 @@ namespace VectorTools
                                   const hp::QCollection<dim-1>  &quadrature,
                                   const Function<spacedim>      &rhs_function,
                                   Vector<double>                &rhs_vector,
-                                  const std::set<unsigned char> &boundary_indicators)
+                                  const std::set<types::boundary_id_t> &boundary_indicators)
   {
     const hp::FECollection<dim> &fe  = dof_handler.get_fe();
     Assert (fe.n_components() == rhs_function.n_components,
@@ -1349,7 +1349,7 @@ namespace VectorTools
                                   const hp::QCollection<dim-1>  &quadrature,
                                   const Function<spacedim>      &rhs_function,
                                   Vector<double>                &rhs_vector,
-                                  const std::set<unsigned char> &boundary_indicators)
+                                  const std::set<types::boundary_id_t> &boundary_indicators)
   {
     Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
     create_boundary_right_hand_side(hp::StaticMappingQ1<dim>::mapping_collection,
@@ -1487,7 +1487,7 @@ namespace VectorTools
       if (function_map.size() == 0)
        return;
 
-      Assert (function_map.find(255) == function_map.end(),
+      Assert (function_map.find(types::internal_face_boundary_id) == function_map.end(),
              ExcInvalidBoundaryIndicator());
 
       const unsigned int        n_components = DoFTools::n_components(dof);
@@ -1645,7 +1645,7 @@ namespace VectorTools
                                               // cast the face iterator to a DoFHandler
                                               // iterator so that we can access the boundary
                                               // indicators
-             const unsigned char boundary_component = face->boundary_indicator();
+             const types::boundary_id_t boundary_component = face->boundary_indicator();
              if (function_map.find(boundary_component) != function_map.end())
                {
                                                   // face is of the right component
@@ -1833,7 +1833,7 @@ namespace VectorTools
   void
   interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension>            &mapping,
                               const DH                 &dof,
-                              const unsigned char            boundary_component,
+                              const types::boundary_id_t            boundary_component,
                               const Function<DH::space_dimension>           &boundary_function,
                               std::map<unsigned int,double> &boundary_values,
                               const std::vector<bool>       &component_mask)
@@ -1849,7 +1849,7 @@ namespace VectorTools
   template <class DH>
   void
   interpolate_boundary_values (const DH                 &dof,
-                              const unsigned char            boundary_component,
+                              const types::boundary_id_t            boundary_component,
                               const Function<DH::space_dimension>           &boundary_function,
                               std::map<unsigned int,double> &boundary_values,
                               const std::vector<bool>       &component_mask)
@@ -1916,7 +1916,7 @@ namespace VectorTools
   interpolate_boundary_values
   (const Mapping<DH::dimension, DH::space_dimension> &mapping,
    const DH                                          &dof,
-   const unsigned char                                boundary_component,
+   const types::boundary_id_t                                boundary_component,
    const Function<DH::space_dimension>               &boundary_function,
    ConstraintMatrix                                  &constraints,
    const std::vector<bool>                           &component_mask)
@@ -1933,7 +1933,7 @@ namespace VectorTools
   void
   interpolate_boundary_values
   (const DH                            &dof,
-   const unsigned char                  boundary_component,
+   const types::boundary_id_t                  boundary_component,
    const Function<DH::space_dimension> &boundary_function,
    ConstraintMatrix                    &constraints,
    const std::vector<bool>             &component_mask)
@@ -2033,7 +2033,7 @@ namespace VectorTools
       AssertDimension (dof.get_fe().n_components(), component_mapping.size());
 
     std::vector<unsigned int> dof_to_boundary_mapping;
-    std::set<unsigned char> selected_boundary_components;
+    std::set<types::boundary_id_t> selected_boundary_components;
     for (typename FunctionMap<spacedim>::type::const_iterator i=boundary_functions.begin();
         i!=boundary_functions.end(); ++i)
       selected_boundary_components.insert (i->first);
@@ -3248,7 +3248,7 @@ namespace VectorTools
   project_boundary_values_curl_conforming (const DoFHandler<dim>& dof_handler,
                                           const unsigned int first_vector_component,
                                           const Function<dim>& boundary_function,
-                                          const unsigned char boundary_component,
+                                          const types::boundary_id_t boundary_component,
                                           ConstraintMatrix& constraints,
                                           const Mapping<dim>& mapping)
   {
@@ -3549,7 +3549,7 @@ namespace VectorTools
   project_boundary_values_curl_conforming (const hp::DoFHandler<dim>& dof_handler,
                                           const unsigned int first_vector_component,
                                           const Function<dim>& boundary_function,
-                                          const unsigned char boundary_component,
+                                          const types::boundary_id_t boundary_component,
                                           ConstraintMatrix& constraints,
                                           const hp::MappingCollection<dim>& mapping_collection)
   {
@@ -3968,7 +3968,7 @@ namespace VectorTools
   project_boundary_values_div_conforming (const DoFHandler<dim>& dof_handler,
                                          const unsigned int first_vector_component,
                                          const Function<dim>& boundary_function,
-                                         const unsigned char boundary_component,
+                                         const types::boundary_id_t boundary_component,
                                          ConstraintMatrix& constraints,
                                          const Mapping<dim>& mapping)
   {
@@ -4133,7 +4133,7 @@ namespace VectorTools
   project_boundary_values_div_conforming (const hp::DoFHandler<dim>& dof_handler,
                                          const unsigned int first_vector_component,
                                          const Function<dim>& boundary_function,
-                                         const unsigned char boundary_component,
+                                         const types::boundary_id_t boundary_component,
                                          ConstraintMatrix& constraints,
                                          const hp::MappingCollection<dim, dim>& mapping_collection)
   {
@@ -4269,7 +4269,7 @@ namespace VectorTools
 
   compute_no_normal_flux_constraints (const DH<dim,spacedim>         &dof_handler,
                                      const unsigned int     first_vector_component,
-                                     const std::set<unsigned char> &boundary_ids,
+                                     const std::set<types::boundary_id_t> &boundary_ids,
                                      ConstraintMatrix      &constraints,
                                      const Mapping<dim, spacedim>    &mapping)
   {
index 5caa9d6983aa952e285770cb41f8d33ec0554990..9e42a724f87235f1bd5e7738bcdcffbf1e1f453e 100644 (file)
@@ -1489,12 +1489,12 @@ unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicat
 
 
 template <>
-unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
 {
                                   // check that only boundary
                                   // indicators 0 and 1 are allowed
                                   // in 1d
-  for (std::set<unsigned char>::const_iterator i=boundary_indicators.begin();
+  for (std::set<types::boundary_id_t>::const_iterator i=boundary_indicators.begin();
        i!=boundary_indicators.end(); ++i)
     Assert ((*i == 0) || (*i == 1),
            ExcInvalidBoundaryIndicator());
@@ -1528,12 +1528,12 @@ unsigned int DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &boundary_indic
 
 
 template <>
-unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
 {
                                   // check that only boundary
                                   // indicators 0 and 1 are allowed
                                   // in 1d
-  for (std::set<unsigned char>::const_iterator i=boundary_indicators.begin();
+  for (std::set<types::boundary_id_t>::const_iterator i=boundary_indicators.begin();
        i!=boundary_indicators.end(); ++i)
     Assert ((*i == 0) || (*i == 1),
            ExcInvalidBoundaryIndicator());
@@ -1579,7 +1579,7 @@ template<int dim, int spacedim>
 unsigned int
 DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
 {
-  Assert (boundary_indicators.find(255) == boundary_indicators.end(),
+  Assert (boundary_indicators.find(types::internal_face_boundary_id) == boundary_indicators.end(),
          ExcInvalidBoundaryIndicator());
 
   std::set<int> boundary_dofs;
@@ -1603,9 +1603,9 @@ DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicator
 
 template<int dim, int spacedim>
 unsigned int
-DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
 {
-  Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+  Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
          ExcInvalidBoundaryIndicator());
 
   std::set<int> boundary_dofs;
index 5adc4567168fe81cc03f2f8ad8caec4e4c442fc1..9afc362c00c87dbd33febdbf5d2d5f6c6c11594d 100644 (file)
@@ -472,7 +472,7 @@ namespace DoFTools
     const unsigned int n_dofs = dof.n_dofs();
 
     AssertDimension (dof_to_boundary_mapping.size(), n_dofs);
-    Assert (boundary_indicators.find(255) == boundary_indicators.end(),
+    Assert (boundary_indicators.find(types::internal_face_boundary_id) == boundary_indicators.end(),
            typename DH::ExcInvalidBoundaryIndicator());
     Assert (sparsity.n_rows() == dof.n_boundary_dofs (boundary_indicators),
            ExcDimensionMismatch (sparsity.n_rows(), dof.n_boundary_dofs (boundary_indicators)));
@@ -3732,10 +3732,10 @@ namespace DoFTools
   extract_boundary_dofs (const DH                      &dof_handler,
                         const std::vector<bool>       &component_select,
                         std::vector<bool>             &selected_dofs,
-                        const std::set<unsigned char> &boundary_indicators)
+                        const std::set<types::boundary_id_t> &boundary_indicators)
   {
     AssertDimension (component_select.size(),n_components(dof_handler));
-    Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+    Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
            ExcInvalidBoundaryIndicator());
     const unsigned int dim=DH::dimension;
 
@@ -3856,10 +3856,10 @@ namespace DoFTools
   extract_dofs_with_support_on_boundary (const DH                      &dof_handler,
                                         const std::vector<bool>       &component_select,
                                         std::vector<bool>             &selected_dofs,
-                                        const std::set<unsigned char> &boundary_indicators)
+                                        const std::set<types::boundary_id_t> &boundary_indicators)
   {
     AssertDimension (component_select.size(), n_components(dof_handler));
-    Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+    Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
            ExcInvalidBoundaryIndicator());
 
                                     // let's see whether we have to
@@ -5652,11 +5652,11 @@ namespace DoFTools
   template <class DH>
   void map_dof_to_boundary_indices (
     const DH                      &dof_handler,
-    const std::set<unsigned char> &boundary_indicators,
+    const std::set<types::boundary_id_t> &boundary_indicators,
     std::vector<unsigned int>     &mapping)
   {
     Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
-    Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+    Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
            ExcInvalidBoundaryIndicator());
 
     mapping.clear ();
index af7cdb324f3421c99d34f447b107f812736f045b..cc83666673ff1e6c13352368e51e624aef177a48 100644 (file)
@@ -312,14 +312,14 @@ DoFTools::extract_boundary_dofs<DoFHandler<deal_II_dimension> >
 (const DoFHandler<deal_II_dimension> &,
  const std::vector<bool>                  &,
  std::vector<bool>                        &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
 template
 void
 DoFTools::extract_boundary_dofs<hp::DoFHandler<deal_II_dimension> >
 (const hp::DoFHandler<deal_II_dimension> &,
  const std::vector<bool>                  &,
  std::vector<bool>                        &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
 
 template
 void
@@ -327,14 +327,14 @@ DoFTools::extract_dofs_with_support_on_boundary<DoFHandler<deal_II_dimension> >
 (const DoFHandler<deal_II_dimension> &,
  const std::vector<bool>                  &,
  std::vector<bool>                        &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
 template
 void
 DoFTools::extract_dofs_with_support_on_boundary<hp::DoFHandler<deal_II_dimension> >
 (const hp::DoFHandler<deal_II_dimension> &,
  const std::vector<bool>                  &,
  std::vector<bool>                        &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
 
 template
 void
@@ -453,7 +453,7 @@ DoFTools::extract_boundary_dofs<DoFHandler<deal_II_dimension,deal_II_dimension+1
   (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
    const std::vector<bool>                  &,
    std::vector<bool>                        &,
-   const std::set<unsigned char> &);
+   const std::set<types::boundary_id_t> &);
 template
 unsigned int
 DoFTools::count_dofs_with_subdomain_association<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
@@ -586,7 +586,7 @@ template
 void
 DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension> >
 (const DoFHandler<deal_II_dimension> &,
- const std::set<unsigned char> &,
+ const std::set<types::boundary_id_t> &,
  std::vector<unsigned int> &);
 
 template
@@ -601,7 +601,7 @@ template
 void
 DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension> >
 (const hp::DoFHandler<deal_II_dimension> &,
- const std::set<unsigned char> &,
+ const std::set<types::boundary_id_t> &,
  std::vector<unsigned int> &);
 
 template
@@ -695,7 +695,7 @@ template
 void
 DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
 (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const std::set<unsigned char> &,
+ const std::set<types::boundary_id_t> &,
  std::vector<unsigned int> &);
 
 template
@@ -711,18 +711,18 @@ DoFTools::extract_hanging_node_dofs
 (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_handler,
  std::vector<bool>     &selected_dofs);
 
-// template
-// void
-// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-//  const std::set<unsigned char> &,
-//  std::vector<unsigned int> &);
-
-// template
-// void
-// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-//  std::vector<unsigned int> &);
+ template
+ void
+ DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
+ (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+  const std::set<types::boundary_id_t> &,
+  std::vector<unsigned int> &);
+
+ template
+ void
+ DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
+ (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+  std::vector<unsigned int> &);
 
 #endif
 
index 1e4bd92f11bf658578d78b1e271607735c166c84..73f6e366141b5323309d10813f0722923dfd5440 100644 (file)
@@ -891,7 +891,7 @@ GridGenerator::subdivided_hyper_rectangle (
   Triangulation<1>&                             tria,
   const std::vector< std::vector<double> >&     spacing,
   const Point<1>&                               p,
-  const Table<1,unsigned char>&                 material_id,
+  const Table<1,types::material_id_t>&                 material_id,
   const bool                                    colorize)
 {
                                   // contributed by Yaqi Wang 2006
@@ -920,12 +920,12 @@ GridGenerator::subdivided_hyper_rectangle (
                                    // create the cells
   unsigned int n_val_cells = 0;
   for (unsigned int i=0; i<n_cells; i++)
-    if (material_id[i]!=(unsigned char)(-1)) n_val_cells++;
+    if (material_id[i]!=types::invalid_material_id) n_val_cells++;
 
   std::vector<CellData<1> > cells(n_val_cells);
   unsigned int id = 0;
   for (unsigned int x=0; x<n_cells; ++x)
-    if (material_id[x] != (unsigned char)(-1))
+    if (material_id[x] != types::invalid_material_id)
       {
        cells[id].vertices[0] = x;
        cells[id].vertices[1] = x+1;
@@ -950,7 +950,7 @@ GridGenerator::subdivided_hyper_rectangle (
   Triangulation<2>&                         tria,
   const std::vector< std::vector<double> >&     spacing,
   const Point<2>&                               p,
-  const Table<2,unsigned char>&                 material_id,
+  const Table<2,types::material_id_t>&          material_id,
   const bool                                    colorize)
 {
                                   // contributed by Yaqi Wang 2006
@@ -993,14 +993,14 @@ GridGenerator::subdivided_hyper_rectangle (
   unsigned int n_val_cells = 0;
   for (unsigned int i=0; i<material_id.size(0); i++)
     for (unsigned int j=0; j<material_id.size(1); j++)
-      if (material_id[i][j] != (unsigned char)(-1))
+      if (material_id[i][j] != types::invalid_material_id)
        n_val_cells++;
 
   std::vector<CellData<2> > cells(n_val_cells);
   unsigned int id = 0;
   for (unsigned int y=0; y<repetitions[1]; ++y)
     for (unsigned int x=0; x<repetitions[0]; ++x)
-      if (material_id[x][y]!=(unsigned char)(-1))
+      if (material_id[x][y]!=types::invalid_material_id)
        {
          cells[id].vertices[0] = y*(repetitions[0]+1)+x;
          cells[id].vertices[1] = y*(repetitions[0]+1)+x+1;
@@ -1048,7 +1048,7 @@ GridGenerator::subdivided_hyper_rectangle (
   Triangulation<3>&                           tria,
   const std::vector< std::vector<double> >&     spacing,
   const Point<3>&                             p,
-  const Table<3,unsigned char>&               material_id,
+  const Table<3,types::material_id_t>&               material_id,
   const bool                                    colorize)
 {
                                   // contributed by Yaqi Wang 2006
@@ -1100,7 +1100,7 @@ GridGenerator::subdivided_hyper_rectangle (
   for (unsigned int i=0; i<material_id.size(0); i++)
     for (unsigned int j=0; j<material_id.size(1); j++)
       for (unsigned int k=0; k<material_id.size(2); k++)
-       if (material_id[i][j][k]!=(unsigned char)(-1))
+       if (material_id[i][j][k]!=types::invalid_material_id)
          n_val_cells++;
 
   std::vector<CellData<dim> > cells(n_val_cells);
@@ -1110,7 +1110,7 @@ GridGenerator::subdivided_hyper_rectangle (
   for (unsigned int z=0; z<repetitions[2]; ++z)
     for (unsigned int y=0; y<repetitions[1]; ++y)
       for (unsigned int x=0; x<repetitions[0]; ++x)
-       if (material_id[x][y][z]!=(unsigned char)(-1))
+       if (material_id[x][y][z]!=types::invalid_material_id)
          {
            cells[id].vertices[0] = z*n_xy + y*n_x + x;
            cells[id].vertices[1] = z*n_xy + y*n_x + x+1;
@@ -1382,7 +1382,7 @@ void GridGenerator::enclosed_hyper_cube (Triangulation<2> &tria,
     for (unsigned int i1=0;i1<4;++i1)
       vertices[k++] = Point<2>(coords[i1], coords[i0]);
 
-  const unsigned char materials[9] = { 5, 4, 6,
+  const types::material_id_t materials[9] = { 5, 4, 6,
                                       1, 0, 2,
                                       9, 8,10
   };
@@ -1751,7 +1751,7 @@ GridGenerator::half_hyper_ball (Triangulation<2> &tria,
     {
        for (unsigned int i=0;i<GeometryInfo<2>::faces_per_cell;++i)
        {
-           if (cell->face(i)->boundary_indicator() == 255)
+           if (cell->face(i)->boundary_indicator() == types::internal_face_boundary_id)
                continue;
 
            // If x is zero, then this is part of the plane
@@ -2012,7 +2012,7 @@ void GridGenerator::enclosed_hyper_cube (Triangulation<3> &tria,
       for (unsigned int x=0;x<4;++x)
        vertices[k++] = Point<3>(coords[x], coords[y], coords[z]);
 
-  const unsigned char materials[27] = {
+  const types::material_id_t materials[27] = {
        21,20,22,
        17,16,18,
        25,24,26,
index a371e6aaed9991a6d4ed7196c9cca3056793fbe1..97dba60d067bc69f92e0bb058dbece4fc5a5e13a 100644 (file)
@@ -107,10 +107,13 @@ void GridIn<dim, spacedim>::read_ucd (std::istream &in)
       AssertThrow (in, ExcIO());
 
       std::string cell_type;
-      int material_id;
+
+      // we use an unsigned int because we
+      // fill this variable through an read-in process
+      unsigned int material_id;
 
       in >> dummy          // cell number
-        >> material_id;
+           >> material_id;
       in >> cell_type;
 
       if (((cell_type == "line") && (dim == 1)) ||
@@ -122,7 +125,15 @@ void GridIn<dim, spacedim>::read_ucd (std::istream &in)
          cells.push_back (CellData<dim>());
          for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
            in >> cells.back().vertices[i];
-         cells.back().material_id = material_id;
+
+         // to make sure that the cast wont fail
+    Assert(material_id<= std::numeric_limits<types::material_id_t>::max(),
+        ExcIndexRange(material_id,0,std::numeric_limits<types::material_id_t>::max()));
+    // we use only material_ids in the range from 0 to types::invalid_material_id-1
+    Assert(material_id < types::invalid_material_id,
+        ExcIndexRange(material_id,0,types::invalid_material_id));
+
+         cells.back().material_id = static_cast<types::material_id_t>(material_id);
 
                                           // transform from ucd to
                                           // consecutive numbering
@@ -144,7 +155,16 @@ void GridIn<dim, spacedim>::read_ucd (std::istream &in)
            subcelldata.boundary_lines.push_back (CellData<1>());
            in >> subcelldata.boundary_lines.back().vertices[0]
               >> subcelldata.boundary_lines.back().vertices[1];
-           subcelldata.boundary_lines.back().material_id = material_id;
+
+           // to make sure that the cast wont fail
+           Assert(material_id<= std::numeric_limits<types::boundary_id_t>::max(),
+               ExcIndexRange(material_id,0,std::numeric_limits<types::boundary_id_t>::max()));
+           // we use only boundary_ids in the range from 0 to types::internal_face_boundary_id-1
+           Assert(material_id < types::internal_face_boundary_id,
+               ExcIndexRange(material_id,0,types::internal_face_boundary_id));
+
+           subcelldata.boundary_lines.back().boundary_id
+               = static_cast<types::boundary_id_t>(material_id);
 
                                             // transform from ucd to
                                             // consecutive numbering
@@ -174,7 +194,15 @@ void GridIn<dim, spacedim>::read_ucd (std::istream &in)
                 >> subcelldata.boundary_quads.back().vertices[2]
                 >> subcelldata.boundary_quads.back().vertices[3];
 
-             subcelldata.boundary_quads.back().material_id = material_id;
+             // to make sure that the cast wont fail
+             Assert(material_id<= std::numeric_limits<types::boundary_id_t>::max(),
+                 ExcIndexRange(material_id,0,std::numeric_limits<types::boundary_id_t>::max()));
+             // we use only boundary_ids in the range from 0 to types::internal_face_boundary_id-1
+             Assert(material_id < types::internal_face_boundary_id,
+                 ExcIndexRange(material_id,0,types::internal_face_boundary_id));
+
+             subcelldata.boundary_quads.back().boundary_id
+                 = static_cast<types::boundary_id_t>(material_id);
 
                                               // transform from ucd to
                                               // consecutive numbering
@@ -740,7 +768,15 @@ void GridIn<dim, spacedim>::read_msh (std::istream &in)
          cells.push_back (CellData<dim>());
          for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
            in >> cells.back().vertices[i];
-         cells.back().material_id = material_id;
+
+    // to make sure that the cast wont fail
+    Assert(material_id<= std::numeric_limits<types::material_id_t>::max(),
+        ExcIndexRange(material_id,0,std::numeric_limits<types::material_id_t>::max()));
+    // we use only material_ids in the range from 0 to types::invalid_material_id-1
+    Assert(material_id < types::invalid_material_id,
+        ExcIndexRange(material_id,0,types::invalid_material_id));
+
+         cells.back().material_id = static_cast<types::material_id_t>(material_id);
 
                                           // transform from ucd to
                                           // consecutive numbering
@@ -761,7 +797,16 @@ void GridIn<dim, spacedim>::read_msh (std::istream &in)
            subcelldata.boundary_lines.push_back (CellData<1>());
            in >> subcelldata.boundary_lines.back().vertices[0]
               >> subcelldata.boundary_lines.back().vertices[1];
-           subcelldata.boundary_lines.back().material_id = material_id;
+
+      // to make sure that the cast wont fail
+      Assert(material_id<= std::numeric_limits<types::boundary_id_t>::max(),
+          ExcIndexRange(material_id,0,std::numeric_limits<types::boundary_id_t>::max()));
+      // we use only boundary_ids in the range from 0 to types::internal_face_boundary_id-1
+      Assert(material_id < types::internal_face_boundary_id,
+          ExcIndexRange(material_id,0,types::internal_face_boundary_id));
+
+           subcelldata.boundary_lines.back().boundary_id
+               = static_cast<types::boundary_id_t>(material_id);
 
                                             // transform from ucd to
                                             // consecutive numbering
@@ -791,7 +836,15 @@ void GridIn<dim, spacedim>::read_msh (std::istream &in)
                 >> subcelldata.boundary_quads.back().vertices[2]
                 >> subcelldata.boundary_quads.back().vertices[3];
 
-             subcelldata.boundary_quads.back().material_id = material_id;
+             // to make sure that the cast wont fail
+             Assert(material_id<= std::numeric_limits<types::boundary_id_t>::max(),
+                 ExcIndexRange(material_id,0,std::numeric_limits<types::boundary_id_t>::max()));
+             // we use only boundary_ids in the range from 0 to types::internal_face_boundary_id-1
+             Assert(material_id < types::internal_face_boundary_id,
+                 ExcIndexRange(material_id,0,types::internal_face_boundary_id));
+
+             subcelldata.boundary_quads.back().boundary_id
+                 = static_cast<types::boundary_id_t>(material_id);
 
                                               // transform from gmsh to
                                               // consecutive numbering
@@ -1336,11 +1389,11 @@ void GridIn<3>::read_netcdf (const std::string &filename)
   bmarker_var->get(&*bmarker.begin(), n_bquads);
                                   // we only handle boundary
                                   // indicators that fit into an
-                                  // unsigned char. Also, we don't
-                                  // take 255 as it denotes an
-                                  // internal face
+                                  // types::boundary_id_t. Also, we don't
+                                  // take types::internal_face_boundary_id
+           // as it denotes an internal face
   for (unsigned int i=0; i<bmarker.size(); ++i)
-    Assert(0<=bmarker[i] && bmarker[i]<=254, ExcIO());
+    Assert(0<=bmarker[i] && bmarker[i]<types::internal_face_boundary_id, ExcIO());
 
                                   // finally we setup the boundary
                                   // information
@@ -1351,7 +1404,8 @@ void GridIn<3>::read_netcdf (const std::string &filename)
       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
        subcelldata.boundary_quads[i].vertices[v]=bvertex_indices[
          i*GeometryInfo<dim>::vertices_per_face+v];
-      subcelldata.boundary_quads[i].material_id=bmarker[i];
+      subcelldata.boundary_quads[i].boundary_id
+      = static_cast<types::boundary_id_t>(bmarker[i]);
     }
 
   GridTools::delete_unused_vertices(vertices, cells, subcelldata);
index cbd6f33ea2c3bef3c9e6833eb9d1589c8112874d..215a5e4ad606f745c1ce7bd3594398910055583f 100644 (file)
@@ -1162,8 +1162,8 @@ void GridOut::write_xfig (
          {
            Triangulation<dim>::face_iterator
              face = cell->face(face_reorder[f]);
-           const unsigned char bi = face->boundary_indicator();
-           if (bi != 255)
+           const types::boundary_id_t bi = face->boundary_indicator();
+           if (bi != types::internal_face_boundary_id)
              {
                                                 // Code for polyline
                out << "2 1 "
@@ -2304,7 +2304,7 @@ namespace internal
        if (eps_flags_base.color_lines_level && (line->level > 0))
                                           // lines colored according to
                                           // refinement level,
-                                          // contributed by Jörg
+                                          // contributed by J�rg
                                           // R. Weimar
          out << line->level
              << " l "
index 65218d46f73c9e1872638adf70ee4a2cd2349132..c0046989cccea60aa9aac671e973f08c7da60296 100644 (file)
@@ -1895,7 +1895,7 @@ namespace GridTools
           typename Container<dim,spacedim>::face_iterator>
   extract_boundary_mesh (const Container<dim,spacedim> &volume_mesh,
                         Container<dim-1,spacedim>     &surface_mesh,
-                        const std::set<unsigned char> &boundary_ids)
+                        const std::set<types::boundary_id_t> &boundary_ids)
   {
 // Assumption:
 //    We are relying below on the fact that Triangulation::create_triangulation(...) will keep the order
index 8061610c62df825f62adcf3dd73c10672c94d80f..7f7e2b67df86c023832b275ae4a3f7c54bc1e4b9 100644 (file)
@@ -244,7 +244,7 @@ for (deal_II_dimension : DIMENSIONS)
                 Triangulation<deal_II_dimension>::face_iterator>
       extract_boundary_mesh (const Triangulation<deal_II_dimension> &volume_mesh,
                                        Triangulation<deal_II_dimension-1,deal_II_dimension>  &surface_mesh,
-                                       const std::set<unsigned char> &boundary_ids);
+                                       const std::set<types::boundary_id_t> &boundary_ids);
 #endif
     \}
   }
@@ -259,7 +259,7 @@ for (deal_II_dimension : DIMENSIONS; Container : DOFHANDLER_TEMPLATES)
                 Container<deal_II_dimension>::face_iterator>
       extract_boundary_mesh (const Container<deal_II_dimension> &volume_mesh,
                                        Container<deal_II_dimension-1,deal_II_dimension>  &surface_mesh,
-                                       const std::set<unsigned char> &boundary_ids);
+                                       const std::set<types::boundary_id_t> &boundary_ids);
 #endif
   \}
   }
index e39dc92d7158fe3f310d52eacb30bc5175965de8..f7d2484ba0654c0f69211dd0d5e6ee6c3435ff7b 100644 (file)
@@ -1789,8 +1789,8 @@ namespace internal
                if (n_adj_cells == 1)
                  line->set_boundary_indicator (0);
                else
-                                                  // interior line -> 255
-                 line->set_boundary_indicator (255);
+                                                  // interior line -> types::internal_face_boundary_id
+                 line->set_boundary_indicator (types::internal_face_boundary_id);
              }
 
                                             // set boundary indicators where
@@ -1824,16 +1824,16 @@ namespace internal
                                                 // assert that we only set
                                                 // boundary info once
                AssertThrow (! (line->boundary_indicator() != 0 &&
-                               line->boundary_indicator() != 255),
+                               line->boundary_indicator() != types::internal_face_boundary_id),
                             ExcMultiplySetLineInfoOfLine(line_vertices.first,
                                                          line_vertices.second));
 
                                                 // Assert that only exterior lines
                                                 // are given a boundary indicator
-               AssertThrow (! (line->boundary_indicator() == 255),
+               AssertThrow (! (line->boundary_indicator() == types::internal_face_boundary_id),
                             ExcInteriorLineCantBeBoundary());
 
-               line->set_boundary_indicator (boundary_line->material_id);
+               line->set_boundary_indicator (boundary_line->boundary_id);
              }
 
 
@@ -2509,8 +2509,8 @@ namespace internal
                if (n_adj_cells == 1)
                  quad->set_boundary_indicator (0);
                else
-                                                  // interior quad -> 255
-                 quad->set_boundary_indicator (255);
+                                                  // interior quad -> types::internal_face_boundary_id
+                 quad->set_boundary_indicator (types::internal_face_boundary_id);
              }
 
                                             /////////////////////////////////////////
@@ -2522,7 +2522,7 @@ namespace internal
                                             // as interior
            for (typename Triangulation<dim,spacedim>::line_iterator
                   line=triangulation.begin_line(); line!=triangulation.end_line(); ++line)
-             line->set_boundary_indicator (255);
+             line->set_boundary_indicator (types::internal_face_boundary_id);
                                             // next reset all lines bounding
                                             // boundary quads as on the
                                             // boundary also. note that since
@@ -2590,11 +2590,11 @@ namespace internal
                                                 // different than the
                                                 // previously set value
                if (line->boundary_indicator() != 0)
-                 AssertThrow (line->boundary_indicator() == boundary_line->material_id,
+                 AssertThrow (line->boundary_indicator() == boundary_line->boundary_id,
                               ExcMessage ("Duplicate boundary lines are only allowed "
                                           "if they carry the same boundary indicator."));
 
-               line->set_boundary_indicator (boundary_line->material_id);
+               line->set_boundary_indicator (boundary_line->boundary_id);
              }
 
 
@@ -2722,11 +2722,11 @@ namespace internal
                                                 // different than the
                                                 // previously set value
                if (quad->boundary_indicator() != 0)
-                 AssertThrow (quad->boundary_indicator() == boundary_quad->material_id,
+                 AssertThrow (quad->boundary_indicator() == boundary_quad->boundary_id,
                               ExcMessage ("Duplicate boundary quads are only allowed "
                                           "if they carry the same boundary indicator."));
 
-               quad->set_boundary_indicator (boundary_quad->material_id);
+               quad->set_boundary_indicator (boundary_quad->boundary_id);
              }
 
 
@@ -3561,7 +3561,7 @@ namespace internal
                                   switch_1->line_orientation(1),
                                   switch_1->line_orientation(2),
                                   switch_1->line_orientation(3)};
-                               const unsigned char switch_1_boundary_indicator=switch_1->boundary_indicator();
+                               const types::boundary_id_t switch_1_boundary_indicator=switch_1->boundary_indicator();
                                const unsigned int switch_1_user_index=switch_1->user_index();
                                const bool switch_1_user_flag=switch_1->user_flag_set();
 
@@ -4007,6 +4007,14 @@ namespace internal
                                                     // set or not
                    cell->clear_user_flag();
 
+
+
+                            // An assert to make sure that the
+                            // static_cast in the next line has
+                            // the chance to give reasonable results.
+                   Assert(cell->material_id()<= std::numeric_limits<types::material_id_t>::max(),
+                       ExcIndexRange(cell->material_id(),0,std::numeric_limits<types::material_id_t>::max()));
+
                                                     // new vertex is
                                                     // placed on the
                                                     // surface according
@@ -4014,8 +4022,8 @@ namespace internal
                                                     // stored in the
                                                     // boundary class
                    triangulation.vertices[next_unused_vertex] =
-                     triangulation.boundary[cell->material_id()]
-                     ->get_new_point_on_quad (cell);
+                     triangulation.get_boundary(static_cast<types::boundary_id_t>(cell->material_id()))
+                     .get_new_point_on_quad (cell);
                  }
              }
 
@@ -4109,7 +4117,7 @@ namespace internal
                new_lines[l]->clear_user_data();
                new_lines[l]->clear_children();
                                                 // interior line
-               new_lines[l]->set_boundary_indicator(255);
+               new_lines[l]->set_boundary_indicator(types::internal_face_boundary_id);
              }
 
                                             // Now add the four (two)
@@ -4403,8 +4411,8 @@ namespace internal
                          (cell->vertex(0) + cell->vertex(1)) / 2;
                      else
                        triangulation.vertices[next_unused_vertex] =
-                         triangulation.boundary[cell->material_id()]
-                         ->get_new_point_on_line(cell);
+                         triangulation.get_boundary(static_cast<types::boundary_id_t>(cell->material_id()))
+                         .get_new_point_on_line(cell);
                      triangulation.vertices_used[next_unused_vertex] = true;
 
                                                       // search for next two
@@ -4816,8 +4824,8 @@ namespace internal
                                                           // the two vertices:
                          if (line->at_boundary())
                            triangulation.vertices[next_unused_vertex]
-                             = triangulation.boundary[line->boundary_indicator()]
-                             ->get_new_point_on_line (line);
+                             = triangulation.get_boundary(line->boundary_indicator())
+                             .get_new_point_on_line (line);
                          else
                            triangulation.vertices[next_unused_vertex]
                              = (line->vertex(0) + line->vertex(1)) / 2;
@@ -4828,7 +4836,7 @@ namespace internal
                                                         // boundary object for its
                                                         // answer
                        triangulation.vertices[next_unused_vertex]
-                         = triangulation.boundary[line->user_index()]->get_new_point_on_line (line);
+                         = triangulation.get_boundary(line->user_index()).get_new_point_on_line (line);
 
                                                       // now that we created
                                                       // the right point, make
@@ -5356,7 +5364,7 @@ namespace internal
 
                      if (line->at_boundary())
                        triangulation.vertices[next_unused_vertex]
-                         = triangulation.boundary[line->boundary_indicator()]->get_new_point_on_line (line);
+                         = triangulation.get_boundary(line->boundary_indicator()).get_new_point_on_line (line);
                      else
                        triangulation.vertices[next_unused_vertex]
                          = (line->vertex(0) + line->vertex(1)) / 2;
@@ -5810,7 +5818,7 @@ namespace internal
                                   switch_1->line_orientation(1),
                                   switch_1->line_orientation(2),
                                   switch_1->line_orientation(3)};
-                               const unsigned char switch_1_boundary_indicator=switch_1->boundary_indicator();
+                               const types::boundary_id_t switch_1_boundary_indicator=switch_1->boundary_indicator();
                                const unsigned int switch_1_user_index=switch_1->user_index();
                                const bool switch_1_user_flag=switch_1->user_flag_set();
                                const RefinementCase<dim-1> switch_1_refinement_case=switch_1->refinement_case();
@@ -6011,7 +6019,7 @@ namespace internal
                                                         // appropriately
                        if (quad->at_boundary())
                          triangulation.vertices[next_unused_vertex]
-                           = triangulation.boundary[quad->boundary_indicator()]->get_new_point_on_quad (quad);
+                           = triangulation.get_boundary(quad->boundary_indicator()).get_new_point_on_quad (quad);
                        else
                                                           // it might be that the
                                                           // quad itself is not
@@ -6367,7 +6375,7 @@ namespace internal
                          new_lines[i]->clear_user_data();
                          new_lines[i]->clear_children();
                                                           // interior line
-                         new_lines[i]->set_boundary_indicator(255);
+                         new_lines[i]->set_boundary_indicator(types::internal_face_boundary_id);
                        }
 
                                                       // find some space for the newly to
@@ -6386,7 +6394,7 @@ namespace internal
                          new_quads[i]->clear_user_data();
                          new_quads[i]->clear_children();
                                                           // interior quad
-                         new_quads[i]->set_boundary_indicator (255);
+                         new_quads[i]->set_boundary_indicator (types::internal_face_boundary_id);
                                                           // set all line orientation
                                                           // flags to true by default,
                                                           // change this afterwards, if
@@ -9001,8 +9009,8 @@ namespace internal
                                                             // boundary would be
                                                             // this one.
                            const Point<spacedim> new_bound
-                             = triangulation.boundary[face->boundary_indicator()]
-                             ->get_new_point_on_face (face);
+                             = triangulation.get_boundary(face->boundary_indicator())
+                             .get_new_point_on_face (face);
                                                             // to check it,
                                                             // transform to the
                                                             // unit cell with
@@ -9394,14 +9402,15 @@ Triangulation (const MeshSmoothing smooth_grid,
                check_for_distorted_cells(check_for_distorted_cells),
                vertex_to_boundary_id_map_1d (0)
 {
-                                  // set default boundary for all
-                                  // possible components
-  for (unsigned int i=0;i<255;++i)
-    boundary[i] = &straight_boundary;
+  //Set default value at types::internal_face_boundary_id.
+  //Because this value is reserved for inner faces, we
+  //will never set this one to anything else.
+  //TODO This line vanishes, if we resolve the TODO in the get_boundary function
+  boundary[types::internal_face_boundary_id] = &straight_boundary;
 
   if (dim == 1)
     vertex_to_boundary_id_map_1d
-      = new std::map<unsigned int, unsigned char>();
+      = new std::map<unsigned int, types::boundary_id_t>();
 
   // connect the any_change signal to the other signals
   signals.create.connect (signals.any_change);
@@ -9466,10 +9475,10 @@ Triangulation<dim, spacedim>::set_mesh_smoothing(const MeshSmoothing mesh_smooth
 
 template <int dim, int spacedim>
 void
-Triangulation<dim, spacedim>::set_boundary (const unsigned int number,
+Triangulation<dim, spacedim>::set_boundary (const types::boundary_id_t number,
                                            const Boundary<dim, spacedim>& boundary_object)
 {
-  Assert(number<255, ExcIndexRange(number,0,255));
+  Assert(number < types::internal_face_boundary_id, ExcIndexRange(number,0,types::internal_face_boundary_id));
 
   boundary[number] = &boundary_object;
 }
@@ -9478,25 +9487,50 @@ Triangulation<dim, spacedim>::set_boundary (const unsigned int number,
 
 template <int dim, int spacedim>
 void
-Triangulation<dim, spacedim>::set_boundary (const unsigned int number)
+Triangulation<dim, spacedim>::set_boundary (const types::boundary_id_t number)
 {
-  set_boundary (number, straight_boundary);
+  Assert(number < types::internal_face_boundary_id, ExcIndexRange(number,0,types::internal_face_boundary_id));
+
+  //delete the entry located at number.
+  boundary.erase(number);
 }
 
 
 
 template <int dim, int spacedim>
 const Boundary<dim, spacedim> &
-Triangulation<dim, spacedim>::get_boundary (const unsigned int number) const
+Triangulation<dim, spacedim>::get_boundary (const types::boundary_id_t number) const
 {
-  Assert(number<255, ExcIndexRange(number,0,255));
+  Assert(number<types::internal_face_boundary_id, ExcIndexRange(number,0,types::internal_face_boundary_id));
+
+  //look, if there is a boundary stored at
+  //boundary_id number.
+  typename std::map<types::boundary_id_t, SmartPointer<const Boundary<dim, spacedim>, Triangulation<dim, spacedim> > >::const_iterator it
+  = boundary.find(number);
 
-  return *(boundary[number]);
+  if(it != boundary.end())
+    {
+      //if we have found an entry, return it
+      return *(it->second);
+    }
+  else
+    {
+      //if we have not found an entry
+      //connected with number, we return
+      //straight_boundary, stored at types::internal_face_boundary_id
+      it = boundary.find(types::internal_face_boundary_id);
+
+      return *(it->second);
+     // TODO: This should get returned, atm there are some errors
+     // connected to Boundary<1,3>. If this issue is resolved, the TODOs in
+     // the constructor and clear_despite_subscriptions can also get resolved.
+     //return straight_boundary;
+    }
 }
 
 
 template <int dim, int spacedim>
-std::vector<unsigned char>
+std::vector<types::boundary_id_t>
 Triangulation<dim, spacedim>::get_boundary_indicators () const
 {
                                   // in 1d, we store a map of all used
@@ -9504,8 +9538,8 @@ Triangulation<dim, spacedim>::get_boundary_indicators () const
                                   // purposes
   if (dim == 1)
     {
-      std::vector<unsigned char> boundary_indicators;
-      for (std::map<unsigned int, unsigned char>::const_iterator
+      std::vector<types::boundary_id_t> boundary_indicators;
+      for (std::map<unsigned int, types::boundary_id_t>::const_iterator
             p = vertex_to_boundary_id_map_1d->begin();
           p !=  vertex_to_boundary_id_map_1d->end();
           ++p)
@@ -9515,7 +9549,7 @@ Triangulation<dim, spacedim>::get_boundary_indicators () const
     }
   else
     {
-      std::vector<bool> bi_exists(255, false);
+      std::vector<bool> bi_exists(types::internal_face_boundary_id, false);
       active_cell_iterator cell=begin_active();
       for (; cell!=end(); ++cell)
        for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
@@ -9525,7 +9559,7 @@ Triangulation<dim, spacedim>::get_boundary_indicators () const
       const unsigned int n_bi=
        std::count(bi_exists.begin(), bi_exists.end(), true);
 
-      std::vector<unsigned char> boundary_indicators(n_bi);
+      std::vector<types::boundary_id_t> boundary_indicators(n_bi);
       unsigned int bi_counter=0;
       for (unsigned int i=0; i<bi_exists.size(); ++i)
        if (bi_exists[i]==true)
@@ -9562,8 +9596,11 @@ copy_triangulation (const Triangulation<dim, spacedim> &old_tria)
 
   faces         = new internal::Triangulation::TriaFaces<dim>(*old_tria.faces);
 
-  for (unsigned i=0;i<255;++i)
-    boundary[i] = old_tria.boundary[i];
+  typename std::map<types::boundary_id_t, SmartPointer<const Boundary<dim, spacedim> , Triangulation<dim, spacedim> > >::const_iterator
+      bdry_iterator = old_tria.boundary.begin();
+  for (; bdry_iterator != old_tria.boundary.end() ; bdry_iterator++)
+    boundary[bdry_iterator->first] = bdry_iterator->second;
+
 
   levels.reserve (old_tria.levels.size());
   for (unsigned int level=0; level<old_tria.levels.size(); ++level)
@@ -9577,7 +9614,7 @@ copy_triangulation (const Triangulation<dim, spacedim> &old_tria)
     {
       delete vertex_to_boundary_id_map_1d;
       vertex_to_boundary_id_map_1d
-       = (new std::map<unsigned int, unsigned char>
+       = (new std::map<unsigned int, types::boundary_id_t>
           (*old_tria.vertex_to_boundary_id_map_1d));
     }
 
@@ -12531,8 +12568,10 @@ Triangulation<dim, spacedim>::clear_despite_subscriptions()
   vertices.clear ();
   vertices_used.clear ();
 
-  for (unsigned int i=0; i<255; ++i)
-    boundary[i] = &straight_boundary;
+  boundary.clear();
+  //TODO: This is connected with the TODO in get_boundary and vanishes, if
+  //this TODO has been dealt with.
+  boundary[types::internal_face_boundary_id] = &straight_boundary;
 
   number_cache = internal::Triangulation::NumberCache<dim>();
 }
@@ -14620,7 +14659,7 @@ Triangulation<dim, spacedim>::remove_refinement_listener (RefinementListener &li
 // functions that currently only exist for <1,1> and <1,2>
 template
 const Boundary<1,3> &
-Triangulation<1,3>::get_boundary (const unsigned int number) const;
+Triangulation<1,3>::get_boundary (const types::boundary_id_t number) const;
 
 DEAL_II_NAMESPACE_CLOSE
 
index 367c5dd9ac0afb4ddce6a1d24134729a44d6c44e..49bc93cc0e40a908e4d9ea5ff4c88ccd4e51f3de 100644 (file)
@@ -1235,25 +1235,26 @@ bool CellAccessor<dim, spacedim>::at_boundary () const
 
 
 template <int dim, int spacedim>
-unsigned char CellAccessor<dim, spacedim>::material_id () const
+types::material_id_t CellAccessor<dim, spacedim>::material_id () const
 {
   Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
-  return this->tria->levels[this->present_level]->cells.material_id[this->present_index];
+  return this->tria->levels[this->present_level]->cells.boundary_or_material_id[this->present_index].material_id;
 }
 
 
 
 template <int dim, int spacedim>
-void CellAccessor<dim, spacedim>::set_material_id (const unsigned char mat_id) const
+void CellAccessor<dim, spacedim>::set_material_id (const types::material_id_t mat_id) const
 {
   Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
-  this->tria->levels[this->present_level]->cells.material_id[this->present_index] = mat_id;
+  Assert ( mat_id < types::invalid_material_id, ExcIndexRange(mat_id,0,types::invalid_material_id));
+  this->tria->levels[this->present_level]->cells.boundary_or_material_id[this->present_index].material_id = mat_id;
 }
 
 
 
 template <int dim, int spacedim>
-void CellAccessor<dim, spacedim>::recursively_set_material_id (const unsigned char mat_id) const
+void CellAccessor<dim, spacedim>::recursively_set_material_id (const types::material_id_t mat_id) const
 {
   set_material_id (mat_id);
 
index 6ddced335077d81bfe260c2a6e95b2bdc8c8e02e..f1c8900ac4c1bd0460b527ddaf90e84f69fd948b 100644 (file)
@@ -105,10 +105,10 @@ namespace internal
                           new_size-children.size(),
                           -1);
 
-          material_id.reserve (new_size);
-          material_id.insert (material_id.end(),
-                             new_size-material_id.size(),
-                             255);
+          boundary_or_material_id.reserve (new_size);
+          boundary_or_material_id.insert (boundary_or_material_id.end(),
+                             new_size-boundary_or_material_id.size(),
+                             BoundaryOrMaterialId());
 
           user_data.reserve (new_size);
           user_data.insert (user_data.end(),
@@ -307,10 +307,10 @@ namespace internal
                               RefinementCase<2>::no_refinement);
 
 
-          material_id.reserve (new_size);
-          material_id.insert (material_id.end(),
-                             new_size-material_id.size(),
-                             255);
+          boundary_or_material_id.reserve (new_size);
+          boundary_or_material_id.insert (boundary_or_material_id.end(),
+                             new_size-boundary_or_material_id.size(),
+                             BoundaryOrMaterialId());
 
           user_data.reserve (new_size);
           user_data.insert (user_data.end(),
@@ -490,10 +490,10 @@ namespace internal
                           4*new_size-children.size(),
                           -1);
 
-          material_id.reserve (new_size);
-          material_id.insert (material_id.end(),
-                             new_size-material_id.size(),
-                             255);
+          boundary_or_material_id.reserve (new_size);
+          boundary_or_material_id.insert (boundary_or_material_id.end(),
+                             new_size-boundary_or_material_id.size(),
+                             BoundaryOrMaterialId());
 
           user_data.reserve (new_size);
           user_data.insert (user_data.end(),
@@ -633,8 +633,8 @@ namespace internal
               ExcMemoryInexact (cells.size(), user_flags.size()));
       Assert (cells.size() == children.size(),
               ExcMemoryInexact (cells.size(), children.size()));
-      Assert (cells.size() == material_id.size(),
-              ExcMemoryInexact (cells.size(), material_id.size()));
+      Assert (cells.size() == boundary_or_material_id.size(),
+              ExcMemoryInexact (cells.size(), boundary_or_material_id.size()));
       Assert (cells.size() == user_data.size(),
               ExcMemoryInexact (cells.size(), user_data.size()));
     }
@@ -675,8 +675,8 @@ namespace internal
               ExcMemoryInexact (cells.size(), children.size()));
       Assert (cells.size() == refinement_cases.size(),
               ExcMemoryInexact (cells.size(), refinement_cases.size()));
-      Assert (cells.size() == material_id.size(),
-              ExcMemoryInexact (cells.size(), material_id.size()));
+      Assert (cells.size() == boundary_or_material_id.size(),
+              ExcMemoryInexact (cells.size(), boundary_or_material_id.size()));
       Assert (cells.size() == user_data.size(),
               ExcMemoryInexact (cells.size(), user_data.size()));
     }
@@ -714,8 +714,8 @@ namespace internal
               ExcMemoryInexact (cells.size(), user_flags.size()));
       Assert (4*cells.size() == children.size(),
               ExcMemoryInexact (cells.size(), children.size()));
-      Assert (cells.size() == material_id.size(),
-              ExcMemoryInexact (cells.size(), material_id.size()));
+      Assert (cells.size() == boundary_or_material_id.size(),
+              ExcMemoryInexact (cells.size(), boundary_or_material_id.size()));
       Assert (cells.size() == user_data.size(),
               ExcMemoryInexact (cells.size(), user_data.size()));
       Assert (cells.size() * GeometryInfo<3>::faces_per_cell
@@ -761,7 +761,7 @@ namespace internal
       refinement_cases.clear();
       used.clear();
       user_flags.clear();
-      material_id.clear();
+      boundary_or_material_id.clear();
       user_data.clear();
       user_data_type = data_unknown;
     }
@@ -793,7 +793,7 @@ namespace internal
               MemoryConsumption::memory_consumption (children) +
               MemoryConsumption::memory_consumption (used) +
               MemoryConsumption::memory_consumption (user_flags) +
-              MemoryConsumption::memory_consumption (material_id) +
+              MemoryConsumption::memory_consumption (boundary_or_material_id) +
               MemoryConsumption::memory_consumption (refinement_cases) +
              user_data.capacity() * sizeof(UserData) + sizeof(user_data));
     }
index 4526e71623d61695ca39da150f52969202f73cd1..f1c819d171436c9919df1ae9c0b51424a9297826 100644 (file)
@@ -2745,14 +2745,14 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+  unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
 
                                      // check that only boundary
                                      // indicators 0 and 1 are allowed
                                      // in 1d
-    for (std::set<unsigned char>::const_iterator i=boundary_indicators.begin();
+    for (std::set<types::boundary_id_t>::const_iterator i=boundary_indicators.begin();
          i!=boundary_indicators.end(); ++i)
       Assert ((*i == 0) || (*i == 1),
               ExcInvalidBoundaryIndicator());
@@ -2797,7 +2797,7 @@ namespace hp
   }
 
   template <>
-  unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<unsigned char> &) const
+  unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id_t> &) const
   {
     Assert(false,ExcNotImplemented());
     return 0;
@@ -2848,7 +2848,7 @@ namespace hp
   DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
-    Assert (boundary_indicators.find(255) == boundary_indicators.end(),
+    Assert (boundary_indicators.find(types::internal_face_boundary_id) == boundary_indicators.end(),
             ExcInvalidBoundaryIndicator());
 
                                      // same as above, but with
@@ -2881,10 +2881,10 @@ namespace hp
 
   template<int dim, int spacedim>
   unsigned int
-  DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
+  DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id_t> &boundary_indicators) const
   {
     Assert (finite_elements != 0, ExcNoFESelected());
-    Assert (boundary_indicators.find (255) == boundary_indicators.end(),
+    Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
             ExcInvalidBoundaryIndicator());
 
                                      // same as above, but with
@@ -2933,7 +2933,7 @@ namespace hp
 
 
   template <>
-  unsigned int DoFHandler<2,3>::n_boundary_dofs (const std::set<unsigned char> &) const
+  unsigned int DoFHandler<2,3>::n_boundary_dofs (const std::set<types::boundary_id_t> &) const
   {
     Assert(false,ExcNotImplemented());
     return 0;
index dea49b746398d108dae5617d3e7c17085ad4a852..ba15d25fdecded0a406fe632330071931a858478 100644 (file)
@@ -1204,7 +1204,7 @@ namespace MGTools
                {
                  const typename MGDoFHandler<dim,spacedim>::face_iterator
                    face = cell->face(face_no);
-                 const unsigned char bi = face->boundary_indicator();
+                 const types::boundary_id_t bi = face->boundary_indicator();
                                                   // Face is listed in
                                                   // boundary map
                  if (function_map.find(bi) != function_map.end())
@@ -1259,7 +1259,7 @@ namespace MGTools
                }
 
              typename MGDoFHandler<dim,spacedim>::face_iterator face = cell->face(face_no);
-             const unsigned char boundary_component = face->boundary_indicator();
+             const types::boundary_id_t boundary_component = face->boundary_indicator();
              if (function_map.find(boundary_component) != function_map.end())
                                                 // face is of the right component
                {
index 041f58b0907999038d14e123a551cee580e655d6..a4fba0a95261ed20131822bce073e9313aef3084 100644 (file)
@@ -233,7 +233,7 @@ namespace internal
                                          * The material id we are to care
                                          * for.
                                          */
-       const unsigned int material_id;
+       const types::material_id_t material_id;
 
                                         /**
                                          * Some more references to input data to
@@ -254,7 +254,7 @@ namespace internal
                      const bool         need_quadrature_points,
                      const unsigned int n_solution_vectors,
                      const types::subdomain_id_t subdomain_id,
-                     const unsigned int material_id,
+                     const types::material_id_t material_id,
                      const typename FunctionMap<spacedim>::type *neumann_bc,
                      const std::vector<bool>                component_mask,
                      const Function<spacedim>                   *coefficients);
@@ -278,7 +278,7 @@ namespace internal
                  const bool     need_quadrature_points,
                  const unsigned int n_solution_vectors,
                  const types::subdomain_id_t subdomain_id,
-                 const unsigned int material_id,
+                 const types::material_id_t material_id,
                  const typename FunctionMap<spacedim>::type *neumann_bc,
                  const std::vector<bool>                component_mask,
                  const Function<spacedim>         *coefficients)
@@ -547,7 +547,7 @@ namespace internal
                                         // difference between normal
                                         // derivative and boundary function
        {
-         const unsigned char boundary_indicator = face->boundary_indicator();
+         const types::boundary_id_t boundary_indicator = face->boundary_indicator();
 
          Assert (parallel_data.neumann_bc->find(boundary_indicator) !=
                  parallel_data.neumann_bc->end(),
@@ -907,7 +907,7 @@ namespace internal
                    ||
                    (cell->subdomain_id() == subdomain_id))
                   &&
-                  ((material_id == numbers::invalid_unsigned_int)
+                  ((material_id == types::invalid_material_id)
                    ||
                    (cell->material_id() == material_id))) )
            {
@@ -927,7 +927,7 @@ namespace internal
                                 &&
                                 ((cell->neighbor(face_no)->material_id()
                                   == material_id) ||
-                                 (material_id == numbers::invalid_unsigned_int));
+                                 (material_id == types::invalid_material_id));
              else
                {
                  for (unsigned int sf=0; sf<face->n_children(); ++sf)
@@ -935,7 +935,7 @@ namespace internal
                          ->subdomain_id() == subdomain_id)
                         &&
                         (material_id ==
-                         numbers::invalid_unsigned_int))
+                         types::invalid_material_id))
                        ||
                        ((cell->neighbor_child_on_subface(face_no,sf)
                          ->material_id() == material_id)
@@ -1017,7 +1017,7 @@ estimate (const Mapping<1,spacedim>      &mapping,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
                                   // just pass on to the other function
   const std::vector<const InputVector *> solutions (1, &solution);
@@ -1041,7 +1041,7 @@ estimate (const DH   &dof_handler,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
   estimate(StaticMappingQ1<1,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
@@ -1063,7 +1063,7 @@ estimate (const DH   &dof_handler,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
   estimate(StaticMappingQ1<1,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
@@ -1086,7 +1086,7 @@ estimate (const Mapping<1,spacedim>      &mapping,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
                                   // just pass on to the other function
   const std::vector<const InputVector *> solutions (1, &solution);
@@ -1109,7 +1109,7 @@ estimate (const DH   &dof_handler,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
   estimate(StaticMappingQ1<1,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
@@ -1131,7 +1131,7 @@ estimate (const DH   &dof_handler,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
   estimate(StaticMappingQ1<1,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
@@ -1154,7 +1154,7 @@ estimate (const Mapping<1,spacedim>                    &/*mapping*/,
           const Function<spacedim>                   */*coefficient*/,
           const unsigned int,
           const types::subdomain_id_t          /*subdomain_id*/,
-          const unsigned int                   /*material_id*/)
+          const types::material_id_t                   /*material_id*/)
 {
   Assert (false, ExcInternalError());
 }
@@ -1174,7 +1174,7 @@ estimate (const Mapping<1,spacedim>                    &mapping,
           const Function<spacedim>                   *coefficient,
           const unsigned int,
           const types::subdomain_id_t         subdomain_id_,
-          const unsigned int                  material_id)
+          const types::material_id_t                  material_id)
 {
 #ifdef DEAL_II_USE_P4EST
   if (dynamic_cast<const parallel::distributed::Triangulation<1,spacedim>*>
@@ -1207,7 +1207,7 @@ estimate (const Mapping<1,spacedim>                    &mapping,
   const unsigned int n_solution_vectors = solutions.size();
 
                                   // sanity checks
-  Assert (neumann_bc.find(255) == neumann_bc.end(),
+  Assert (neumann_bc.find(types::internal_face_boundary_id) == neumann_bc.end(),
          ExcInvalidBoundaryIndicator());
 
   for (typename FunctionMap<spacedim>::type::const_iterator i=neumann_bc.begin();
@@ -1305,7 +1305,7 @@ estimate (const Mapping<1,spacedim>                    &mapping,
          ||
          (cell->subdomain_id() == subdomain_id))
         &&
-        ((material_id == numbers::invalid_unsigned_int)
+        ((material_id == types::invalid_material_id)
          ||
          (cell->material_id() == material_id)))
       {
@@ -1444,7 +1444,7 @@ estimate (const Mapping<dim, spacedim>      &mapping,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
                                   // just pass on to the other function
   const std::vector<const InputVector *> solutions (1, &solution);
@@ -1467,7 +1467,7 @@ estimate (const DH                &dof_handler,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
   estimate(StaticMappingQ1<dim,spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
@@ -1490,7 +1490,7 @@ estimate (const Mapping<dim, spacedim>      &mapping,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
                                   // just pass on to the other function
   const std::vector<const InputVector *> solutions (1, &solution);
@@ -1513,7 +1513,7 @@ estimate (const DH                &dof_handler,
           const Function<spacedim>     *coefficients,
           const unsigned int       n_threads,
           const types::subdomain_id_t subdomain_id,
-          const unsigned int       material_id)
+          const types::material_id_t       material_id)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
   estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solution,
@@ -1538,7 +1538,7 @@ estimate (const Mapping<dim, spacedim>                  &mapping,
           const Function<spacedim>                 *coefficients,
           const unsigned int                   ,
           const types::subdomain_id_t          subdomain_id_,
-          const unsigned int                   material_id)
+          const types::material_id_t                   material_id)
 {
 #ifdef DEAL_II_USE_P4EST
   if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
@@ -1668,7 +1668,7 @@ estimate (const Mapping<dim, spacedim>                  &mapping,
           ||
           (cell->subdomain_id() == subdomain_id))
          &&
-         ((material_id == numbers::invalid_unsigned_int)
+         ((material_id == types::invalid_material_id)
           ||
           (cell->material_id() == material_id)))
       {
@@ -1715,7 +1715,7 @@ estimate (const Mapping<dim, spacedim>                  &mapping,
           const Function<spacedim>                 *coefficients,
           const unsigned int                   n_threads,
           const types::subdomain_id_t          subdomain_id,
-          const unsigned int                   material_id)
+          const types::material_id_t                   material_id)
 {
                                   // forward to the function with the QCollection
   estimate (mapping, dof_handler,
@@ -1737,7 +1737,7 @@ void KellyErrorEstimator<dim, spacedim>::estimate (const DH
                                         const Function<spacedim>                 *coefficients,
                                         const unsigned int                   n_threads,
                                          const types::subdomain_id_t subdomain_id,
-                                         const unsigned int       material_id)
+                                         const types::material_id_t       material_id)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
   estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
@@ -1758,7 +1758,7 @@ void KellyErrorEstimator<dim, spacedim>::estimate (const DH
                                         const Function<spacedim>                 *coefficients,
                                         const unsigned int                   n_threads,
                                          const types::subdomain_id_t subdomain_id,
-                                         const unsigned int       material_id)
+                                         const types::material_id_t       material_id)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
   estimate(StaticMappingQ1<dim, spacedim>::mapping, dof_handler, quadrature, neumann_bc, solutions,
index fcb724d93bccfc831b255499e06f1ea583aa4126..3512bd02e615b87a33dd970163fcc46369a0e354 100644 (file)
@@ -39,7 +39,7 @@ estimate<InputVector,DH<deal_II_dimension> > (const Mapping<deal_II_dimension, d
           const Function<deal_II_dimension>     *,    \
           const unsigned int       , \
           const unsigned int       , \
-          const unsigned int);    \
+          const types::material_id_t);    \
     \
 template    \
 void    \
@@ -53,7 +53,7 @@ estimate<InputVector,DH<deal_II_dimension> > (const DH<deal_II_dimension>   &,
           const Function<deal_II_dimension>     *,    \
           const unsigned int       , \
           const unsigned int       , \
-          const unsigned int);    \
+          const types::material_id_t);    \
         \
 template    \
 void    \
@@ -68,7 +68,7 @@ estimate<InputVector,DH<deal_II_dimension> > (const Mapping<deal_II_dimension, d
           const Function<deal_II_dimension>         *,    \
           const unsigned int           , \
           const unsigned int           , \
-          const unsigned int);    \
+          const types::material_id_t);    \
     \
 template    \
 void    \
@@ -82,7 +82,7 @@ estimate<InputVector,DH<deal_II_dimension> > (const DH<deal_II_dimension>
           const Function<deal_II_dimension>         *,    \
           const unsigned int           , \
           const unsigned int           , \
-         const unsigned int);\
+         const types::material_id_t);\
  
 #if deal_II_dimension == 2 || deal_II_dimension == 1
 
@@ -100,7 +100,7 @@ estimate<InputVector,DH<deal_II_dimension,deal_II_dimension+1> > (const Mapping<
           const Function<deal_II_dimension+1>     *,    \
           const unsigned int       , \
           const unsigned int       , \
-          const unsigned int);    \
+          const types::material_id_t);    \
     \
 template    \
 void    \
@@ -114,7 +114,7 @@ estimate<InputVector,DH<deal_II_dimension,deal_II_dimension+1> > (const DH<deal_
           const Function<deal_II_dimension+1>     *,    \
           const unsigned int       , \
           const unsigned int       , \
-          const unsigned int);    \
+          const types::material_id_t);    \
         \
 template    \
 void    \
@@ -129,7 +129,7 @@ estimate<InputVector,DH<deal_II_dimension,deal_II_dimension+1> > (const Mapping<
           const Function<deal_II_dimension+1>         *,    \
           const unsigned int           , \
           const unsigned int           , \
-          const unsigned int);    \
+          const types::material_id_t);    \
     \
 template    \
 void    \
@@ -143,7 +143,7 @@ estimate<InputVector,DH<deal_II_dimension,deal_II_dimension+1> > (const DH<deal_
           const Function<deal_II_dimension+1>         *,    \
           const unsigned int           , \
           const unsigned int           , \
-          const unsigned int);\
+          const types::material_id_t);\
 
 #else
 #define INSTANTIATE_CODIM(InputVector,DH,Q)
index ad50778264dc85bf867af74038b1fe5c168e7293..23479924be86787d42dc3ec905471ff682371cec 100644 (file)
@@ -428,7 +428,7 @@ create_boundary_right_hand_side<deal_II_dimension>
  const Quadrature<deal_II_dimension-1> &,
  const Function<deal_II_dimension>   &,
  Vector<double>                      &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
 #endif
 
 template
@@ -438,7 +438,7 @@ create_boundary_right_hand_side<deal_II_dimension>
  const Quadrature<deal_II_dimension-1> &,
  const Function<deal_II_dimension>   &,
  Vector<double>                      &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
 
 #if deal_II_dimension > 1
 template
@@ -449,7 +449,7 @@ create_boundary_right_hand_side<deal_II_dimension>
  const hp::QCollection<deal_II_dimension-1> &,
  const Function<deal_II_dimension>   &,
  Vector<double>                      &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
 #endif
 
 template
@@ -459,12 +459,12 @@ create_boundary_right_hand_side<deal_II_dimension>
  const hp::QCollection<deal_II_dimension-1> &,
  const Function<deal_II_dimension>   &,
  Vector<double>                      &,
- const std::set<unsigned char> &);
+ const std::set<types::boundary_id_t> &);
 
 template
 void interpolate_boundary_values (
   const DoFHandler<deal_II_dimension> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension>   &,
   std::map<unsigned int,double>       &,
   const std::vector<bool>    &);
@@ -472,7 +472,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const hp::DoFHandler<deal_II_dimension> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension>   &,
   std::map<unsigned int,double>       &,
   const std::vector<bool>    &);
@@ -480,7 +480,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const MGDoFHandler<deal_II_dimension> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension>   &,
   std::map<unsigned int,double>       &,
   const std::vector<bool>    &);
@@ -488,7 +488,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const DoFHandler<deal_II_dimension> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension>   &,
   ConstraintMatrix                    &,
   const std::vector<bool>    &);
@@ -496,7 +496,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const hp::DoFHandler<deal_II_dimension> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension>   &,
   ConstraintMatrix                    &,
   const std::vector<bool>    &);
@@ -504,7 +504,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const MGDoFHandler<deal_II_dimension> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension>   &,
   ConstraintMatrix                    &,
   const std::vector<bool>    &);
@@ -558,7 +558,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension+1>   &,
   std::map<unsigned int,double>       &,
   const std::vector<bool>    &);
@@ -566,7 +566,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension+1>   &,
   std::map<unsigned int,double>       &,
   const std::vector<bool>    &);
@@ -574,7 +574,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension+1>   &,
   std::map<unsigned int,double>       &,
   const std::vector<bool>    &);
@@ -582,7 +582,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension+1>   &,
   ConstraintMatrix                    &,
   const std::vector<bool>    &);
@@ -590,7 +590,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension+1>   &,
   ConstraintMatrix                    &,
   const std::vector<bool>    &);
@@ -598,7 +598,7 @@ void interpolate_boundary_values (
 template
 void interpolate_boundary_values (
   const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-  const unsigned char,
+  const types::boundary_id_t,
   const Function<deal_II_dimension+1>   &,
   ConstraintMatrix                    &,
   const std::vector<bool>    &);
@@ -689,7 +689,7 @@ void project_boundary_values_curl_conforming<deal_II_dimension>
 (const DoFHandler<deal_II_dimension>&,
  const unsigned int,
  const Function<deal_II_dimension>&,
- const unsigned char,
+ const types::boundary_id_t,
  ConstraintMatrix&,
  const Mapping<deal_II_dimension>&);
 template
@@ -697,7 +697,7 @@ void project_boundary_values_curl_conforming<deal_II_dimension>
 (const hp::DoFHandler<deal_II_dimension>&,
  const unsigned int,
  const Function<deal_II_dimension>&,
- const unsigned char,
+ const types::boundary_id_t,
  ConstraintMatrix&,
  const hp::MappingCollection<deal_II_dimension>&);
 template
@@ -705,7 +705,7 @@ void project_boundary_values_div_conforming<deal_II_dimension>
 (const DoFHandler<deal_II_dimension>&,
  const unsigned int,
  const Function<deal_II_dimension>&,
- const unsigned char,
+ const types::boundary_id_t,
  ConstraintMatrix&,
  const Mapping<deal_II_dimension>&);
 template
@@ -713,21 +713,21 @@ void project_boundary_values_div_conforming<deal_II_dimension>
 (const hp::DoFHandler<deal_II_dimension>&,
  const unsigned int,
  const Function<deal_II_dimension>&,
- const unsigned char,
+ const types::boundary_id_t,
  ConstraintMatrix&,
  const hp::MappingCollection<deal_II_dimension>&);
 template
 void
 compute_no_normal_flux_constraints (const DoFHandler<deal_II_dimension> &dof_handler,
                                                 const unsigned int     first_vector_component,
-                                                const std::set<unsigned char> &boundary_ids,
+                                                const std::set<types::boundary_id_t> &boundary_ids,
                                                 ConstraintMatrix      &constraints,
                                                 const Mapping<deal_II_dimension>    &mapping);
 template
 void
 compute_no_normal_flux_constraints (const hp::DoFHandler<deal_II_dimension> &dof_handler,
                                                 const unsigned int     first_vector_component,
-                                                const std::set<unsigned char> &boundary_ids,
+                                                const std::set<types::boundary_id_t> &boundary_ids,
                                                 ConstraintMatrix      &constraints,
                                                 const Mapping<deal_II_dimension>    &mapping);
 #endif
@@ -762,7 +762,7 @@ template
 void interpolate_boundary_values
 (const Mapping<deal_II_dimension>    &,
  const DoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
  const Function<deal_II_dimension>   &,
  std::map<unsigned int,double>       &,
  const std::vector<bool>    &);
@@ -771,7 +771,7 @@ template
 void interpolate_boundary_values
 (const Mapping<deal_II_dimension>    &,
  const hp::DoFHandler<deal_II_dimension> &,
- const unsigned char,
+ const types::boundary_id_t,
  const Function<deal_II_dimension>   &,
  ConstraintMatrix       &,
  const std::vector<bool>    &);
@@ -789,7 +789,7 @@ template
 void interpolate_boundary_values
 (const Mapping<deal_II_dimension,deal_II_dimension+1>    &,
  const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
+ const types::boundary_id_t,
  const Function<deal_II_dimension+1>   &,
  std::map<unsigned int,double>       &,
  const std::vector<bool>    &);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.