]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Omit unused variables.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Jun 2011 16:33:32 +0000 (16:33 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Jun 2011 16:33:32 +0000 (16:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@23869 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
tests/bits/chunk_sparse_matrix_01a.cc
tests/deal.II/refinement_listener_02.cc
tests/deal.II/refinement_listener_03.cc
tests/fe/rt_9.cc
tests/hp/hp_hanging_nodes_01.cc
tests/mpi/constraint_matrix_trilinos_bug.cc
tests/mpi/interpolate_01.cc
tests/mpi/p4est_2d_constraintmatrix_02.cc
tests/mpi/p4est_2d_constraintmatrix_03.cc
tests/mpi/p4est_2d_constraintmatrix_04.cc
tests/mpi/p4est_2d_constraintmatrix_05.cc
tests/mpi/p4est_3d_constraintmatrix_03.cc

index c2f2fbca3c5ad6ad33987c78f90cc9cb3a757aea..b5e51e0f0722d7c078020bab5ee013d308fec292 100644 (file)
@@ -62,10 +62,9 @@ void test (const unsigned int chunk_size)
                                           // chunk_size>1, then this isn't
                                           // necessarily true
           bool exc_thrown = false;
-          double d;
           try
             {
-              d = m(i,j);
+              m(i,j);
             }
           catch (const std::exception &)
             {
index 7da2a2e29d16eec3b6a09ebfa09fde37751bd3b5..ef529bff69899fa976d7ac14f11805ca327b3a4e 100644 (file)
@@ -37,7 +37,7 @@ pre_refinement_notification (const std::string &prefix,
   deallog << prefix << ' ' << "Pre-refinement: " << tria.n_active_cells() << std::endl;
 }
 
-    
+
 template <int dim, int spacedim>
 void
 post_refinement_notification (const std::string &prefix,
@@ -46,7 +46,7 @@ post_refinement_notification (const std::string &prefix,
   deallog << prefix << ' ' << "Post-refinement: " << tria.n_active_cells() << std::endl;
 }
 
-    
+
 template <int dim, int spacedim>
 void
 copy_notification (const std::string &prefix,
@@ -58,7 +58,7 @@ copy_notification (const std::string &prefix,
          << new_tria.n_active_cells() << std::endl;
 }
 
-    
+
 template <int dim, int spacedim>
 void
 create_notification (const std::string &prefix,
@@ -115,8 +115,8 @@ void test ()
                                  std_cxx1x::_1,
                                  std_cxx1x::cref(tria_2)))
   };
-  
-  
+
+
 
                                   // this should print the create note
   GridGenerator::hyper_cube(tria_1);
@@ -134,6 +134,8 @@ void test ()
     connections_1[i].disconnect ();
 
   tria_1.refine_global (2);
+
+  (void)connections_2;
 }
 
 
index 45f020c53cb2dc5e9f755fa6f3dc24d03dc755c3..99bf8ec5bc6f901beb1b36a4e2f14f545cc8689c 100644 (file)
@@ -36,7 +36,7 @@ pre_refinement_notification (const std::string &prefix,
   deallog << prefix << ' ' << "Pre-refinement: " << tria.n_active_cells() << std::endl;
 }
 
-    
+
 template <int dim, int spacedim>
 void
 post_refinement_notification (const std::string &prefix,
@@ -45,7 +45,7 @@ post_refinement_notification (const std::string &prefix,
   deallog << prefix << ' ' << "Post-refinement: " << tria.n_active_cells() << std::endl;
 }
 
-    
+
 template <int dim, int spacedim>
 void
 copy_notification (const std::string &prefix,
@@ -57,7 +57,7 @@ copy_notification (const std::string &prefix,
          << new_tria.n_active_cells() << std::endl;
 }
 
-    
+
 template <int dim, int spacedim>
 void
 create_notification (const std::string &prefix,
@@ -132,8 +132,8 @@ void test ()
                                  "tria_2",
                                  std_cxx1x::cref(tria_2)))
   };
-  
-  
+
+
 
                                   // this should print the create note
   GridGenerator::hyper_cube(tria_1);
@@ -157,6 +157,9 @@ void test ()
                                   // and now really nothing
   connections_1[4].disconnect ();
   tria_1.refine_global (1);
+
+                               // avoid compiler warning
+  (void)connections_2;
 }
 
 
index 7e4fe27e1792422a0efba93b5d02860d1cb6d6fa..44125cbda64a027a234637503b658e65820638cc 100644 (file)
@@ -49,7 +49,6 @@ test (const unsigned int degree)
   GridGenerator::hyper_cube(tr, 0., 1.);
 
   DoFHandler<dim> dof(tr);
-  typename DoFHandler<dim>::cell_iterator c = dof.begin();
   dof.distribute_dofs(fe_rt);
 
   QTrapez<1> q_trapez;
index 52bea53c1eaccb2a806642f8a2638411ce310afc..a2a82edbca563e8651e1ca0977d4cdd7d60ccb93 100644 (file)
@@ -61,13 +61,13 @@ int generate_grid (Triangulation<dim> &tria)
       p1(d) = 0;
       p2(d) = (d == 0) ? 2.0 : 1.0;
       sub_div.push_back ( (d == 0) ? 2 : 1);
-    }  
+    }
   GridGenerator::subdivided_hyper_rectangle (tria, sub_div, p1, p2, true);
 
                                   // Refine the first cell.
   tria.begin_active ()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  
