]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Separate out a few things that should or should not be dimension dependent.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 24 Oct 2010 18:55:58 +0000 (18:55 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 24 Oct 2010 18:55:58 +0000 (18:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@22461 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_out.all_dimensions.cc
deal.II/deal.II/source/grid/grid_out.cc
deal.II/deal.II/source/numerics/histogram.all_dimensions.cc [moved from deal.II/deal.II/source/numerics/histogram.cc with 100% similarity]
deal.II/deal.II/source/numerics/time_dependent.cc

index a2ffca09faf30e11011978423334ed70eedd3b04..880c5d361fe5c49beedaddcfa7135c90f45b4ea2 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2010 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -48,7 +48,7 @@ namespace GridOutFlags
     param.declare_entry("Write all faces", "true", Patterns::Bool(),
                        "Write all faces, not only boundary");
   }
-  
+
   void DX::parse_parameters (ParameterHandler& param)
   {
     write_cells = param.get_bool("Write cells");
@@ -57,14 +57,14 @@ namespace GridOutFlags
     write_measure = param.get_bool("Write measure");
     write_all_faces = param.get_bool("Write all faces");
   }
-  
-  
-  Msh::Msh (const bool write_faces, 
+
+
+  Msh::Msh (const bool write_faces,
            const bool write_lines) :
     write_faces (write_faces),
     write_lines (write_lines)
   {}
-  
+
   void Msh::declare_parameters (ParameterHandler& param)
   {
     param.declare_entry("Write faces", "false", Patterns::Bool());
@@ -78,7 +78,7 @@ namespace GridOutFlags
     write_lines = param.get_bool("Write lines");
   }
 
-  
+
   Ucd::Ucd (const bool write_preamble,
            const bool write_faces,
            const bool write_lines) :
@@ -87,8 +87,8 @@ namespace GridOutFlags
                  write_lines (write_lines)
   {}
 
-  
-  
+
+
   void Ucd::declare_parameters (ParameterHandler& param)
   {
     param.declare_entry("Write preamble", "true", Patterns::Bool());
@@ -104,7 +104,7 @@ namespace GridOutFlags
     write_lines = param.get_bool("Write lines");
   }
 
-  
+
   Gnuplot::Gnuplot (const bool write_cell_numbers,
                    const unsigned int n_boundary_face_points,
                    const bool         curved_inner_cells) :
@@ -113,8 +113,8 @@ namespace GridOutFlags
                  curved_inner_cells(curved_inner_cells)
   {}
 
-  
-  
+
+
   void Gnuplot::declare_parameters (ParameterHandler& param)
   {
     param.declare_entry("Cell number", "false", Patterns::Bool());
@@ -128,7 +128,7 @@ namespace GridOutFlags
     n_boundary_face_points = param.get_integer("Boundary points");
   }
 
-  
+
   EpsFlagsBase::EpsFlagsBase (const SizeType     size_type,
                              const unsigned int size,
                              const double       line_width,
@@ -142,7 +142,7 @@ namespace GridOutFlags
                  n_boundary_face_points(n_boundary_face_points),
                  color_lines_level(color_lines_level)
   {}
-  
+
 
   void EpsFlagsBase::declare_parameters (ParameterHandler& param)
   {
@@ -178,8 +178,8 @@ namespace GridOutFlags
     color_lines_level = param.get_bool("Color by level");
   }
 
-  
-  
+
+
   Eps<1>::Eps (const SizeType     size_type,
               const unsigned int size,
               const double       line_width,
@@ -191,7 +191,7 @@ namespace GridOutFlags
                               n_boundary_face_points)
   {}
 
-  
+
   void Eps<1>::declare_parameters (ParameterHandler&)
   {}
 
@@ -201,8 +201,8 @@ namespace GridOutFlags
     EpsFlagsBase::parse_parameters(param);
   }
 
-  
-  
+
+
   Eps<2>::Eps (const SizeType     size_type,
               const unsigned int size,
               const double       line_width,
@@ -222,8 +222,8 @@ namespace GridOutFlags
                  write_cell_number_level (write_cell_number_level),
                  write_vertex_numbers (write_vertex_numbers)
   {}
-  
-  
+
+
   void Eps<2>::declare_parameters (ParameterHandler& param)
   {
     param.declare_entry("Cell number", "false", Patterns::Bool(),
@@ -245,8 +245,8 @@ namespace GridOutFlags
     write_vertex_numbers = param.get_bool("Vertex number");
   }
 
-  
-  
+
+
   Eps<3>::Eps (const SizeType     size_type,
               const unsigned int size,
               const double       line_width,
@@ -261,15 +261,15 @@ namespace GridOutFlags
                  azimut_angle (azimut_angle),
                  turn_angle (turn_angle)
   {}
-  
-  
+
+
   void Eps<3>::declare_parameters (ParameterHandler& param)
   {
     param.declare_entry("Azimuth", "30", Patterns::Double(),
                        "Azimuth of the viw point, that is, the angle "
                        "in the plane from the x-axis.");
     param.declare_entry("Elevation", "30", Patterns::Double(),
-                       "Elevation of the view point above the xy-plane.");    
+                       "Elevation of the view point above the xy-plane.");
   }
 
 
@@ -280,8 +280,8 @@ namespace GridOutFlags
     turn_angle = param.get_double("Azimuth");
   }
 
-  
-  
+
+
   XFig::XFig ()
                  :
     draw_boundary(true),
@@ -296,7 +296,7 @@ namespace GridOutFlags
     boundary_thickness(3)
   {}
 
-  
+
   void XFig::declare_parameters (ParameterHandler& param)
   {
     param.declare_entry("Boundary", "true", Patterns::Bool());
@@ -325,60 +325,66 @@ namespace GridOutFlags
     boundary_thickness = param.get_integer("Boundary width");
   }
 
-  
+
 }  // end namespace GridOutFlags
 
 
 
-void GridOut::set_flags (const GridOutFlags::DX &flags) 
+GridOut::GridOut ()
+               :
+               default_format (none)
+{}
+
+
+void GridOut::set_flags (const GridOutFlags::DX &flags)
 {
   dx_flags = flags;
 }
 
 
 
-void GridOut::set_flags (const GridOutFlags::Msh &flags) 
+void GridOut::set_flags (const GridOutFlags::Msh &flags)
 {
   msh_flags = flags;
 }
 
 
-void GridOut::set_flags (const GridOutFlags::Ucd &flags) 
+void GridOut::set_flags (const GridOutFlags::Ucd &flags)
 {
   ucd_flags = flags;
 }
 
 
 
-void GridOut::set_flags (const GridOutFlags::Gnuplot &flags) 
+void GridOut::set_flags (const GridOutFlags::Gnuplot &flags)
 {
   gnuplot_flags = flags;
 }
 
 
 
-void GridOut::set_flags (const GridOutFlags::Eps<1> &flags) 
+void GridOut::set_flags (const GridOutFlags::Eps<1> &flags)
 {
   eps_flags_1 = flags;
 }
 
 
 
-void GridOut::set_flags (const GridOutFlags::Eps<2> &flags) 
+void GridOut::set_flags (const GridOutFlags::Eps<2> &flags)
 {
   eps_flags_2 = flags;
 }
 
 
 
-void GridOut::set_flags (const GridOutFlags::Eps<3> &flags) 
+void GridOut::set_flags (const GridOutFlags::Eps<3> &flags)
 {
   eps_flags_3 = flags;
 }
 
 
 
-void GridOut::set_flags (const GridOutFlags::XFig &flags) 
+void GridOut::set_flags (const GridOutFlags::XFig &flags)
 {
   xfig_flags = flags;
 }
@@ -386,26 +392,26 @@ void GridOut::set_flags (const GridOutFlags::XFig &flags)
 
 
 std::string
-GridOut::default_suffix (const OutputFormat output_format) 
+GridOut::default_suffix (const OutputFormat output_format)
 {
-  switch (output_format) 
+  switch (output_format)
     {
       case none:
        return "";
       case dx:
         return ".dx";
-      case gnuplot: 
+      case gnuplot:
        return ".gnuplot";
-      case ucd: 
+      case ucd:
        return ".inp";
-      case eps: 
+      case eps:
        return ".eps";
       case xfig:
        return ".fig";
       case msh:
        return ".msh";
-      default: 
-           Assert (false, ExcNotImplemented()); 
+      default:
+           Assert (false, ExcNotImplemented());
            return "";
     };
 }
@@ -437,13 +443,13 @@ GridOut::parse_output_format (const std::string &format_name)
 
   if (format_name == "eps")
     return eps;
-  
+
   if (format_name == "xfig")
     return xfig;
-  
+
   if (format_name == "msh")
     return msh;
-  
+
   AssertThrow (false, ExcInvalidState ());
                                   // return something weird
   return OutputFormat(-1);
@@ -451,7 +457,7 @@ GridOut::parse_output_format (const std::string &format_name)
 
 
 
-std::string GridOut::get_output_format_names () 
+std::string GridOut::get_output_format_names ()
 {
   return "none|dx|gnuplot|eps|ucd|xfig|msh";
 }
@@ -466,26 +472,26 @@ GridOut::declare_parameters(ParameterHandler& param)
   param.enter_subsection("DX");
   GridOutFlags::DX::declare_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("Msh");
   GridOutFlags::Msh::declare_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("Ucd");
   GridOutFlags::Ucd::declare_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("Gnuplot");
   GridOutFlags::Gnuplot::declare_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("Eps");
   GridOutFlags::EpsFlagsBase::declare_parameters(param);
   GridOutFlags::Eps<1>::declare_parameters(param);
   GridOutFlags::Eps<2>::declare_parameters(param);
   GridOutFlags::Eps<3>::declare_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("XFig");
   GridOutFlags::XFig::declare_parameters(param);
   param.leave_subsection();
@@ -497,29 +503,29 @@ void
 GridOut::parse_parameters(ParameterHandler& param)
 {
   default_format = parse_output_format(param.get("Format"));
-  
+
   param.enter_subsection("DX");
   dx_flags.parse_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("Msh");
   msh_flags.parse_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("Ucd");
   ucd_flags.parse_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("Gnuplot");
   gnuplot_flags.parse_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("Eps");
   eps_flags_1.parse_parameters(param);
   eps_flags_2.parse_parameters(param);
   eps_flags_3.parse_parameters(param);
   param.leave_subsection();
-  
+
   param.enter_subsection("XFig");
   xfig_flags.parse_parameters(param);
   param.leave_subsection();
index 7c9441fc66499de722c172aa42ce4ecca0a940d2..474f14a26f99337c71d902da9079c88b6de08456 100644 (file)
 DEAL_II_NAMESPACE_OPEN
 
 
-GridOut::GridOut ()
-               :
-               default_format (none)
-{}
-
-
 #if deal_II_dimension == 1
 
 
index 8f7697c3dead9e1b2367b364128391170554c810..540805238884aac9cbd9fdff9cb47a9ab9feac8f 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2009 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2009, 2010 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
 
 DEAL_II_NAMESPACE_OPEN
 
-TimeDependent::TimeSteppingData::TimeSteppingData (const unsigned int look_ahead,
-                                                  const unsigned int look_back)
-               :
-               look_ahead (look_ahead),
-               look_back (look_back)
-{}
-
-
-TimeDependent::TimeDependent (const TimeSteppingData &data_primal,
-                             const TimeSteppingData &data_dual,
-                             const TimeSteppingData &data_postprocess):
-               sweep_no (numbers::invalid_unsigned_int),
-               timestepping_data_primal (data_primal),
-               timestepping_data_dual (data_dual),
-               timestepping_data_postprocess (data_postprocess)
-{}
-
-
-TimeDependent::~TimeDependent ()
-{
-  while (timesteps.size() != 0)
-    delete_timestep (0);
-}
-
-
-void
-TimeDependent::insert_timestep (const TimeStepBase *position,
-                               TimeStepBase       *new_timestep) 
-{
-  Assert ((std::find(timesteps.begin(), timesteps.end(), position) != timesteps.end()) ||
-         (position == 0),
-         ExcInvalidPosition());
-                                  // first insert the new time step
-                                  // into the doubly linked list
-                                  // of timesteps
-  if (position == 0)
-    {
-                                      // at the end
-      new_timestep->set_next_timestep (0);
-      if (timesteps.size() > 0)
-       {
-         timesteps.back()->set_next_timestep (new_timestep);
-         new_timestep->set_previous_timestep (timesteps.back());
-       }
-      else
-       new_timestep->set_previous_timestep (0);
-    }
-  else
-    if (position == timesteps[0])
-      {
-                                        // at the beginning
-       new_timestep->set_previous_timestep (0);
-       if (timesteps.size() > 0)
-         {
-           timesteps[0]->set_previous_timestep (new_timestep);
-           new_timestep->set_next_timestep (timesteps[0]);
-         }
-       else
-         new_timestep->set_next_timestep (0);
-      }
-    else
-      {
-                                        // inner time step
-       std::vector<SmartPointer<TimeStepBase,TimeDependent> >::iterator insert_position
-         = std::find(timesteps.begin(), timesteps.end(), position);
-       
-       (*(insert_position-1))->set_next_timestep (new_timestep);
-       new_timestep->set_previous_timestep (*(insert_position-1));
-       new_timestep->set_next_timestep (*insert_position);
-       (*insert_position)->set_previous_timestep (new_timestep);
-      };
-
-                                  // finally enter it into the
-                                  // array
-  timesteps.insert ((position == 0 ?
-                    timesteps.end() :
-                    std::find(timesteps.begin(), timesteps.end(), position)),
-                   new_timestep);
-}
-
-
-void
-TimeDependent::add_timestep (TimeStepBase *new_timestep)
-{
-  insert_timestep (0, new_timestep);
-}
-
-
-void TimeDependent::delete_timestep (const unsigned int position)
-{
-  Assert (position<timesteps.size(),
-         ExcInvalidPosition());
-  
-                                  // Remember time step object for
-                                  // later deletion and unlock
-                                  // SmartPointer
-  TimeStepBase* t = timesteps[position];
-  timesteps[position] = 0;
-                                  // Now delete unsubscribed object
-  delete t;
-  
-  timesteps.erase (timesteps.begin() + position);
-
-                                  // reset "next" pointer of previous
-                                  // time step if possible
-                                  //
-                                  // note that if now position==size,
-                                  // then we deleted the last time step
-  if (position != 0)
-    timesteps[position-1]->set_next_timestep ((position<timesteps.size()) ?
-                                             timesteps[position] :
-                                             /*null*/SmartPointer<TimeStepBase,TimeDependent>());
-
-                                  // same for "previous" pointer of next
-                                  // time step
-  if (position<timesteps.size())
-    timesteps[position]->set_previous_timestep ((position!=0) ?
-                                               timesteps[position-1] :
-                                               /*null*/SmartPointer<TimeStepBase,TimeDependent>());
-}
-
-
-void
-TimeDependent::solve_primal_problem () 
-{
-  do_loop (std::mem_fun(&TimeStepBase::init_for_primal_problem),
-          std::mem_fun(&TimeStepBase::solve_primal_problem),
-          timestepping_data_primal,
-          forward);
-}
-
-
-void
-TimeDependent::solve_dual_problem () 
-{
-  do_loop (std::mem_fun(&TimeStepBase::init_for_dual_problem),
-          std::mem_fun(&TimeStepBase::solve_dual_problem),
-          timestepping_data_dual,
-          backward);
-}
-
-
-void
-TimeDependent::postprocess () 
-{
-  do_loop (std::mem_fun(&TimeStepBase::init_for_postprocessing),
-          std::mem_fun(&TimeStepBase::postprocess_timestep),
-          timestepping_data_postprocess,
-          forward);
-}
-
-
-
-void TimeDependent::start_sweep (const unsigned int s) 
-{
-  sweep_no = s;
-
-                                  // reset the number each
-                                  // time step has, since some time
-                                  // steps might have been added since
-                                  // the last time we visited them
-                                  //
-                                  // also set the sweep we will
-                                  // process in the sequel
-  for (unsigned int step=0; step<timesteps.size(); ++step)
-    {
-      timesteps[step]->set_timestep_no (step);
-      timesteps[step]->set_sweep_no (sweep_no);
-    };
-
-  for (unsigned int step=0; step<timesteps.size(); ++step)
-    timesteps[step]->start_sweep ();
-}
-
-
-
-void TimeDependent::end_sweep (const unsigned int n_threads)
-{
-  if (DEAL_II_USE_MT && (n_threads > 1))
-    {
-      const unsigned int stride = timesteps.size() / n_threads;
-      Threads::ThreadGroup<> threads;
-      void (TimeDependent::*p) (const unsigned int, const unsigned int)
-        = &TimeDependent::end_sweep;
-      for (unsigned int i=0; i<n_threads; ++i)
-        threads += Threads::new_thread (p, *this, i*stride,
-                                       (i == n_threads-1 ?
-                                        timesteps.size() :
-                                        (i+1)*stride));
-      threads.join_all();
-    }
-  else
-                                     // now do the work
-    end_sweep (0, timesteps.size());
-}
-
-
-
-void TimeDependent::end_sweep (const unsigned int begin,
-                              const unsigned int end)
-{     
-  for (unsigned int step=begin; step<end; ++step)
-    timesteps[step]->end_sweep ();
-}
-
-
-
-unsigned int TimeDependent::memory_consumption () const
-{
-  unsigned int mem = (MemoryConsumption::memory_consumption (timesteps) +
-                     MemoryConsumption::memory_consumption (sweep_no) +
-                     sizeof(timestepping_data_primal) +
-                     sizeof(timestepping_data_dual) +
-                     sizeof(timestepping_data_postprocess));
-  for (unsigned int i=0; i<timesteps.size(); ++i)
-    mem += MemoryConsumption::memory_consumption (*timesteps[i]);
-
-  return mem;
-}
-
-
-
-/* --------------------------------------------------------------------- */
-
-
-TimeStepBase::TimeStepBase (const double time) :
-               previous_timestep(0),
-               next_timestep (0),
-               sweep_no (numbers::invalid_unsigned_int),
-               timestep_no (numbers::invalid_unsigned_int),
-               time (time)
-{}
-
-
-
-TimeStepBase::~TimeStepBase () 
-{}
-
-
-
-void
-TimeStepBase::wake_up (const unsigned )
-{}
-
-
-
-void
-TimeStepBase::sleep (const unsigned)
-{}
-
-
-
-void
-TimeStepBase::start_sweep () 
-{}
-
-
-
-void
-TimeStepBase::end_sweep () 
-{}
-
-
-
-void
-TimeStepBase::init_for_primal_problem () 
-{
-  next_action = primal_problem;
-}
-
-
-
-void
-TimeStepBase::init_for_dual_problem () 
-{
-  next_action = dual_problem;
-}
-
-
-
-void
-TimeStepBase::init_for_postprocessing () 
-{
-  next_action = postprocess;
-}
-
-
-
-void
-TimeStepBase::solve_dual_problem () 
-{
-  Assert (false, ExcPureFunctionCalled());
-}
-
-
-
-void
-TimeStepBase::postprocess_timestep () 
-{
-  Assert (false, ExcPureFunctionCalled());
-}
-
-
-
-double
-TimeStepBase::get_time () const 
-{
-  return time;
-}
-
-
-
-unsigned int
-TimeStepBase::get_timestep_no () const 
-{
-  return timestep_no;
-}
-
-
-
-double
-TimeStepBase::get_backward_timestep () const
-{
-  Assert (previous_timestep != 0, ExcCantComputeTimestep());
-  return time - previous_timestep->time;
-}
-
-
-
-double
-TimeStepBase::get_forward_timestep () const
-{
-  Assert (next_timestep != 0, ExcCantComputeTimestep());
-  return next_timestep->time - time;
-}
-
-
-
-void
-TimeStepBase::set_previous_timestep (const TimeStepBase *previous)
-{
-  previous_timestep = previous;
-}
-
-
-
-void
-TimeStepBase::set_next_timestep (const TimeStepBase *next)
-{
-  next_timestep     = next;
-}
-
-
-
-void
-TimeStepBase::set_timestep_no (const unsigned int step_no)
-{
-  timestep_no = step_no;
-}
-
-
-
-void
-TimeStepBase::set_sweep_no (const unsigned int sweep)
-{
-  sweep_no = sweep;
-}
-
-
-
-unsigned int
-TimeStepBase::memory_consumption () const
-{
-                                  // only simple data types
-  return sizeof(*this);
-}
-
-
-/* ------------------------------------------------------------------------- */
-
 
 template <int dim>
 TimeStepBase_Tria<dim>::TimeStepBase_Tria() :
@@ -436,7 +56,7 @@ TimeStepBase_Tria<dim>::TimeStepBase_Tria (const double              time,
 
 
 template <int dim>
-TimeStepBase_Tria<dim>::~TimeStepBase_Tria () 
+TimeStepBase_Tria<dim>::~TimeStepBase_Tria ()
 {
   if (!flags.delete_and_rebuild_tria)
     {
@@ -446,7 +66,7 @@ TimeStepBase_Tria<dim>::~TimeStepBase_Tria ()
     }
   else
     Assert (tria==0, ExcInternalError());
-  
+
   coarse_grid = 0;
 }
 
@@ -457,7 +77,7 @@ void
 TimeStepBase_Tria<dim>::wake_up (const unsigned wakeup_level)
 {
   TimeStepBase::wake_up (wakeup_level);
-  
+
   if (wakeup_level == flags.wakeup_level_to_build_grid)
     if (flags.delete_and_rebuild_tria || !tria)
       restore_grid ();
@@ -472,7 +92,7 @@ TimeStepBase_Tria<dim>::sleep (const unsigned sleep_level)
   if (sleep_level == flags.sleep_level_to_delete_grid)
     {
       Assert (tria!=0, ExcInternalError());
-      
+
       if (flags.delete_and_rebuild_tria)
        {
          Triangulation<dim>* t = tria;
@@ -514,7 +134,7 @@ void TimeStepBase_Tria<dim>::restore_grid ()
                                   // for each of the previous refinement
                                   // sweeps
   for (unsigned int previous_sweep=0; previous_sweep<refine_flags.size();
-       ++previous_sweep) 
+       ++previous_sweep)
     {
                                       // get flags
       tria->load_refine_flags  (refine_flags[previous_sweep]);
@@ -540,7 +160,7 @@ void TimeStepBase_Tria<dim>::restore_grid ()
 
 
 // have a few helper functions
-namespace 
+namespace
 {
   template <int dim>
   void
@@ -569,7 +189,7 @@ namespace
                                     // no problem at all, if it is on a lower
                                     // level than the present one, then it
                                     // will be refined below anyway.
-    if (new_cell->active()) 
+    if (new_cell->active())
       {
        if (new_cell->refine_flag_set() && old_cell->active())
          {
@@ -578,7 +198,7 @@ namespace
 
            old_cell->set_refine_flag();
          };
-      
+
        return;
       };
 
@@ -598,12 +218,12 @@ namespace
                    const typename Triangulation<dim>::cell_iterator &cell2)
   {
 
-    if (cell2->has_children() && cell1->has_children()) 
+    if (cell2->has_children() && cell1->has_children())
       {
        bool grids_changed = false;
 
        Assert(cell2->n_children()==cell1->n_children(), ExcNotImplemented());
-       for (unsigned int c=0; c<cell1->n_children(); ++c) 
+       for (unsigned int c=0; c<cell1->n_children(); ++c)
          grids_changed |= dealii::adapt_grid_cells<dim> (cell1->child(c),
                                                    cell2->child(c));
        return grids_changed;
@@ -627,7 +247,7 @@ namespace
              cell1->clear_coarsen_flag();
              return true;
            };
-      
+
        return false;
       };
 
@@ -657,11 +277,11 @@ namespace
            cell2->clear_coarsen_flag();
            changed_grid = true;
          };
-      
+
        if (!cell2->refine_flag_set())
          for (unsigned int c=0; c<cell1->n_children(); ++c)
            if (cell1->child(c)->refine_flag_set() ||
-               cell1->child(c)->has_children()) 
+               cell1->child(c)->has_children())
              {
                cell2->set_refine_flag();
                changed_grid = true;
@@ -679,7 +299,7 @@ namespace
            cell1->clear_coarsen_flag();
            changed_grid = true;
          };
-      
+
        if (!cell1->refine_flag_set())
          for (unsigned int c=0; c<cell2->n_children(); ++c)
            if (cell2->child(c)->refine_flag_set() ||
@@ -704,7 +324,7 @@ namespace
               Triangulation<dim> &tria2)
   {
     bool grids_changed = false;
-  
+
     typename Triangulation<dim>::cell_iterator cell1 = tria1.begin(),
                                               cell2 = tria2.begin();
     typename Triangulation<dim>::cell_iterator endc;
@@ -724,7 +344,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
 {
   Vector<float> criteria;
   get_tria_refinement_criteria (criteria);
-  
+
                                   // copy the following two values since
                                   // we may need modified values in the
                                   // process of this function
@@ -784,7 +404,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
                                   // since its computation is rather
                                   // expensive and since it doesn't change
   const unsigned int n_active_cells = tria->n_active_cells ();
-      
+
                                   // if not on first time level: try to
                                   // adjust the number of resulting
                                   // cells to those on the previous
@@ -836,7 +456,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
                                         // also)
        if (refinement_flags.adapt_grids)
          dealii::adapt_grids<dim> (*previous_tria, *tria);
-       
+
                                         // perform flagging of cells
                                         // needed to regularize the
                                         // triangulation
@@ -872,7 +492,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
            if (cell->coarsen_flag_set())
              previous_cells -= (GeometryInfo<dim>::max_children_per_cell-1) /
                                GeometryInfo<dim>::max_children_per_cell;
-           
+
                                         // @p{previous_cells} now gives the
                                         // number of cells which would result
                                         // from the flags on the previous grid
@@ -917,7 +537,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
              delta_down *= relaxations[r].second;
              break;
            };
-         
+
                                         // now, if the number of estimated
                                         // cells exceeds the number of cells
                                         // on the old time level by more than
@@ -927,7 +547,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
                                         // we unflag we have to diminish the
                                         // estimated number of cells by
                                         // @p{children_per_cell}.
-       if (estimated_cells > previous_cells*(1.+delta_up)) 
+       if (estimated_cells > previous_cells*(1.+delta_up))
          {
                                             // only limit the cell number
                                             // if there will not be less
@@ -1015,7 +635,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
                                               // of the flagged cells.
              if (loop != refinement_flags.cell_number_correction_steps-1)
                delta_cells *= 0.9;
-                 
+
                                               // if more cells need to be
                                               // refined, we need to lower
                                               // the thresholds, i.e. to
@@ -1043,7 +663,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
                    ExcInternalError());
            --p_refinement_threshold;
          };
-       
+
        coarsening_threshold = *p_coarsening_threshold;
        refinement_threshold = *p_refinement_threshold;
 
@@ -1067,7 +687,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
        GridRefinement::refine (*tria, criteria, refinement_threshold);
        GridRefinement::coarsen (*tria, criteria, coarsening_threshold);
       };
-  
+
                                   // if step number is greater than
                                   // one: adapt this and the previous
                                   // grid to each other. Don't do so
@@ -1103,10 +723,10 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
          for (; new_cell!=endc; ++new_cell, ++old_cell)
            dealii::mirror_refinement_flags<dim> (new_cell, old_cell);
        };
-      
+
       tria->prepare_coarsening_and_refinement ();
       previous_tria->prepare_coarsening_and_refinement ();
-      
+
                                       // adapt present and previous grids
                                       // to each other: flag additional
                                       // cells to avoid the previous grid
@@ -1119,7 +739,7 @@ void TimeStepBase_Tria<dim>::refine_grid (const RefinementData refinement_data)
 
 
 template <int dim>
-void TimeStepBase_Tria<dim>::init_for_refinement () 
+void TimeStepBase_Tria<dim>::init_for_refinement ()
 {
   next_action = grid_refinement;
 }
@@ -1169,7 +789,7 @@ TimeStepBase_Tria_Flags::Flags<dim>::Flags (const bool delete_and_rebuild_tria,
 
 template <int dim>
 typename TimeStepBase_Tria_Flags::RefinementFlags<dim>::CorrectionRelaxations
-TimeStepBase_Tria_Flags::RefinementFlags<dim>::default_correction_relaxations 
+TimeStepBase_Tria_Flags::RefinementFlags<dim>::default_correction_relaxations
 (1,    // one element, denoting the first and all subsequent sweeps
  std::vector<std::pair<unsigned int,double> >(1,    // one element, denoting the upper bound
                                                                               // for the following
@@ -1184,7 +804,7 @@ RefinementFlags (const unsigned int max_refinement_level,
                 const unsigned int min_cells_for_correction,
                 const double       cell_number_corridor_top,
                 const double       cell_number_corridor_bottom,
-                const CorrectionRelaxations &correction_relaxations,            
+                const CorrectionRelaxations &correction_relaxations,
                 const unsigned int cell_number_correction_steps,
                 const bool         mirror_flags_to_previous_grid,
                 const bool         adapt_grids) :
@@ -1247,7 +867,7 @@ RefinementData (const double         _refinement_threshold,
 // explicit instantiations
 template class TimeStepBase_Tria<deal_II_dimension>;
 
-namespace TimeStepBase_Tria_Flags 
+namespace TimeStepBase_Tria_Flags
 {
   template class Flags<deal_II_dimension>;
   template class RefinementFlags<deal_II_dimension>;

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.