]> https://gitweb.dealii.org/ - dealii.git/commitdiff
default constructor for DoFHandler
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 16 Aug 2010 12:20:15 +0000 (12:20 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 16 Aug 2010 12:20:15 +0000 (12:20 +0000)
git-svn-id: https://svn.dealii.org/trunk@21666 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_handler.h
deal.II/deal.II/source/dofs/dof_handler.cc
deal.II/deal.II/source/multigrid/mg_dof_handler.cc
deal.II/doc/news/changes.h

index 279fbe5fa5a0445cb246651601459a9f27168b2e..81f4992d79111e58a4a7a4891e0958f3b4288a26 100644 (file)
@@ -208,17 +208,37 @@ class DoFHandler  :  public Subscriptor
                                      * value.
                                      */
     static const unsigned int default_fe_index = 0;
+    
+                                    /**
+                                     * Standard constructor, not
+                                     * initializing any data. After
+                                     * constructing an object with
+                                     * this constructor, use
+                                     * initialize() to make a valid
+                                     * DoFHandler.
+                                     */
+    DoFHandler ();
 
                                     /**
                                      * Constructor. Take @p tria as the
                                      * triangulation to work on.
                                      */
     DoFHandler ( const Triangulation<dim,spacedim> &tria);
-
+    
                                     /**
                                      * Destructor.
                                      */
     virtual ~DoFHandler ();
+    
+                                    /**
+                                     * Assign a Triangulation and a
+                                     * FiniteElement to the
+                                     * DoFHandler and compute the
+                                     * distribution of degrees of
+                                     * freedom over the mesh.
+                                     */
+    void initialize(const Triangulation<dim,spacedim>& tria,
+                   const FiniteElement<dim,spacedim>& fe);
 
                                     /**
                                      * Go through the triangulation and
@@ -1007,15 +1027,7 @@ class DoFHandler  :  public Subscriptor
                                      * Exception
                                      */
     DeclException0 (ExcInvalidTriangulation);
-                                    /**
-                                     * No finite element has been
-                                     * assigned to this
-                                     * DoFHandler. Call the function
-                                     * DoFHandler::distribute_dofs()
-                                     * before you attemped to do what
-                                     * raised this exception.
-                                     */
-    DeclException0 (ExcNoFESelected);
+    
                                     /**
                                      * @todo Replace by ExcInternalError.
                                      */
@@ -1060,8 +1072,16 @@ class DoFHandler  :  public Subscriptor
                    int,
                    << "You tried to do something on level " << arg1
                    << ", but this level is empty.");
-
+    
+    
   protected:
+                                    /**
+                                     * The object containing
+                                     * information on the block structure.
+                                     */
+    BlockInfo block_info_object;
+    
+  private:
 
                                     /**
                                      * Address of the triangulation to
@@ -1082,9 +1102,6 @@ class DoFHandler  :  public Subscriptor
                                      * this object as well, though).
                                      */
     SmartPointer<const FiniteElement<dim,spacedim>,DoFHandler<dim,spacedim> > selected_fe;
-    
-    BlockInfo block_info_object;
-  private:
 
                                     /**
                                      * Copy constructor. I can see no reason
@@ -1186,7 +1203,7 @@ inline
 const FiniteElement<dim,spacedim> &
 DoFHandler<dim,spacedim>::get_fe () const
 {
-  Assert(selected_fe!=0, ExcNoFESelected());
+  Assert(selected_fe!=0, ExcNotInitialized());
   return *selected_fe;
 }
 
@@ -1196,6 +1213,7 @@ inline
 const Triangulation<dim,spacedim> &
 DoFHandler<dim,spacedim>::get_tria () const
 {
+  Assert(tria != 0, ExcNotInitialized());
   return *tria;
 }
 
index 9c2758fd9b07fa289411ab43c318c0013895a1c3..3a0757a1cccebc41ac799748354a9bb605d66fa4 100644 (file)
@@ -697,6 +697,16 @@ DoFHandler<dim,spacedim>::DoFHandler (const Triangulation<dim,spacedim> &tria)
 {}
 
 
+template<int dim, int spacedim>
+DoFHandler<dim,spacedim>::DoFHandler ()
+               :
+               tria(0, typeid(*this).name()),
+               selected_fe(0, typeid(*this).name()),
+               faces(NULL),
+               used_dofs (0)
+{}
+
+
 template <int dim, int spacedim>
 DoFHandler<dim,spacedim>::~DoFHandler ()
 {
@@ -705,6 +715,19 @@ DoFHandler<dim,spacedim>::~DoFHandler ()
 }
 
 
+template<int dim, int spacedim>
+void
+DoFHandler<dim,spacedim>::initialize(
+  const Triangulation<dim,spacedim>& t,
+  const FiniteElement<dim,spacedim>& fe)
+{
+  tria = &t;
+  faces = NULL;
+  used_dofs = 0;
+  distribute_dofs(fe);
+}
+
+
 /*------------------------ Cell iterator functions ------------------------*/
 
 