+
   return (0);
 }
 
@@ -99,19 +99,19 @@ void test_constraints (hp::FECollection<dim> &fe_coll)
       cell->set_active_fe_index (fe_indx);
       ++fe_indx;
     }
-  
+
                                   // Distribute DoFs;
   dof_handler.distribute_dofs (fe_coll);
   deallog << "DoFs: " << dof_handler.n_dofs () << std::endl;
-  
+
                                   // Create the constraints.
   ConstraintMatrix constraint_matrix;
-  
+
   DoFTools::make_hanging_node_constraints (dof_handler,
                                           constraint_matrix);
 
                                   // Output the constraints
-  constraint_matrix.print (deallog.get_file_stream ());  
+  constraint_matrix.print (deallog.get_file_stream ());
 }
 
 
@@ -133,16 +133,14 @@ void test_constraints_old (FiniteElement<dim> &fe)
                                   // active_fe_indices to
                                   // the different cells.
   DoFHandler<dim> dof_handler (tria);
-  typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active (),
-                                                endc = dof_handler.end ();
-  
+
                                   // Distribute DoFs;
   dof_handler.distribute_dofs (fe);
   deallog << "DoFs: " << dof_handler.n_dofs () << std::endl;
-  
+
                                   // Create the constraints.
   ConstraintMatrix constraint_matrix;
-  
+
   DoFTools::make_hanging_node_constraints (dof_handler,
                                           constraint_matrix);
 
@@ -150,15 +148,15 @@ void test_constraints_old (FiniteElement<dim> &fe)
   constraint_matrix.print (deallog.get_file_stream ());
 }
 
