]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use of new TriaObjectAccessor::n_children function.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Thu, 2 Mar 2006 09:02:23 +0000 (09:02 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Thu, 2 Mar 2006 09:02:23 +0000 (09:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@12525 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/deal.II/source/dofs/hp_dof_handler.cc
deal.II/deal.II/source/fe/fe_values.cc
deal.II/deal.II/source/grid/grid_tools.cc
deal.II/deal.II/source/grid/intergrid_map.cc
deal.II/deal.II/source/grid/tria_accessor.cc
deal.II/deal.II/source/multigrid/mg_transfer_block.cc
deal.II/deal.II/source/multigrid/mg_transfer_prebuilt.cc
deal.II/deal.II/source/numerics/derivative_approximation.cc
deal.II/deal.II/source/numerics/error_estimator.cc
deal.II/deal.II/source/numerics/solution_transfer.cc
deal.II/deal.II/source/numerics/time_dependent.cc

index ebff141a97d555266eca5058f67b9fcda520c73e..78a33f98107c4b485f5fb32c212d55046c03226e 100644 (file)
@@ -1007,7 +1007,7 @@ DoFTools::make_flux_sparsity_pattern (
          if (cell_face->user_flag_set ())
            continue;
 
-         if (! cell->at_boundary (face) )
+         if (! cell_face->at_boundary() )
            {
              typename DH::cell_iterator neighbor = cell->neighbor(face);
                                               // Refinement edges are
@@ -1019,10 +1019,10 @@ DoFTools::make_flux_sparsity_pattern (
              const unsigned int neighbor_face
                 = cell->neighbor_of_neighbor(face);
 
-             if (neighbor->has_children())
+             if (cell_face->has_children())
                {
                  for (unsigned int sub_nr = 0;
-                      sub_nr != GeometryInfo<DH::dimension>::subfaces_per_face;
+                      sub_nr != cell_face->n_children();
                       ++sub_nr)
                    {
                      const typename DH::cell_iterator
@@ -1231,13 +1231,14 @@ DoFTools::make_flux_sparsity_pattern (
              if (neighbor->level() < cell->level())
                continue;
              
+             typename DH::face_iterator cell_face = cell->face(face);
              const unsigned int
                 neighbor_face = cell->neighbor_of_neighbor(face);
              
-             if (neighbor->has_children())
+             if (cell_face->has_children())
                {
                  for (unsigned int sub_nr = 0;
-                      sub_nr != GeometryInfo<DH::dimension>::subfaces_per_face;
+                      sub_nr != cell_face->n_children();
                       ++sub_nr)
                    {
                      const typename DH::cell_iterator
index 09d09a39ab2abbcea21d81faf9562c26792ff5e5..2efebfba636e0b9ce070358ece141a9e4b399899 100644 (file)
@@ -2530,7 +2530,7 @@ namespace hp
               {
                                                  // Set active_fe_index in children to the
                                                  // same value as in the parent cell.
-                for (unsigned int i = 0; i < GeometryInfo<dim>::children_per_cell; ++i)
+                for (unsigned int i = 0; i < cell->n_children(); ++i)
                   cell->child (i)->set_active_fe_index (cell->active_fe_index ());
               }
           }
index 39a09ab5b4765ad76273308fef0e5302ff17c2a4..ad6160d4a92436c705c7f7d023cf476e1cd561db 100644 (file)
@@ -1614,8 +1614,21 @@ void FESubfaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator
 //       typename FEValuesBase<dim>::ExcFEDontMatch());
   Assert (face_no < GeometryInfo<dim>::faces_per_cell,
          ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
-  Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
+                                  // We would like to check for
+                                  // subface_no < cell->face(face_no)->n_children(),
+                                  // but unfortunately the current
+                                  // function is also called for
+                                  // faces without children (see
+                                  // tests/fe/mapping.cc). Therefore,
+                                  // we must use following workaround
+                                  // of two separate assertions
+  Assert (cell->face(face_no)->has_children() ||
+         subface_no < GeometryInfo<dim>::subfaces_per_face,
          ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+  Assert (!cell->face(face_no)->has_children() ||
+         subface_no < cell->face(face_no)->n_children(),
+         ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
+
   Assert (cell->has_children() == false,
           ExcMessage ("You can't use subface data for cells that are "
                       "already refined. Iterate over their children "
@@ -1657,8 +1670,8 @@ void FESubfaceValues<dim>::reinit (const typename hp::DoFHandler<dim>::cell_iter
          typename FEValuesBase<dim>::ExcFEDontMatch());
   Assert (face_no < GeometryInfo<dim>::faces_per_cell,
          ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
-  Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
-         ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+  Assert (subface_no < cell->face(face_no)->n_children(),
+         ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
   Assert (cell->has_children() == false,
           ExcMessage ("You can't use subface data for cells that are "
                       "already refined. Iterate over their children "
@@ -1692,8 +1705,8 @@ void FESubfaceValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterat
           typename FEValuesBase<dim>::ExcFEDontMatch());
   Assert (face_no < GeometryInfo<dim>::faces_per_cell,
          ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
-  Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
-         ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+  Assert (subface_no < cell->face(face_no)->n_children(),
+         ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
   Assert (cell->has_children() == false,
           ExcMessage ("You can't use subface data for cells that are "
                       "already refined. Iterate over their children "
@@ -1725,8 +1738,8 @@ void FESubfaceValues<dim>::reinit (const typename Triangulation<dim>::cell_itera
 {
   Assert (face_no < GeometryInfo<dim>::faces_per_cell,
          ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
-  Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
-         ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+  Assert (subface_no < cell->face(face_no)->n_children(),
+         ExcIndexRange (subface_no, 0, cell->face(face_no)->n_children()));
   
                                    // set new cell. auto_ptr will take
                                    // care that old object gets
index 1666ef9c8039b59ae7c47e076ee8931990b6a1fe..b0bd4befc1cf0ff5cba84fd831999341a7a240db 100644 (file)
@@ -427,15 +427,15 @@ GridTools::find_active_cell_around_point (const Container  &container,
                                    // grandchild
   while (cell->has_children())
     {
+      const unsigned int n_children=cell->n_children();
       unsigned int c=0;
-      for (; c<GeometryInfo<dim>::children_per_cell; ++c)
+      for (; c<n_children; ++c)
         if (cell->child(c)->point_inside (p))
           break;
 
                                        // make sure we found a child
                                        // cell
-      AssertThrow (c != GeometryInfo<dim>::children_per_cell,
-                   ExcPointNotFound<dim> (p));
+      AssertThrow (c != n_children, ExcPointNotFound<dim> (p));
 
                                        // then reset cell to the child
       cell = cell->child(c);
index 49bd07e002551636e88f7bf14b0fc178666c145c..409e6a5563e2e1c818be8302b2eeb121f095cc5b 100644 (file)
@@ -140,7 +140,7 @@ InterGridMap<GridClass>::set_mapping (const cell_iterator &src_cell,
                                       // set entries for all children
                                       // of this cell to the one
                                       // dst_cell
-      for (unsigned int c=0; c<GeometryInfo<GridClass::dimension>::children_per_cell; ++c)
+      for (unsigned int c=0; c<src_cell->n_children(); ++c)
        set_entries_to_cell (src_cell->child(c),
                             dst_cell);
                                   // else (no cell is refined or
@@ -161,7 +161,7 @@ InterGridMap<GridClass>::set_entries_to_cell (const cell_iterator &src_cell,
                                   // then do so for the children as well
                                   // if there are any
   if (src_cell->has_children())
-    for (unsigned int c=0; c<GeometryInfo<GridClass::dimension>::children_per_cell; ++c)
+    for (unsigned int c=0; c<src_cell->n_children(); ++c)
       set_entries_to_cell (src_cell->child(c),
                           dst_cell);
 }
index d601a9e130c665bfbfc254a2ff0bc259f0d8ef68..277edc594a4f7f452d8a887f2abca7369dff7333 100644 (file)
@@ -314,7 +314,7 @@ void TriaObjectAccessor<2, dim>::recursively_set_user_flag () const
   set_user_flag ();
 
   if (has_children())
-    for (unsigned int c=0; c<4; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_set_user_flag ();
 }
 
@@ -326,7 +326,7 @@ void TriaObjectAccessor<2, dim>::recursively_clear_user_flag () const
   clear_user_flag ();
 
   if (has_children())
-    for (unsigned int c=0; c<4; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_clear_user_flag ();
 }
 
@@ -366,7 +366,7 @@ TriaObjectAccessor<2, dim>::recursively_set_user_pointer (void *p) const
   set_user_pointer (p);
 
   if (has_children())
-    for (unsigned int c=0; c<4; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_set_user_pointer (p);
 }
 
@@ -379,7 +379,7 @@ TriaObjectAccessor<2, dim>::recursively_clear_user_pointer () const
   clear_user_pointer ();
 
   if (has_children())
-    for (unsigned int c=0; c<4; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_clear_user_pointer ();
 }
 
@@ -659,7 +659,7 @@ unsigned int TriaObjectAccessor<2, dim>::number_of_children () const
   else
     {
       unsigned int sum = 0;
-      for (unsigned int c=0; c<4; ++c)
+      for (unsigned int c=0; c<n_children(); ++c)
        sum += child(c)->number_of_children();
       return sum;
     };
@@ -749,7 +749,7 @@ void TriaObjectAccessor<3, dim>::recursively_set_user_flag () const
   set_user_flag ();
 
   if (has_children())
-    for (unsigned int c=0; c<8; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_set_user_flag ();
 }
 
@@ -761,7 +761,7 @@ void TriaObjectAccessor<3, dim>::recursively_clear_user_flag () const
   clear_user_flag ();
 
   if (has_children())
-    for (unsigned int c=0; c<8; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_clear_user_flag ();
 }
 
@@ -801,7 +801,7 @@ TriaObjectAccessor<3, dim>::recursively_set_user_pointer (void *p) const
   set_user_pointer (p);
 
   if (has_children())
-    for (unsigned int c=0; c<8; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_set_user_pointer (p);
 }
 
@@ -814,7 +814,7 @@ TriaObjectAccessor<3, dim>::recursively_clear_user_pointer () const
   clear_user_pointer ();
 
   if (has_children())
-    for (unsigned int c=0; c<8; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_clear_user_pointer ();
 }
 
@@ -1596,7 +1596,7 @@ unsigned int TriaObjectAccessor<3, dim>::number_of_children () const
   else
     {
       unsigned int sum = 0;
-      for (unsigned int c=0; c<8; ++c)
+      for (unsigned int c=0; c<n_children(); ++c)
        sum += child(c)->number_of_children();
       return sum;
     };
@@ -1754,7 +1754,7 @@ void CellAccessor<2>::recursively_set_material_id (const unsigned char mat_id) c
   set_material_id (mat_id);
 
   if (this->has_children())
-    for (unsigned int c=0; c<4; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_set_material_id (mat_id);
 }
 
@@ -1855,7 +1855,7 @@ void CellAccessor<3>::recursively_set_material_id (const unsigned char mat_id) c
   set_material_id (mat_id);
 
   if (this->has_children())
-    for (unsigned int c=0; c<8; ++c)
+    for (unsigned int c=0; c<n_children(); ++c)
       child(c)->recursively_set_material_id (mat_id);
 }
 
@@ -2040,7 +2040,7 @@ CellAccessor<dim>::neighbor_of_coarser_neighbor (const unsigned int neighbor) co
     =neighbor_cell->face(face_no_guess);
   
   if (face_guess->has_children())
-    for (unsigned int subface_no=0; subface_no<GeometryInfo<dim>::subfaces_per_face; ++subface_no)
+    for (unsigned int subface_no=0; face_guess->n_children(); ++subface_no)
       if (face_guess->child(subface_no)==this_face)
        return std::make_pair (face_no_guess, subface_no);
 
@@ -2055,7 +2055,7 @@ CellAccessor<dim>::neighbor_of_coarser_neighbor (const unsigned int neighbor) co
          const TriaIterator<dim,TriaObjectAccessor<dim-1, dim> > face
            =neighbor_cell->face(face_no);
          if (face->has_children())
-           for (unsigned int subface_no=0; subface_no<GeometryInfo<dim>::subfaces_per_face; ++subface_no)
+           for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no)
              if (face->child(subface_no)==this_face)
                return std::make_pair (face_no, subface_no);
        }
index 42b119affafc0d11eae8276f992e3e9e682d8d71..bf6101ae42c8699c80c097a7db58a4028ab28bdd 100644 (file)
@@ -200,8 +200,7 @@ void MGTransferBlockBase::build_matrices (
          {
            cell->get_mg_dof_indices (dof_indices_parent);
 
-           for (unsigned int child=0;
-                child<GeometryInfo<dim>::children_per_cell; ++child)
+           for (unsigned int child=0; child<cell->n_children(); ++child)
              {
                                                 // set an alias to the
                                                 // prolongation matrix for
@@ -238,8 +237,7 @@ void MGTransferBlockBase::build_matrices (
          {
            cell->get_mg_dof_indices (dof_indices_parent);
 
-           for (unsigned int child=0;
-                child<GeometryInfo<dim>::children_per_cell; ++child)
+           for (unsigned int child=0; child<cell->n_children(); ++child)
              {
                                                 // set an alias to the
                                                 // prolongation matrix for
index 42f06b0f8449659f44459335eaaead1f948db777..94fc01bbca070375818b71d6ac17eaea2c555132 100644 (file)
@@ -93,8 +93,7 @@ void MGTransferPrebuilt<number>::build_matrices (
          {
            cell->get_mg_dof_indices (dof_indices_parent);
 
-           for (unsigned int child=0;
-                child<GeometryInfo<dim>::children_per_cell; ++child)
+           for (unsigned int child=0; child<cell->n_children(); ++child)
              {
                                                 // set an alias to the
                                                 // prolongation matrix for
@@ -129,8 +128,7 @@ void MGTransferPrebuilt<number>::build_matrices (
          {
            cell->get_mg_dof_indices (dof_indices_parent);
 
-           for (unsigned int child=0;
-                child<GeometryInfo<dim>::children_per_cell; ++child)
+           for (unsigned int child=0; child<cell->n_children(); ++child)
              {
                                                 // set an alias to the
                                                 // prolongation matrix for
index 93af5b2ae37825f8d707311e3b149c692cfe1e4d..d5188042c498038757d0416e17eefd3f057463b6 100644 (file)
@@ -662,7 +662,7 @@ DerivativeApproximation::approximate (const Mapping<dim>    &mapping,
                                                   // children. find out
                                                   // which border to the
                                                   // present cell
-                 for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+                 for (unsigned int c=0; c<neighbor->n_children(); ++c)
                    for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
                      if (neighbor->child(c)->neighbor(f) == cell)
                        active_neighbors.push_back (neighbor->child(c));
index 68f928132af887e54a494ac2f23b89c69628624e..2822785992ae0729ed71ebfb6e3b6d41b64a3291 100644 (file)
@@ -540,6 +540,9 @@ estimate_some (const Mapping<dim>                  &mapping,
       for (unsigned int face_no=0;
            face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
        {
+         const typename DoFHandler<dim>::face_iterator
+           face=cell->face(face_no);
+
                                           // make sure we do work
                                           // only once: this face
                                           // may either be regular
@@ -554,7 +557,7 @@ estimate_some (const Mapping<dim>                  &mapping,
                                           // boundary, or if the
                                           // face is irregular,
                                           // then do the work below
-         if ((cell->face(face_no)->has_children() == false) &&
+         if ((face->has_children() == false) &&
              !cell->at_boundary(face_no) &&
              (cell->neighbor(face_no)->level() == cell->level()) &&
              (cell->neighbor(face_no)->index() < cell->index()))
@@ -567,7 +570,7 @@ estimate_some (const Mapping<dim>                  &mapping,
                                           // solution vector, as we
                                           // treat them all at the
                                           // same time
-         if (face_integrals[cell->face(face_no)][0] >=0)
+         if (face_integrals[face][0] >=0)
            continue;
 
 
@@ -590,13 +593,13 @@ estimate_some (const Mapping<dim>                  &mapping,
                                           // the list of faces with
                                           // contribution zero.
          const unsigned char boundary_indicator
-           = cell->face(face_no)->boundary_indicator();
-         if (cell->face(face_no)->at_boundary()
+           = face->boundary_indicator();
+         if (face->at_boundary()
              &&
              neumann_bc.find(boundary_indicator)==neumann_bc.end()) 
            {
              for (unsigned int n=0; n<n_solution_vectors; ++n)
-               face_integrals[cell->face(face_no)][n] = 0;
+               face_integrals[face][n] = 0;
              continue;
            }
 
@@ -620,11 +623,11 @@ estimate_some (const Mapping<dim>                  &mapping,
                                                // the face we presently work
                                                // on? oh is there a face at
                                                // all?
-              if (cell->at_boundary(face_no))
+              if (face->at_boundary())
                 continue;
 
               bool care_for_cell = false;
-              if (cell->neighbor(face_no)->has_children() == false)
+              if (face->has_children() == false)
                 care_for_cell |= ((cell->neighbor(face_no)->subdomain_id()
                                    == subdomain_id) ||
                                   (subdomain_id == deal_II_numbers::invalid_unsigned_int))
@@ -634,8 +637,7 @@ estimate_some (const Mapping<dim>                  &mapping,
                                   (material_id == deal_II_numbers::invalid_unsigned_int));
               else
                 {
-                  for (unsigned int sf=0;
-                       sf<GeometryInfo<dim>::subfaces_per_face; ++sf)
+                  for (unsigned int sf=0; sf<face->n_children(); ++sf)
                     if (((cell->neighbor_child_on_subface(face_no,sf)
                           ->subdomain_id() == subdomain_id)
                          &&
@@ -665,7 +667,7 @@ estimate_some (const Mapping<dim>                  &mapping,
                                            // so now we know that we care for
                                            // this face, let's do something
                                            // about it:
-         if (cell->face(face_no)->has_children() == false)
+         if (face->has_children() == false)
                                             // if the face is a regular one,
                                             // i.e.  either on the other side
                                             // there is nirvana (face is at
@@ -1138,9 +1140,11 @@ integrate_over_irregular_face (const DoFHandler<dim>               &dof_handler,
   const unsigned int n_q_points         = quadrature.n_quadrature_points,
                     n_components       = dof_handler.get_fe().n_components(),
                     n_solution_vectors = solutions.size();
+  const typename DoFHandler<dim>::face_iterator
+    face=cell->face(face_no);
 
   Assert (neighbor.state() == IteratorState::valid, ExcInternalError());
-  Assert (neighbor->has_children(), ExcInternalError());
+  Assert (face->has_children(), ExcInternalError());
                                   // set up a vector of the gradients
                                   // of the finite element function
                                   // on this cell at the quadrature
@@ -1162,9 +1166,7 @@ integrate_over_irregular_face (const DoFHandler<dim>               &dof_handler,
           ExcInternalError());
   
                                   // loop over all subfaces
-  for (unsigned int subface_no=0;
-       subface_no<GeometryInfo<dim>::subfaces_per_face;
-       ++subface_no)
+  for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no)
     {
                                       // get an iterator pointing to the
                                       // cell behind the present subface
@@ -1288,9 +1290,7 @@ integrate_over_irregular_face (const DoFHandler<dim>               &dof_handler,
                                   // subfaces and store them with the
                                   // mother face
   std::vector<double> sum (n_solution_vectors, 0);
-  typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
-  for (unsigned int subface_no=0; subface_no<GeometryInfo<dim>::subfaces_per_face;
-       ++subface_no) 
+  for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no) 
     {
       Assert (face_integrals.find(face->child(subface_no)) !=
              face_integrals.end(),
index 21dfb796df9f47cfbaaae8ae72c370c6516aed6b..a426a20fc417aa528aa0f3181d2f5add4e347d16 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -248,7 +248,7 @@ prepare_for_coarsening_and_refinement(const std::vector<Vector<number> > &all_in
                                           // coaresen flag, then all should
                                           // have if Tria::prepare_* has
                                           // worked correctly
-         for (unsigned int i=1; i<GeometryInfo<dim>::children_per_cell; ++i)
+         for (unsigned int i=1; i<cell->n_children(); ++i)
            Assert(cell->child(i)->coarsen_flag_set(),
                   ExcTriaPrepCoarseningNotCalledBefore());
              
index 8267832956bef3b1661c7e576d50e707836ce400..eaa2372dbd3c645e57c7197c01a2f7866c3df0a5 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -581,9 +581,12 @@ namespace
        return;
       };
 
-    if (old_cell->has_children() && new_cell->has_children()) 
-      for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
-       ::mirror_refinement_flags<dim> (new_cell->child(c), old_cell->child(c));
+    if (old_cell->has_children() && new_cell->has_children())
+      {
+       Assert(old_cell->n_children()==new_cell->n_children(), ExcNotImplemented());
+       for (unsigned int c=0; c<new_cell->n_children(); ++c)
+         ::mirror_refinement_flags<dim> (new_cell->child(c), old_cell->child(c));
+      }
   }
 
 
@@ -597,8 +600,9 @@ namespace
     if (cell2->has_children() && cell1->has_children()) 
       {
        bool grids_changed = false;
-      
-       for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c) 
+
+       Assert(cell2->n_children()==cell1->n_children(), ExcNotImplemented());
+       for (unsigned int c=0; c<cell1->n_children(); ++c) 
          grids_changed |= ::adapt_grid_cells<dim> (cell1->child(c),
                                                    cell2->child(c));
        return grids_changed;
@@ -654,7 +658,7 @@ namespace
          };
       
        if (!cell2->refine_flag_set())
-         for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+         for (unsigned int c=0; c<cell1->n_children(); ++c)
            if (cell1->child(c)->refine_flag_set() ||
                cell1->child(c)->has_children()) 
              {
@@ -676,7 +680,7 @@ namespace
          };
       
        if (!cell1->refine_flag_set())
-         for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
+         for (unsigned int c=0; c<cell2->n_children(); ++c)
            if (cell2->child(c)->refine_flag_set() ||
                cell2->child(c)->has_children())
              {

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.