@@ -911,6 +934,7 @@ template <int dim, int spacedim>
 typename DoFHandler<dim, spacedim>::raw_cell_iterator
 DoFHandler<dim, spacedim>::end_raw (const unsigned int level) const
 {
+  Assert(tria != 0, ExcNotInitialized());
   return (level == tria->n_levels()-1 ?
          end() :
          begin_raw (level+1));
@@ -921,6 +945,7 @@ template <int dim, int spacedim>
 typename DoFHandler<dim, spacedim>::cell_iterator
 DoFHandler<dim, spacedim>::end (const unsigned int level) const
 {
+  Assert(tria != 0, ExcNotInitialized());
   return (level == tria->n_levels()-1 ?
          cell_iterator(end()) :
          begin (level+1));
@@ -931,6 +956,7 @@ template <int dim, int spacedim>
 typename DoFHandler<dim, spacedim>::active_cell_iterator
 DoFHandler<dim, spacedim>::end_active (const unsigned int level) const
 {
+  Assert(tria != 0, ExcNotInitialized());
   return (level == tria->n_levels()-1 ?
          active_cell_iterator(end()) :
          begin_active (level+1));
@@ -1114,6 +1140,7 @@ template <int dim, int spacedim>
 typename DoFHandler<dim, spacedim>::raw_line_iterator
 DoFHandler<dim, spacedim>::begin_raw_line (const unsigned int level) const
 {
+  Assert(tria != 0, ExcNotInitialized());
   switch (dim)
     {
       case 1:
@@ -1185,6 +1212,7 @@ template <int dim, int spacedim>
 typename DoFHandler<dim, spacedim>::raw_line_iterator
 DoFHandler<dim, spacedim>::last_raw_line (const unsigned int level) const
 {
+  Assert(tria != 0, ExcNotInitialized());
   switch (dim)
     {
       case 1:
@@ -1450,6 +1478,7 @@ template <int dim, int spacedim>
 typename DoFHandler<dim,spacedim>::raw_quad_iterator
 DoFHandler<dim,spacedim>::last_raw_quad (const unsigned int level) const
 {
+  Assert(tria != 0, ExcNotInitialized());
   switch (dim)
     {
       case 1:
@@ -1752,8 +1781,7 @@ DoFHandler<dim, spacedim>::last_active_hex () const
 template <>
 unsigned int DoFHandler<1>::n_boundary_dofs () const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-  return 2*selected_fe->dofs_per_vertex;
+  return 2*get_fe().dofs_per_vertex;
 }
 
 
@@ -1761,8 +1789,6 @@ unsigned int DoFHandler<1>::n_boundary_dofs () const
 template <>
 unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-
                                   // check that only boundary
                                   // indicators 0 and 1 are allowed
                                   // in 1d
@@ -1771,7 +1797,7 @@ unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicat
     Assert ((i->first == 0) || (i->first == 1),
            ExcInvalidBoundaryIndicator());
 
-  return boundary_indicators.size()*selected_fe->dofs_per_vertex;
+  return boundary_indicators.size()*get_fe().dofs_per_vertex;
 }
 
 
@@ -1779,8 +1805,6 @@ 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
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-
                                   // check that only boundary
                                   // indicators 0 and 1 are allowed
                                   // in 1d
@@ -1789,15 +1813,14 @@ unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &boun
     Assert ((*i == 0) || (*i == 1),
            ExcInvalidBoundaryIndicator());
 
-  return boundary_indicators.size()*selected_fe->dofs_per_vertex;
+  return boundary_indicators.size()*get_fe().dofs_per_vertex;
 }
 
 
 template <>
 unsigned int DoFHandler<1,2>::n_boundary_dofs () const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-  return 2*selected_fe->dofs_per_vertex;
+  return 2*get_fe().dofs_per_vertex;
 }
 
 
@@ -1805,8 +1828,6 @@ unsigned int DoFHandler<1,2>::n_boundary_dofs () const
 template <>
 unsigned int DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-
                                   // check that only boundary
                                   // indicators 0 and 1 are allowed
                                   // in 1d
@@ -1815,7 +1836,7 @@ unsigned int DoFHandler<1,2>::n_boundary_dofs (const FunctionMap &boundary_indic
     Assert ((i->first == 0) || (i->first == 1),
            ExcInvalidBoundaryIndicator());
 
-  return boundary_indicators.size()*selected_fe->dofs_per_vertex;
+  return boundary_indicators.size()*get_fe().dofs_per_vertex;
 }
 
 
@@ -1823,8 +1844,6 @@ 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
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-
                                   // check that only boundary
                                   // indicators 0 and 1 are allowed
                                   // in 1d
@@ -1833,7 +1852,7 @@ unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<unsigned char> &bo
     Assert ((*i == 0) || (*i == 1),
            ExcInvalidBoundaryIndicator());
 
-  return boundary_indicators.size()*selected_fe->dofs_per_vertex;
+  return boundary_indicators.size()*get_fe().dofs_per_vertex;
 }
 
 #endif
@@ -1842,11 +1861,9 @@ unsigned int DoFHandler<1,2>::n_boundary_dofs (const std::set<unsigned char> &bo
 template<int dim, int spacedim>
 unsigned int DoFHandler<dim,spacedim>::n_boundary_dofs () const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-
   std::set<int> boundary_dofs;
 
-  const unsigned int dofs_per_face = selected_fe->dofs_per_face;
+  const unsigned int dofs_per_face = get_fe().dofs_per_face;
   std::vector<unsigned int> dofs_on_face(dofs_per_face);
 
                                   // loop over all faces to check
@@ -1877,13 +1894,12 @@ template<int dim, int spacedim>
 unsigned int
 DoFHandler<dim,spacedim>::n_boundary_dofs (const FunctionMap &boundary_indicators) const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
   Assert (boundary_indicators.find(255) == boundary_indicators.end(),
          ExcInvalidBoundaryIndicator());
 
   std::set<int> boundary_dofs;
 
-  const unsigned int dofs_per_face = selected_fe->dofs_per_face;
+  const unsigned int dofs_per_face = get_fe().dofs_per_face;
   std::vector<unsigned int> dofs_on_face(dofs_per_face);
   active_face_iterator face = begin_active_face (),
                       endf = end_face();
@@ -1904,13 +1920,12 @@ template<int dim, int spacedim>
 unsigned int
 DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<unsigned char> &boundary_indicators) const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
   Assert (boundary_indicators.find (255) == boundary_indicators.end(),
          ExcInvalidBoundaryIndicator());
 
   std::set<int> boundary_dofs;
 
-  const unsigned int dofs_per_face = selected_fe->dofs_per_face;
+  const unsigned int dofs_per_face = get_fe().dofs_per_face;
   std::vector<unsigned int> dofs_on_face(dofs_per_face);
   active_face_iterator face = begin_active_face (),
                       endf = end_face();
@@ -2056,8 +2071,6 @@ template <int dim, int spacedim>
 unsigned int
 DoFHandler<dim,spacedim>::max_couplings_between_dofs () const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-
   return internal::DoFHandler::Implementation::max_couplings_between_dofs (*this);
 }
 
@@ -2067,15 +2080,13 @@ template <int dim, int spacedim>
 unsigned int
 DoFHandler<dim,spacedim>::max_couplings_between_boundary_dofs () const
 {
-  Assert (selected_fe != 0, ExcNoFESelected());
-
   switch (dim)
     {
       case 1:
-           return selected_fe->dofs_per_vertex;
+           return get_fe().dofs_per_vertex;
       case 2:
-           return (3*selected_fe->dofs_per_vertex +
-                   2*selected_fe->dofs_per_line);
+           return (3*get_fe().dofs_per_vertex +
+                   2*get_fe().dofs_per_line);
       case 3:
                                             // we need to take refinement of
                                             // one boundary face into
@@ -2093,9 +2104,9 @@ DoFHandler<dim,spacedim>::max_couplings_between_boundary_dofs () const
                                             // harm since the matrix will cry
                                             // foul if its requirements are
                                             // not satisfied
-           return (19*selected_fe->dofs_per_vertex +
-                   28*selected_fe->dofs_per_line +
-                   8*selected_fe->dofs_per_quad);
+           return (19*get_fe().dofs_per_vertex +
+                   28*get_fe().dofs_per_line +
+                   8*get_fe().dofs_per_quad);
       default:
            Assert (false, ExcNotImplemented());
            return numbers::invalid_unsigned_int;
index 2bcc73c50f442295da76165c2624b669d8478682..7ec46d3036d1eb7ec9ef26a699bb29f5fb1e5b1a 100644 (file)
@@ -489,8 +489,7 @@ namespace internal
          {
            const unsigned int dim = 1;
 
-           Assert (mg_dof_handler.selected_fe != 0, DoFHandler<1>::ExcNoFESelected());
-           Assert (mg_dof_handler.tria->n_levels() > 0, DoFHandler<1>::ExcInvalidTriangulation());
+           Assert (mg_dof_handler.get_tria().n_levels() > 0, DoFHandler<1>::ExcInvalidTriangulation());
 
                                             //////////////////////////
                                             // DESTRUCTION
@@ -501,12 +500,12 @@ namespace internal
 
                                             // first allocate space for the
                                             // lines on each level
-           for (unsigned int i=0; i<mg_dof_handler.tria->n_levels(); ++i)
+           for (unsigned int i=0; i<mg_dof_handler.get_tria().n_levels(); ++i)
              {
                mg_dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<1>);
 
-               mg_dof_handler.mg_levels.back()->lines.dofs = std::vector<unsigned int>(mg_dof_handler.tria->n_raw_lines(i) *
-                                                                                       mg_dof_handler.selected_fe->dofs_per_line,
+               mg_dof_handler.mg_levels.back()->lines.dofs = std::vector<unsigned int>(mg_dof_handler.get_tria().n_raw_lines(i) *
+                                                                                       mg_dof_handler.get_fe().dofs_per_line,
                                                                                        DoFHandler<1>::invalid_dof_index);
              }
 
@@ -522,13 +521,13 @@ namespace internal
                                             // over all cells and storing the
                                             // maximum and minimum level each
                                             // vertex we pass by  belongs to
-           mg_dof_handler.mg_vertex_dofs.resize (mg_dof_handler.tria->n_vertices());
+           mg_dof_handler.mg_vertex_dofs.resize (mg_dof_handler.get_tria().n_vertices());
 
-           std::vector<unsigned int> min_level (mg_dof_handler.tria->n_vertices(), mg_dof_handler.tria->n_levels());
-           std::vector<unsigned int> max_level (mg_dof_handler.tria->n_vertices(), 0);
+           std::vector<unsigned int> min_level (mg_dof_handler.get_tria().n_vertices(), mg_dof_handler.get_tria().n_levels());
+           std::vector<unsigned int> max_level (mg_dof_handler.get_tria().n_vertices(), 0);
 
-           typename dealii::Triangulation<dim,spacedim>::cell_iterator cell = mg_dof_handler.tria->begin(),
-                                                      endc = mg_dof_handler.tria->end();
+           typename dealii::Triangulation<dim,spacedim>::cell_iterator cell = mg_dof_handler.get_tria().begin(),
+                                                      endc = mg_dof_handler.get_tria().end();
            for (; cell!=endc; ++cell)
              for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell;
                   ++vertex)
@@ -541,10 +540,10 @@ namespace internal
                }
 
                                             // now allocate the needed space
-           for (unsigned int vertex=0; vertex<mg_dof_handler.tria->n_vertices(); ++vertex)
-             if (mg_dof_handler.tria->vertex_used(vertex))
+           for (unsigned int vertex=0; vertex<mg_dof_handler.get_tria().n_vertices(); ++vertex)
+             if (mg_dof_handler.get_tria().vertex_used(vertex))
                {
-                 Assert (min_level[vertex] < mg_dof_handler.tria->n_levels(),   ExcInternalError());
+                 Assert (min_level[vertex] < mg_dof_handler.get_tria().n_levels(),   ExcInternalError());
                  Assert (max_level[vertex] >= min_level[vertex], ExcInternalError());
 
                  mg_dof_handler.mg_vertex_dofs[vertex].init (min_level[vertex],
@@ -553,7 +552,7 @@ namespace internal
                }
              else
                {
-                 Assert (min_level[vertex] == mg_dof_handler.tria->n_levels(),   ExcInternalError());
+                 Assert (min_level[vertex] == mg_dof_handler.get_tria().n_levels(),   ExcInternalError());
                  Assert (max_level[vertex] == 0, ExcInternalError());
 
                                                   // reset to original state
@@ -568,9 +567,7 @@ namespace internal
        void reserve_space (MGDoFHandler<2,spacedim> &mg_dof_handler)
          {
            const unsigned int dim = 2;
-
-           Assert (mg_dof_handler.selected_fe != 0, DoFHandler<2>::ExcNoFESelected());
-           Assert (mg_dof_handler.tria->n_levels() > 0, DoFHandler<2>::ExcInvalidTriangulation());
+           Assert (mg_dof_handler.get_tria().n_levels() > 0, DoFHandler<2>::ExcInvalidTriangulation());
 
                                             ////////////////////////////
                                             // DESTRUCTION
@@ -581,18 +578,18 @@ namespace internal
 
                                             // first allocate space for the
                                             // lines and quads on each level
-           for (unsigned int i=0; i<mg_dof_handler.tria->n_levels(); ++i)
+           for (unsigned int i=0; i<mg_dof_handler.get_tria().n_levels(); ++i)
              {
                mg_dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<2>);
 
-               mg_dof_handler.mg_levels.back()->quads.dofs = std::vector<unsigned int> (mg_dof_handler.tria->n_raw_quads(i) *
-                                                                                        mg_dof_handler.selected_fe->dofs_per_quad,
+               mg_dof_handler.mg_levels.back()->quads.dofs = std::vector<unsigned int> (mg_dof_handler.get_tria().n_raw_quads(i) *
+                                                                                        mg_dof_handler.get_fe().dofs_per_quad,
                                                                                         DoFHandler<2>::invalid_dof_index);
              }
 
            mg_dof_handler.mg_faces = new internal::DoFHandler::DoFFaces<2>;
-           mg_dof_handler.mg_faces->lines.dofs = std::vector<unsigned int> (mg_dof_handler.tria->n_raw_lines() *
-                                                                            mg_dof_handler.selected_fe->dofs_per_line,
+           mg_dof_handler.mg_faces->lines.dofs = std::vector<unsigned int> (mg_dof_handler.get_tria().n_raw_lines() *
+                                                                            mg_dof_handler.get_fe().dofs_per_line,
                                                                             DoFHandler<2>::invalid_dof_index);
 
 
@@ -608,16 +605,16 @@ namespace internal
                                             // over all cells and storing the
                                             // maximum and minimum level each
                                             // vertex we pass by  belongs to
-           mg_dof_handler.mg_vertex_dofs.resize (mg_dof_handler.tria->n_vertices());
+           mg_dof_handler.mg_vertex_dofs.resize (mg_dof_handler.get_tria().n_vertices());
 
                                             // initialize these arrays with
                                             // invalid values (min>max)
-           std::vector<unsigned int> min_level (mg_dof_handler.tria->n_vertices(),
-                                                mg_dof_handler.tria->n_levels());
-           std::vector<unsigned int> max_level (mg_dof_handler.tria->n_vertices(), 0);
+           std::vector<unsigned int> min_level (mg_dof_handler.get_tria().n_vertices(),
+                                                mg_dof_handler.get_tria().n_levels());
+           std::vector<unsigned int> max_level (mg_dof_handler.get_tria().n_vertices(), 0);
 
-           typename dealii::Triangulation<dim,spacedim>::cell_iterator cell = mg_dof_handler.tria->begin(),
-                                                      endc = mg_dof_handler.tria->end();
+           typename dealii::Triangulation<dim,spacedim>::cell_iterator cell = mg_dof_handler.get_tria().begin(),
+                                                      endc = mg_dof_handler.get_tria().end();
            for (; cell!=endc; ++cell)
              for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell;
                   ++vertex)
@@ -631,10 +628,10 @@ namespace internal
 
 
                                             // now allocate the needed space
-           for (unsigned int vertex=0; vertex<mg_dof_handler.tria->n_vertices(); ++vertex)
-             if (mg_dof_handler.tria->vertex_used(vertex))
+           for (unsigned int vertex=0; vertex<mg_dof_handler.get_tria().n_vertices(); ++vertex)
+             if (mg_dof_handler.get_tria().vertex_used(vertex))
                {
-                 Assert (min_level[vertex] < mg_dof_handler.tria->n_levels(), ExcInternalError());
+                 Assert (min_level[vertex] < mg_dof_handler.get_tria().n_levels(), ExcInternalError());
                  Assert (max_level[vertex] >= min_level[vertex], ExcInternalError());
 
                  mg_dof_handler.mg_vertex_dofs[vertex].init (min_level[vertex],
@@ -643,7 +640,7 @@ namespace internal
                }
              else
                {
-                 Assert (min_level[vertex] == mg_dof_handler.tria->n_levels(),   ExcInternalError());
+                 Assert (min_level[vertex] == mg_dof_handler.get_tria().n_levels(),   ExcInternalError());
                  Assert (max_level[vertex] == 0, ExcInternalError());
 
                                                   // reset to original state
@@ -659,8 +656,7 @@ namespace internal
          {
            const unsigned int dim = 3;
 
-           Assert (mg_dof_handler.selected_fe != 0, DoFHandler<3>::ExcNoFESelected());
-           Assert (mg_dof_handler.tria->n_levels() > 0, DoFHandler<3>::ExcInvalidTriangulation());
+           Assert (mg_dof_handler.get_tria().n_levels() > 0, DoFHandler<3>::ExcInvalidTriangulation());
 
                                             ////////////////////////////
                                             // DESTRUCTION
@@ -671,21 +667,21 @@ namespace internal
 
                                             // first allocate space for the
                                             // lines and quads on each level
-           for (unsigned int i=0; i<mg_dof_handler.tria->n_levels(); ++i)
+           for (unsigned int i=0; i<mg_dof_handler.get_tria().n_levels(); ++i)
              {
                mg_dof_handler.mg_levels.push_back (new internal::DoFHandler::DoFLevel<3>);
 
                mg_dof_handler.mg_levels.back()->hexes.dofs
-                 = std::vector<unsigned int> (mg_dof_handler.tria->n_raw_hexs(i) *
-                                              mg_dof_handler.selected_fe->dofs_per_hex,
+                 = std::vector<unsigned int> (mg_dof_handler.get_tria().n_raw_hexs(i) *
+                                              mg_dof_handler.get_fe().dofs_per_hex,
                                               DoFHandler<3>::invalid_dof_index);
              }
            mg_dof_handler.mg_faces = new internal::DoFHandler::DoFFaces<3>;
-           mg_dof_handler.mg_faces->lines.dofs = std::vector<unsigned int> (mg_dof_handler.tria->n_raw_lines() *
-                                                                            mg_dof_handler.selected_fe->dofs_per_line,
+           mg_dof_handler.mg_faces->lines.dofs = std::vector<unsigned int> (mg_dof_handler.get_tria().n_raw_lines() *
+                                                                            mg_dof_handler.get_fe().dofs_per_line,
                                                                             DoFHandler<3>::invalid_dof_index);
-           mg_dof_handler.mg_faces->quads.dofs = std::vector<unsigned int> (mg_dof_handler.tria->n_raw_quads() *
-                                                                            mg_dof_handler.selected_fe->dofs_per_quad,
+           mg_dof_handler.mg_faces->quads.dofs = std::vector<unsigned int> (mg_dof_handler.get_tria().n_raw_quads() *
+                                                                            mg_dof_handler.get_fe().dofs_per_quad,
                                                                             DoFHandler<3>::invalid_dof_index);
 
 
@@ -701,13 +697,13 @@ namespace internal
                                             // over all cells and storing the
                                             // maximum and minimum level each
                                             // vertex we pass by  belongs to
-           mg_dof_handler.mg_vertex_dofs.resize (mg_dof_handler.tria->n_vertices());
+           mg_dof_handler.mg_vertex_dofs.resize (mg_dof_handler.get_tria().n_vertices());
 
-           std::vector<unsigned int> min_level (mg_dof_handler.tria->n_vertices(), mg_dof_handler.tria->n_levels());
-           std::vector<unsigned int> max_level (mg_dof_handler.tria->n_vertices(), 0);
+           std::vector<unsigned int> min_level (mg_dof_handler.get_tria().n_vertices(), mg_dof_handler.get_tria().n_levels());
+           std::vector<unsigned int> max_level (mg_dof_handler.get_tria().n_vertices(), 0);
 
-           typename dealii::Triangulation<dim,spacedim>::cell_iterator cell = mg_dof_handler.tria->begin(),
-                                                      endc = mg_dof_handler.tria->end();
+           typename dealii::Triangulation<dim,spacedim>::cell_iterator cell = mg_dof_handler.get_tria().begin(),
+                                                      endc = mg_dof_handler.get_tria().end();
            for (; cell!=endc; ++cell)
              for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell;
                   ++vertex)
@@ -721,10 +717,10 @@ namespace internal
 
 
                                             // now allocate the needed space
-           for (unsigned int vertex=0; vertex<mg_dof_handler.tria->n_vertices(); ++vertex)
-             if (mg_dof_handler.tria->vertex_used(vertex))
+           for (unsigned int vertex=0; vertex<mg_dof_handler.get_tria().n_vertices(); ++vertex)
+             if (mg_dof_handler.get_tria().vertex_used(vertex))
                {
-                 Assert (min_level[vertex] < mg_dof_handler.tria->n_levels(), ExcInternalError());
+                 Assert (min_level[vertex] < mg_dof_handler.get_tria().n_levels(), ExcInternalError());
                  Assert (max_level[vertex] >= min_level[vertex], ExcInternalError());
 
                  mg_dof_handler.mg_vertex_dofs[vertex].init (min_level[vertex],
@@ -733,7 +729,7 @@ namespace internal
                }
              else
                {
-                 Assert (min_level[vertex] == mg_dof_handler.tria->n_levels(), ExcInternalError());
+                 Assert (min_level[vertex] == mg_dof_handler.get_tria().n_levels(), ExcInternalError());
                  Assert (max_level[vertex] == 0, ExcInternalError());
 
                                                   // reset to original state
@@ -1072,7 +1068,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::raw_cell_iterator
 MGDoFHandler<dim, spacedim>::end_raw (const unsigned int level) const
 {
-  return (level == this->tria->n_levels()-1 ?
+  return (level == this->get_tria().n_levels()-1 ?
          end() :
          begin_raw (level+1));
 }
@@ -1082,7 +1078,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::cell_iterator
 MGDoFHandler<dim, spacedim>::end (const unsigned int level) const
 {
-  return (level == this->tria->n_levels()-1 ?
+  return (level == this->get_tria().n_levels()-1 ?
          cell_iterator(end()) :
          begin (level+1));
 }
@@ -1092,7 +1088,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::active_cell_iterator
 MGDoFHandler<dim, spacedim>::end_active (const unsigned int level) const
 {
-  return (level == this->tria->n_levels()-1 ?
+  return (level == this->get_tria().n_levels()-1 ?
          active_cell_iterator(end()) :
          begin_active (level+1));
 }
@@ -1278,19 +1274,19 @@ MGDoFHandler<dim, spacedim>::begin_raw_line (const unsigned int level) const
   switch (dim)
     {
       case 1:
-           Assert (level<this->tria->n_levels(), ExcInvalidLevel(level));
+           Assert (level<this->get_tria().n_levels(), ExcInvalidLevel(level));
 
-           if (this->tria->n_raw_lines(level) == 0)
+           if (this->get_tria().n_raw_lines(level) == 0)
              return end_line ();
 
-           return raw_line_iterator (this->tria,
+           return raw_line_iterator (&this->get_tria(),
                                      level,
                                      0,
                                      this);
 
       default:
            Assert (level == 0, ExcFacesHaveNoLevel());
-           return raw_line_iterator (this->tria,
+           return raw_line_iterator (&this->get_tria(),
                                      0,
                                      0,
                                      this);
@@ -1334,7 +1330,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::raw_line_iterator
 MGDoFHandler<dim, spacedim>::end_line () const
 {
-  return raw_line_iterator (this->tria,
+  return raw_line_iterator (&this->get_tria(),
                            -1,
                            -1,
                            this);
@@ -1349,20 +1345,20 @@ MGDoFHandler<dim, spacedim>::last_raw_line (const unsigned int level) const
   switch (dim)
     {
       case 1:
-           Assert (level<this->tria->n_levels(), ExcInvalidLevel(level));
-           Assert (this->tria->n_raw_lines(level) != 0,
+           Assert (level<this->get_tria().n_levels(), ExcInvalidLevel(level));
+           Assert (this->get_tria().n_raw_lines(level) != 0,
                    ExcEmptyLevel (level));
 
-           return raw_line_iterator (this->tria,
+           return raw_line_iterator (&this->get_tria(),
                                      level,
-                                     this->tria->n_raw_lines(level)-1,
+                                     this->get_tria().n_raw_lines(level)-1,
                                      this);
 
       default:
            Assert (level == 0, ExcFacesHaveNoLevel());
-           return raw_line_iterator (this->tria,
+           return raw_line_iterator (&this->get_tria(),
                                      0,
-                                     this->tria->n_raw_lines()-1,
+                                     this->get_tria().n_raw_lines()-1,
                                      this);
     }
 }
@@ -1374,7 +1370,7 @@ typename MGDoFHandler<dim, spacedim>::raw_line_iterator
 MGDoFHandler<dim, spacedim>::last_raw_line () const
 {
   if (dim == 1)
-    return last_raw_line (this->tria->n_levels()-1);
+    return last_raw_line (this->get_tria().n_levels()-1);
   else
     return last_raw_line (0);
 }
@@ -1400,7 +1396,7 @@ typename MGDoFHandler<dim, spacedim>::line_iterator
 MGDoFHandler<dim, spacedim>::last_line () const
 {
   if (dim == 1)
-    return last_line (this->tria->n_levels()-1);
+    return last_line (this->get_tria().n_levels()-1);
   else
     return last_line (0);
 }
@@ -1426,7 +1422,7 @@ typename MGDoFHandler<dim, spacedim>::active_line_iterator
 MGDoFHandler<dim, spacedim>::last_active_line () const
 {
   if (dim == 1)
-    return last_active_line (this->tria->n_levels()-1);
+    return last_active_line (this->get_tria().n_levels()-1);
   else
     return last_active_line (0);
 }
@@ -1438,7 +1434,7 @@ MGDoFHandler<dim, spacedim>::end_raw_line (const unsigned int level) const
 {
   Assert (dim == 1 || level == 0, ExcFacesHaveNoLevel());
   if (dim == 1)
-    return (level == this->tria->n_levels()-1 ?
+    return (level == this->get_tria().n_levels()-1 ?
            end_line() :
            begin_raw_line (level+1));
   else
@@ -1452,7 +1448,7 @@ MGDoFHandler<dim, spacedim>::end_line (const unsigned int level) const
 {
   Assert (dim == 1 || level == 0, ExcFacesHaveNoLevel());
   if (dim == 1)
-    return (level == this->tria->n_levels()-1 ?
+    return (level == this->get_tria().n_levels()-1 ?
            line_iterator(end_line()) :
            begin_line (level+1));
   else
@@ -1466,7 +1462,7 @@ MGDoFHandler<dim, spacedim>::end_active_line (const unsigned int level) const
 {
   Assert (dim == 1 || level == 0, ExcFacesHaveNoLevel());
   if (dim == 1)
-    return (level == this->tria->n_levels()-1 ?
+    return (level == this->get_tria().n_levels()-1 ?
            active_line_iterator(end_line()) :
            begin_active_line (level+1));
   else
@@ -1489,12 +1485,12 @@ MGDoFHandler<dim,spacedim>::begin_raw_quad (const unsigned int level) const
            return raw_hex_iterator();
       case 2:
       {
-       Assert (level<this->tria->n_levels(), ExcInvalidLevel(level));
+       Assert (level<this->get_tria().n_levels(), ExcInvalidLevel(level));
 
-       if (this->tria->n_raw_quads(level) == 0)
+       if (this->get_tria().n_raw_quads(level) == 0)
          return end_quad();
 
-       return raw_quad_iterator (this->tria,
+       return raw_quad_iterator (&this->get_tria(),
                                  level,
                                  0,
                                  this);
@@ -1504,7 +1500,7 @@ MGDoFHandler<dim,spacedim>::begin_raw_quad (const unsigned int level) const
       {
        Assert (level == 0, ExcFacesHaveNoLevel());
 
-       return raw_quad_iterator (this->tria,
+       return raw_quad_iterator (&this->get_tria(),
                                  0,
                                  0,
                                  this);
@@ -1557,7 +1553,7 @@ MGDoFHandler<dim, spacedim>::end_raw_quad (const unsigned int level) const
 {
   Assert (dim == 2 || level == 0, ExcFacesHaveNoLevel());
   if (dim == 2)
-    return (level == this->tria->n_levels()-1 ?
+    return (level == this->get_tria().n_levels()-1 ?
            end_quad() :
            begin_raw_quad (level+1));
   else
@@ -1572,7 +1568,7 @@ MGDoFHandler<dim, spacedim>::end_quad (const unsigned int level) const
 {
   Assert (dim == 2 || level == 0, ExcFacesHaveNoLevel());
   if (dim == 2)
-    return (level == this->tria->n_levels()-1 ?
+    return (level == this->get_tria().n_levels()-1 ?
            quad_iterator(end_quad()) :
            begin_quad (level+1));
   else
@@ -1586,7 +1582,7 @@ MGDoFHandler<dim, spacedim>::end_active_quad (const unsigned int level) const
 {
   Assert(dim == 2 || level == 0, ExcFacesHaveNoLevel());
   if (dim == 2)
-    return (level == this->tria->n_levels()-1 ?
+    return (level == this->get_tria().n_levels()-1 ?
            active_quad_iterator(end_quad()) :
            begin_active_quad (level+1));
   else
@@ -1599,7 +1595,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim,spacedim>::raw_quad_iterator
 MGDoFHandler<dim,spacedim>::end_quad () const
 {
-  return raw_quad_iterator (this->tria,
+  return raw_quad_iterator (&this->get_tria(),
                            -1,
                            -1,
                            this);
@@ -1617,19 +1613,19 @@ MGDoFHandler<dim,spacedim>::last_raw_quad (const unsigned int level) const
            Assert (false, ExcImpossibleInDim(1));
            return raw_quad_iterator();
       case 2:
-           Assert (level<this->tria->n_levels(),
+           Assert (level<this->get_tria().n_levels(),
                    ExcInvalidLevel(level));
-           Assert (this->tria->n_raw_quads(level) != 0,
+           Assert (this->get_tria().n_raw_quads(level) != 0,
                    ExcEmptyLevel (level));
-           return raw_quad_iterator (this->tria,
+           return raw_quad_iterator (&this->get_tria(),
                                      level,
-                                     this->tria->n_raw_quads(level)-1,
+                                     this->get_tria().n_raw_quads(level)-1,
                                      this);
       case 3:
            Assert (level == 0, ExcFacesHaveNoLevel());
-           return raw_quad_iterator (this->tria,
+           return raw_quad_iterator (&this->get_tria(),
                                      0,
-                                     this->tria->n_raw_quads()-1,
+                                     this->get_tria().n_raw_quads()-1,
                                      this);
       default:
            Assert (false, ExcNotImplemented());
@@ -1644,7 +1640,7 @@ typename MGDoFHandler<dim,spacedim>::raw_quad_iterator
 MGDoFHandler<dim,spacedim>::last_raw_quad () const
 {
   if (dim == 2)
-    return last_raw_quad (this->tria->n_levels()-1);
+    return last_raw_quad (this->get_tria().n_levels()-1);
   else
     return last_raw_quad (0);
 }
@@ -1672,7 +1668,7 @@ typename MGDoFHandler<dim,spacedim>::quad_iterator
 MGDoFHandler<dim,spacedim>::last_quad () const
 {
   if (dim == 2)
-    return last_quad (this->tria->n_levels()-1);
+    return last_quad (this->get_tria().n_levels()-1);
   else
     return last_quad (0);
 }
@@ -1700,7 +1696,7 @@ typename MGDoFHandler<dim,spacedim>::active_quad_iterator
 MGDoFHandler<dim,spacedim>::last_active_quad () const
 {
   if (dim == 2)
-    return last_active_quad (this->tria->n_levels()-1);
+    return last_active_quad (this->get_tria().n_levels()-1);
   else
     return last_active_quad (0);
 }
@@ -1721,12 +1717,12 @@ MGDoFHandler<dim,spacedim>::begin_raw_hex (const unsigned int level) const
            return raw_hex_iterator();
       case 3:
       {
-       Assert (level<this->tria->n_levels(), ExcInvalidLevel(level));
+       Assert (level<this->get_tria().n_levels(), ExcInvalidLevel(level));
 
-       if (this->tria->n_raw_hexs(level) == 0)
+       if (this->get_tria().n_raw_hexs(level) == 0)
          return end_hex();
 
-       return raw_hex_iterator (this->tria,
+       return raw_hex_iterator (&this->get_tria(),
                                 level,
                                 0,
                                 this);
@@ -1776,7 +1772,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::raw_hex_iterator
 MGDoFHandler<dim, spacedim>::end_raw_hex (const unsigned int level) const
 {
-  return (level == this->tria->n_levels()-1 ?
+  return (level == this->get_tria().n_levels()-1 ?
          end_hex() :
          begin_raw_hex (level+1));
 }
@@ -1786,7 +1782,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::hex_iterator
 MGDoFHandler<dim, spacedim>::end_hex (const unsigned int level) const
 {
-  return (level == this->tria->n_levels()-1 ?
+  return (level == this->get_tria().n_levels()-1 ?
          hex_iterator(end_hex()) :
          begin_hex (level+1));
 }
@@ -1796,7 +1792,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::active_hex_iterator
 MGDoFHandler<dim, spacedim>::end_active_hex (const unsigned int level) const
 {
-  return (level == this->tria->n_levels()-1 ?
+  return (level == this->get_tria().n_levels()-1 ?
          active_hex_iterator(end_hex()) :
          begin_active_hex (level+1));
 }
@@ -1807,7 +1803,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::raw_hex_iterator
 MGDoFHandler<dim, spacedim>::end_hex () const
 {
-  return raw_hex_iterator (this->tria,
+  return raw_hex_iterator (&this->get_tria(),
                           -1,
                           -1,
                           this);
@@ -1827,14 +1823,14 @@ MGDoFHandler<dim, spacedim>::last_raw_hex (const unsigned int level) const
            return raw_hex_iterator();
 
       case 3:
-           Assert (level<this->tria->n_levels(),
+           Assert (level<this->get_tria().n_levels(),
                    ExcInvalidLevel(level));
-           Assert (this->tria->n_raw_hexs(level) != 0,
+           Assert (this->get_tria().n_raw_hexs(level) != 0,
                    ExcEmptyLevel (level));
 
-           return raw_hex_iterator (this->tria,
+           return raw_hex_iterator (&this->get_tria(),
                                     level,
-                                    this->tria->n_raw_hexs(level)-1,
+                                    this->get_tria().n_raw_hexs(level)-1,
                                     this);
       default:
            Assert (false, ExcNotImplemented());
@@ -1848,7 +1844,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::raw_hex_iterator
 MGDoFHandler<dim, spacedim>::last_raw_hex () const
 {
-  return last_raw_hex (this->tria->n_levels()-1);
+  return last_raw_hex (this->get_tria().n_levels()-1);
 }
 
 
@@ -1873,7 +1869,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::hex_iterator
 MGDoFHandler<dim, spacedim>::last_hex () const
 {
-  return last_hex (this->tria->n_levels()-1);
+  return last_hex (this->get_tria().n_levels()-1);
 }
 
 
@@ -1898,7 +1894,7 @@ template <int dim, int spacedim>
 typename MGDoFHandler<dim, spacedim>::active_hex_iterator
 MGDoFHandler<dim, spacedim>::last_active_hex () const
 {
-  return last_active_hex (this->tria->n_levels()-1);
+  return last_active_hex (this->get_tria().n_levels()-1);
 }
 
 
@@ -1961,7 +1957,7 @@ void MGDoFHandler<dim,spacedim>::distribute_dofs (const FiniteElement<dim,spaced
 
                                   // reserve space for the MG dof numbers
   reserve_space ();
-  mg_used_dofs.resize (this->tria->n_levels(), 0);
+  mg_used_dofs.resize (this->get_tria().n_levels(), 0);
 
                                   // Clear user flags because we will
                                   // need them. But first we save
@@ -1972,12 +1968,12 @@ void MGDoFHandler<dim,spacedim>::distribute_dofs (const FiniteElement<dim,spaced
                                   // same state as it was at the
                                   // beginning of this function.
   std::vector<bool> user_flags;
-  this->tria->save_user_flags(user_flags);
-  const_cast<Triangulation<dim,spacedim> &>(*(this->tria)).clear_user_flags ();
+  this->get_tria().save_user_flags(user_flags);
+  const_cast<Triangulation<dim,spacedim> &>(this->get_tria()).clear_user_flags ();
 
                                   // now distribute indices on each level
                                   // separately
-  for (unsigned int level=0; level<this->tria->n_levels(); ++level)
+  for (unsigned int level=0; level<this->get_tria().n_levels(); ++level)
     {
       unsigned int next_free_dof = offset;
       cell_iterator cell = begin(level),
@@ -1990,7 +1986,7 @@ void MGDoFHandler<dim,spacedim>::distribute_dofs (const FiniteElement<dim,spaced
     }
 
                                   // finally restore the user flags
-  const_cast<Triangulation<dim,spacedim> &>(*(this->tria))
+  const_cast<Triangulation<dim,spacedim> &>(this->get_tria())
     .load_user_flags(user_flags);
 
   this->block_info_object.initialize(*this, true);
@@ -2040,10 +2036,10 @@ void MGDoFHandler<1>::renumber_dofs (const unsigned int level,
                                     // the present level
     if ((i->get_coarsest_level() <= level) &&
        (i->get_finest_level() >= level))
-      for (unsigned int d=0; d<this->selected_fe->dofs_per_vertex; ++d)
-       i->set_index (level, d, this->selected_fe->dofs_per_vertex,
+      for (unsigned int d=0; d<this->get_fe().dofs_per_vertex; ++d)
+       i->set_index (level, d, this->get_fe().dofs_per_vertex,
                      new_numbers[i->get_index (level, d,
-                                               this->selected_fe->dofs_per_vertex)]);
+                                               this->get_fe().dofs_per_vertex)]);
 
   for (std::vector<unsigned int>::iterator i=mg_levels[level]->lines.dofs.begin();
        i!=mg_levels[level]->lines.dofs.end(); ++i)
@@ -2074,17 +2070,17 @@ void MGDoFHandler<2>::renumber_dofs (const unsigned int  level,
                                     // the present level
     if ((i->get_coarsest_level() <= level) &&
        (i->get_finest_level() >= level))
-      for (unsigned int d=0; d<this->selected_fe->dofs_per_vertex; ++d)
-       i->set_index (level, d, this->selected_fe->dofs_per_vertex,
+      for (unsigned int d=0; d<this->get_fe().dofs_per_vertex; ++d)
+       i->set_index (level, d, this->get_fe().dofs_per_vertex,
                      new_numbers[i->get_index (level, d,
-                                               this->selected_fe->dofs_per_vertex)]);
+                                               this->get_fe().dofs_per_vertex)]);
 
-  if (this->selected_fe->dofs_per_line > 0)
+  if (this->get_fe().dofs_per_line > 0)
     {
                                       // save user flags as they will be modified
       std::vector<bool> user_flags;
-      this->tria->save_user_flags(user_flags);
-      const_cast<Triangulation<2> &>(*(this->tria)).clear_user_flags ();
+      this->get_tria().save_user_flags(user_flags);
+      const_cast<Triangulation<2> &>(this->get_tria()).clear_user_flags ();
 
                                       // flag all lines adjacent to cells of the current
                                       // level, as those lines logically belong to the same
@@ -2102,12 +2098,12 @@ void MGDoFHandler<2>::renumber_dofs (const unsigned int  level,
       for( ; line != endline; ++line)
        if (line->user_flag_set())
          {
-           for (unsigned int d=0; d<this->selected_fe->dofs_per_line; ++d)
+           for (unsigned int d=0; d<this->get_fe().dofs_per_line; ++d)
              line->set_mg_dof_index (level, d, new_numbers[line->mg_dof_index(level, d)]);
            line->clear_user_flag();
          }
                                       // finally, restore user flags
-      const_cast<Triangulation<2> &>(*(this->tria)).load_user_flags (user_flags);
+      const_cast<Triangulation<2> &>(this->get_tria()).load_user_flags (user_flags);
     }
 
   for (std::vector<unsigned int>::iterator i=mg_levels[level]->quads.dofs.begin();
@@ -2139,18 +2135,18 @@ void MGDoFHandler<3>::renumber_dofs (const unsigned int  level,
                                     // the present level
     if ((i->get_coarsest_level() <= level) &&
        (i->get_finest_level() >= level))
-      for (unsigned int d=0; d<this->selected_fe->dofs_per_vertex; ++d)
-       i->set_index (level, d, this->selected_fe->dofs_per_vertex,
+      for (unsigned int d=0; d<this->get_fe().dofs_per_vertex; ++d)
+       i->set_index (level, d, this->get_fe().dofs_per_vertex,
                      new_numbers[i->get_index (level, d,
-                                               this->selected_fe->dofs_per_vertex)]);
+                                               this->get_fe().dofs_per_vertex)]);
 
                                   // LINE DoFs
-  if (this->selected_fe->dofs_per_line > 0)
+  if (this->get_fe().dofs_per_line > 0)
     {
                                       // save user flags as they will be modified
       std::vector<bool> user_flags;
-      this->tria->save_user_flags(user_flags);
-      const_cast<Triangulation<3> &>(*(this->tria)).clear_user_flags ();
+      this->get_tria().save_user_flags(user_flags);
+      const_cast<Triangulation<3> &>(this->get_tria()).clear_user_flags ();
 
                                       // flag all lines adjacent to cells of the current
                                       // level, as those lines logically belong to the same
@@ -2170,21 +2166,21 @@ void MGDoFHandler<3>::renumber_dofs (const unsigned int  level,
       for( ; line != endline; ++line)
        if (line->user_flag_set())
          {
-           for (unsigned int d=0; d<this->selected_fe->dofs_per_line; ++d)
+           for (unsigned int d=0; d<this->get_fe().dofs_per_line; ++d)
              line->set_mg_dof_index (level, d, new_numbers[line->mg_dof_index(level, d)]);
            line->clear_user_flag();
          }
                                       // finally, restore user flags
-      const_cast<Triangulation<3> &>(*(this->tria)).load_user_flags (user_flags);
+      const_cast<Triangulation<3> &>(this->get_tria()).load_user_flags (user_flags);
     }
 
                                   // QUAD DoFs
-  if (this->selected_fe->dofs_per_quad > 0)
+  if (this->get_fe().dofs_per_quad > 0)
     {
                                       // save user flags as they will be modified
       std::vector<bool> user_flags;
-      this->tria->save_user_flags(user_flags);
-      const_cast<Triangulation<3> &>(*(this->tria)).clear_user_flags ();
+      this->get_tria().save_user_flags(user_flags);
+      const_cast<Triangulation<3> &>(this->get_tria()).clear_user_flags ();
 
                                       // flag all quads adjacent to cells of the current
                                       // level, as those lines logically belong to the same
@@ -2202,12 +2198,12 @@ void MGDoFHandler<3>::renumber_dofs (const unsigned int  level,
       for( ; quad != endline; ++quad)
        if (quad->user_flag_set())
          {
-           for (unsigned int d=0; d<this->selected_fe->dofs_per_quad; ++d)
+           for (unsigned int d=0; d<this->get_fe().dofs_per_quad; ++d)
              quad->set_mg_dof_index (level, d, new_numbers[quad->mg_dof_index(level, d)]);
            quad->clear_user_flag();
          }
                                       // finally, restore user flags
-      const_cast<Triangulation<3> &>(*(this->tria)).load_user_flags (user_flags);
+      const_cast<Triangulation<3> &>(this->get_tria()).load_user_flags (user_flags);
     }
 
                                   //HEX DoFs
index 06531d6f73159e98971fc5606a1a87e622b2f523..791a71cd7cacd3f9b7d5f02a613e8cb261d1ff7c 100644 (file)
@@ -30,7 +30,13 @@ inconvenience this causes.
 </p>
 
 <ol>
-  <li>None.
+
+<li> The fields DoFHandler::tria and DoFHandler::selected_fe are now
+private instead of protected. Inheriting classes can only access them
+through DoFHandler::get_tria() and DoFHandler::get_fe(), respectively.
+<br>
+(GK 2010/08/16)</li>
+
 </ol>
 
 
@@ -218,6 +224,13 @@ inconvenience this causes.
 
 <ol>
 
+  <li>
+  <p>
+  Improved: DoFHandler has a default constructor, so that it can be used in containers.        
+  <br>
+  (GK 2010/08/16)
+  </p>
+
   <li>
   <p>
   New: The functions VectorTools::project_boundary_values_curl_conforming

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.