-int main () 
+int main ()
 {
   std::ofstream logfile("hp_hanging_nodes_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   FE_Q<2> fe_1 (1);
   FE_Q<2> fe_2 (2);
   FE_Q<2> fe_3 (3);
@@ -169,8 +167,8 @@ int main ()
   fe_coll2.push_back (fe_2);
 
   fe_coll2.push_back (fe_2);
-  fe_coll2.push_back (fe_3); 
-  
+  fe_coll2.push_back (fe_3);
+
   test_constraints<2> (fe_coll2);
 
   test_constraints_old<2> (fe_1);
index 7116fc1135bb9401b06e5d9d6ba3b2879aa16996..e398dbbad0edf09395303544565e9f99811044e9 100644 (file)
@@ -95,7 +95,6 @@ template<int dim>
 void test()
 {
   unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
-  unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD);
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   
@@ -175,8 +174,8 @@ void test()
     x_rel = x;
 
                                     //l2_norm() not possible for ghosted vectors...
-    double a=0;//x_test.l2_norm();
-    double b=0;//x_rel.l2_norm();
+    //double a=0;//x_test.l2_norm();
+    //double b=0;//x_rel.l2_norm();
     
 /*    if (myid==0)
       deallog << a << " vs " << b << std::endl;
index 9080641c4535307dac4a35098e6f049eb9ef3840..31f5e35e166889fb594031c4c66a6c97ea02f7fd 100644 (file)
@@ -50,7 +50,6 @@ template<int dim>
 void test()
 {
   unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
-  unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD);
 
                                   // create a mesh so that all but one
                                   // processor are empty
@@ -80,10 +79,11 @@ void test()
 int main(int argc, char *argv[])
 {
 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
-  MPI_Init (&argc,&argv);
+  Utilities::System::MPI_InitFinalize mpi (argc, argv);
 #else
   (void)argc;
   (void)argv;
+  compile_time_error;
 #endif
 
   unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
@@ -110,8 +110,4 @@ int main(int argc, char *argv[])
       test<2>();
       test<3>();
     }
-
-#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
-  MPI_Finalize();
-#endif
 }
index 6d2631582f7aa60a9cffc7952e1f6ff164526c69..e5833492300dc9d7269a9080b1b07bbb1440c989 100644 (file)
@@ -40,7 +40,6 @@ template<int dim>
 void test()
 {
   unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
-  unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD);
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index 4e0d9c9de3d4139f784f7740c9eacace6b1dc1a3..95e6597a42aecfa6e5bced4cd0685cd0138e8483 100644 (file)
@@ -94,14 +94,13 @@ template<int dim>
 void test()
 {
   unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
-  unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD);
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
   const double R0      = 6371000.-2890000.;
   const double R1      = 6371000.-  35000.;
 
-  
+
   GridGenerator::hyper_shell (tr,
                              Point<dim>(),
                              R0,
@@ -111,7 +110,7 @@ void test()
   static HyperShellBoundary<dim> boundary;
   tr.set_boundary (0, boundary);
   tr.set_boundary (1, boundary);
-  
+
   tr.refine_global (1);
   for (unsigned int step=0; step<20;++step)
         {
@@ -125,7 +124,7 @@ void test()
 
          tr.execute_coarsening_and_refinement ();
         }
+
   DoFHandler<dim> dofh(tr);
 
   static FESystem<dim> fe (FE_Q<dim>(1+1), dim,
@@ -134,7 +133,7 @@ void test()
   dofh.distribute_dofs (fe);
 
   IndexSet owned_set = dofh.locally_owned_dofs();
-  
+
   IndexSet dof_set;
   DoFTools::extract_locally_active_dofs (dofh, dof_set);
 
@@ -150,27 +149,27 @@ void test()
   x_rel.reinit(relevant_set, MPI_COMM_WORLD);
   x_rel = 0;
   x_rel.compress();
-  
+
   ConstraintMatrix cm(relevant_set);
   DoFTools::make_hanging_node_constraints (dofh, cm);
   std::vector<bool> velocity_mask (dim+1, true);
-  
+
   velocity_mask[dim] = false;
-                                   
+
   VectorTools::interpolate_boundary_values (dofh,
                                              0,
                                              ZeroFunction<dim>(dim+1),
                                              cm,
-                                             velocity_mask);                              
+                                             velocity_mask);
 
     std::set<unsigned char> no_normal_flux_boundaries;
     no_normal_flux_boundaries.insert (1);
 
-                                    
+
     VectorTools::compute_no_normal_flux_constraints (dofh, 0,
                                                     no_normal_flux_boundaries,
                                                     cm);
-                                    
+
     cm.close ();
 
     cm.distribute(x);
@@ -188,7 +187,7 @@ void test()
     for (unsigned int i=0; i<dim; ++i)
       data_component_interpretation[i]
        = DataComponentInterpretation::component_is_part_of_vector;
-    
+
     data_out.add_data_vector(x_rel, joint_solution_names,
                             DataOut<dim>::type_dof_data,
                             data_component_interpretation);
@@ -203,16 +202,16 @@ void test()
     TrilinosWrappers::Vector x_dub;
     x_dub.reinit(dof_set.size());
     x_dub = x_rel;
-  
+
     if (myid==0)
       {
        std::ofstream file((std::string("p4est_2d_constraintmatrix_03/dat.") + Utilities::int_to_string(myid)).c_str());
        file << "**** proc " << myid << std::endl;
        x_dub.print(file);
       }
-    
+
     MPI_Barrier(MPI_COMM_WORLD);
-  
+
     if (myid==0)
       {
        cat_file((std::string("p4est_2d_constraintmatrix_03/dat.") + Utilities::int_to_string(0)).c_str());
index b0388ea5785844a10c051fa68248e04e1ac424b0..b2d022d761fe45fa943e4889fce0a0d7186556d3 100644 (file)
@@ -114,21 +114,6 @@ double
 TemperatureInitialValues<dim>::value (const Point<dim>  &p,
                                      const unsigned int) const
 {
-  const double r = p.norm();
-  const double h = R1-R0;
-
-  const double s = (r-R0)/h;
-// see http://www.wolframalpha.com/input/?i=plot+(sqrt(x^2%2By^2)*0.95%2B0.05*sin(6*atan2(x,y))),+x%3D-1+to+1,+y%3D-1+to+1
-
-  double s_mod = s*0.95 + 0.05*sin(6.0*atan2(p(0),p(1)));
-//alternative:    http://www.wolframalpha.com/input/?i=plot+atan((sqrt(x^2%2By^2)*0.95%2B0.05*sin(6*atan2(x,y))-0.5)*10)/pi%2B0.5,+x%3D-1+to+1,+y%3D-1+to+1
-//    s_mod = atan((s_mod-0.5)*10.0)/dealii::numbers::PI+0.5;
-
-//    return T1+(T0-T1)*(1.0-s_mod);
-
-                                  //old:
-//    return T1+(T0-T1)*((1-s)*(1-s)); //old
-//    return T1+(T0-T1)*((1-s)); //linear
   return p(0)*T1+p(1)*(T0-T1); //simple
 }
 
@@ -146,15 +131,12 @@ TemperatureInitialValues<dim>::vector_value (const Point<dim> &p,
 template<int dim>
 void test()
 {
-  unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
-  unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD);
-
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
 
 //  GridGenerator::hyper_cube(tr);
-  
-  
+
+
   GridGenerator::hyper_shell (tr,
                              Point<dim>(),
                              R0,
@@ -164,7 +146,7 @@ void test()
   static HyperShellBoundary<dim> boundary;
 //  tr.set_boundary (0, boundary);
 // tr.set_boundary (1, boundary);
-  
+
   tr.refine_global (3);
   if (1)
     for (unsigned int step=0; step<5;++step)
@@ -172,22 +154,22 @@ void test()
        typename Triangulation<dim>::active_cell_iterator
          cell = tr.begin_active(),
          endc = tr.end();
-      
+
        for (; cell!=endc; ++cell)
          if (std::rand()%42==1)
            cell->set_refine_flag ();
-      
+
        tr.execute_coarsening_and_refinement ();
       }
+
   DoFHandler<dim> dofh(tr);
 
   static FE_Q<dim> fe(2);
-  
+
   dofh.distribute_dofs (fe);
 
   IndexSet owned_set = dofh.locally_owned_dofs();
-  
+
   IndexSet dof_set;
   DoFTools::extract_locally_active_dofs (dofh, dof_set);
 
@@ -204,14 +186,14 @@ void test()
   TrilinosWrappers::MPI::Vector x_rel;
   x_rel.reinit(relevant_set, MPI_COMM_WORLD);
   x_rel = x;
-  
+
   for (unsigned int steps=0;steps<3;++steps)
-    { 
+    {
       {
        typename Triangulation<dim>::active_cell_iterator
          cell = tr.begin_active(),
          endc = tr.end();
-       
+
        for (; cell!=endc; ++cell)
          if (!cell->is_artificial() && !cell->is_ghost())
            {
@@ -219,7 +201,7 @@ void test()
                cell->set_refine_flag ();
              else if (std::rand()%7==1)
                cell->set_coarsen_flag ();
-           }   
+           }
       }
       for (typename Triangulation<dim>::cell_iterator
             cell = tr.begin();
@@ -227,7 +209,7 @@ void test()
        {
          if (!cell->has_children())
            continue;
-         
+
          bool coarsen_me = false;
          for (unsigned int i=0;i<cell->n_children();++i)
            if (cell->child(i)->coarsen_flag_set())
@@ -257,22 +239,22 @@ void test()
 
 
 
-       
+
       parallel::distributed::SolutionTransfer<dim,TrilinosWrappers::MPI::Vector>
        trans(dofh);
       tr.prepare_coarsening_and_refinement();
-       
+
 
       trans.prepare_for_coarsening_and_refinement(x_rel);
-       
-      tr.execute_coarsening_and_refinement (); 
+
+      tr.execute_coarsening_and_refinement ();
 
       static FE_Q<dim> fe(1);
-  
+
       dofh.distribute_dofs (fe);
 
       owned_set = dofh.locally_owned_dofs();
-  
+
       DoFTools::extract_locally_active_dofs (dofh, dof_set);
 
       DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
@@ -280,17 +262,17 @@ void test()
       x.reinit(owned_set, MPI_COMM_WORLD);
 
       trans.interpolate(x);
-      
+
       x_rel.reinit(relevant_set, MPI_COMM_WORLD);
       x_rel = 0;
       x_rel.compress();
-  
+
       ConstraintMatrix cm(relevant_set);
       DoFTools::make_hanging_node_constraints (dofh, cm);
 /*  std::vector<bool> velocity_mask (dim+1, true);
-  
+
     velocity_mask[dim] = false;
-                                   
+
     VectorTools::interpolate_boundary_values (dofh,
     0,
     ZeroFunction<dim>(1),
@@ -306,27 +288,27 @@ void test()
 
   TrilinosWrappers::MPI::Vector x_ref;
   x_ref.reinit(owned_set, MPI_COMM_WORLD);
-  
+
   VectorTools::interpolate(dofh,
                           TemperatureInitialValues<dim>(),
                           x_ref);
   x_ref.compress();
-  
+
   x_ref -= x;
   double err = x_ref.linfty_norm();
   if (err>1.0e-12)
     if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0)
       deallog << "err:" << err << std::endl;
-  
+
 //     x_rel=x_ref; //uncomment to output error
-  
+
   std::vector<std::string> solution_names(1,"T");
-  
+
   FilteredDataOut<dim> data_out (tr.locally_owned_subdomain());
   data_out.attach_dof_handler (dofh);
-  
+
   data_out.add_data_vector(x_rel, solution_names);
-  
+
   data_out.build_patches (1);
   const std::string filename = ("p4est_2d_constraintmatrix_04/solution." +
                                Utilities::int_to_string
@@ -334,7 +316,7 @@ void test()
                                ".d2");
   std::ofstream output (filename.c_str());
   data_out.write_deal_II_intermediate (output);
-  
+
   tr.set_boundary (0);
   tr.set_boundary (1);
   if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0)
index 1a2c3a443da3aa77c3499650b7bfa3b9c1ca394e..6bab43c5f58616d7e200a3cf206633da50118857 100644 (file)
@@ -33,9 +33,6 @@
 template<int dim>
 void test()
 {
-  unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
-  unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD);
-
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
   GridGenerator::hyper_cube(tr);
index 1255376e6fe25cd84b7c208e184ba4734c3c389f..9628e548f0fcc1a16b8e20c5bdeae6a1e8190015 100644 (file)
@@ -113,21 +113,6 @@ double
 TemperatureInitialValues<dim>::value (const Point<dim>  &p,
                                      const unsigned int) const
 {
-  const double r = p.norm();
-  const double h = R1-R0;
-
-  const double s = (r-R0)/h;
-// see http://www.wolframalpha.com/input/?i=plot+(sqrt(x^2%2By^2)*0.95%2B0.05*sin(6*atan2(x,y))),+x%3D-1+to+1,+y%3D-1+to+1
-
-  double s_mod = s*0.95 + 0.05*sin(6.0*atan2(p(0),p(1)));
-//alternative:    http://www.wolframalpha.com/input/?i=plot+atan((sqrt(x^2%2By^2)*0.95%2B0.05*sin(6*atan2(x,y))-0.5)*10)/pi%2B0.5,+x%3D-1+to+1,+y%3D-1+to+1
-//    s_mod = atan((s_mod-0.5)*10.0)/dealii::numbers::PI+0.5;
-
-//    return T1+(T0-T1)*(1.0-s_mod);
-
-                                  //old:
-//    return T1+(T0-T1)*((1-s)*(1-s)); //old
-//    return T1+(T0-T1)*((1-s)); //linear
   return p(0)*T1+p(1)*(T0-T1); //simple
 }
 
@@ -145,9 +130,6 @@ TemperatureInitialValues<dim>::vector_value (const Point<dim> &p,
 template<int dim>
 void test()
 {
-  unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
-  unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD);
-
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
 

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.