]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Convert some more tests to use initlog. 5608/head
authorDavid Wells <wellsd2@rpi.edu>
Sat, 9 Dec 2017 23:09:23 +0000 (18:09 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 9 Dec 2017 23:09:23 +0000 (18:09 -0500)
36 files changed:
tests/full_matrix/full_matrix.cc
tests/full_matrix/full_matrix_02.cc
tests/full_matrix/full_matrix_03.cc
tests/full_matrix/full_matrix_04.cc
tests/full_matrix/full_matrix_05.cc
tests/full_matrix/full_matrix_06.cc
tests/full_matrix/full_matrix_07.cc
tests/full_matrix/full_matrix_08.cc
tests/full_matrix/full_matrix_common.h
tests/full_matrix/full_matrix_print.cc
tests/grid/distort_random.cc
tests/grid/extent_in_direction.cc
tests/grid/extrude_orientation_01.cc
tests/grid/extrude_orientation_02.cc
tests/grid/face_orientations_3d.cc
tests/grid/filtered_iterator.cc
tests/grid/filtered_iterator_02.cc
tests/grid/filtered_iterator_03.cc
tests/grid/get_finest_common_cells_01.cc
tests/grid/get_finest_common_cells_02.cc
tests/grid/get_finest_common_cells_03.cc
tests/grid/grid_generator_01.cc
tests/grid/grid_generator_01a.cc
tests/grid/grid_generator_01b.cc
tests/grid/grid_generator_02.cc
tests/grid/grid_generator_03.cc
tests/grid/grid_generator_04.cc
tests/grid/grid_generator_05.cc
tests/grid/grid_generator_06.cc
tests/grid/grid_generator_07.cc
tests/grid/grid_generator_08.cc
tests/grid/grid_generator_09.cc
tests/grid/grid_generator_09.output
tests/grid/grid_generator_hyper_sphere.cc
tests/grid/twisted_parallelepiped_01.cc
tests/grid/twisted_parallelepiped_01.debug.output

index be0acfd868cfd58aa9aef6cb2286953742e33f65..484484c6290e35595ec09ed1da6f338d2ad71e7c 100644 (file)
@@ -39,12 +39,13 @@ void random_matrix(FullMatrix<double> &A)
 int
 main ()
 {
-  std::ofstream logfile("output");
+  initlog();
   deallog << std::fixed;
   deallog << std::setprecision(3);
-  deallog.attach(logfile);
   Testing::srand(3391466);
 
+  std::ostream &logfile = deallog.get_file_stream();
+
   FullMatrix<double> T(3,3,entries);
   T.print_formatted(logfile, 0, false);
 
@@ -176,5 +177,3 @@ main ()
         }
     }
 }
-
-
index d865c132c084a5e3f3b8d0bdbe33ab1866d821b9..300fd4b125ee237c6e7fe8b8df69ccd1dee8d3e6 100644 (file)
@@ -31,10 +31,9 @@ const double entries_Z[9] = { 0,0,0,0,0,0,0,0,0 };
 int
 main ()
 {
-  std::ofstream logfile("output");
+  initlog();
   deallog << std::fixed;
   deallog << std::setprecision(3);
-  deallog.attach(logfile);
   Testing::srand(3391466);
 
   FullMatrix<double> A(3,3,entries_A);
index dc284bdfb03c8d8b9e0ed425c5e0edc2ae8be3e0..174860fec6c7939ea4124314b5065653ebe2beea 100644 (file)
@@ -31,10 +31,9 @@ const double entries_Z[9] = { 0,0,0,0,0,0,0,0,0 };
 int
 main ()
 {
-  std::ofstream logfile("output");
+  initlog();
   deallog << std::fixed;
   deallog << std::setprecision(3);
-  deallog.attach(logfile);
   Testing::srand(3391466);
 
   FullMatrix<double> A(3,3,entries_A);
index e5cded4b15a94fe7bb5a58ca95d253c3691a57e9..4c816230b896e76f7aa80baee61f375570c02a22 100644 (file)
@@ -112,9 +112,7 @@ void test (const unsigned int n, const unsigned int m)
 int
 main ()
 {
-  const std::string logname = "output";
-  std::ofstream logfile(logname.c_str());
-  deallog.attach(logfile);
+  initlog();
 
   test(3,4);
   test(4,7);
index 46e37b9a40125768cc7953d5208c2c2e5a83bf9f..f5225adea38b47bcaa3630eaebf00f599d4316c2 100644 (file)
@@ -56,9 +56,7 @@ void test ()
 int
 main ()
 {
-  const std::string logname = "output";
-  std::ofstream logfile(logname.c_str());
-  deallog.attach(logfile);
+  initlog();
 
   test();
 }
index 854256ffad486e4125bbd81faf17aa447a2b8ab2..19149a26504deec39313f1b45d8c6562efd0a7d0 100644 (file)
@@ -66,9 +66,7 @@ void test ()
 int
 main ()
 {
-  const std::string logname = "output";
-  std::ofstream logfile(logname.c_str());
-  deallog.attach(logfile);
+  initlog();
 
   test();
 }
index 982c9affdf3769bd527ad662f53fb0f67b70c9d6..343dc41597c76797c1b2da5f5fe894f4aaf26d58 100644 (file)
@@ -26,10 +26,9 @@ const double compare[9] = { 14,32,50,32,77,122,50,122,194 };
 int
 main ()
 {
-  std::ofstream logfile("output");
+  initlog();
   deallog << std::fixed;
   deallog << std::setprecision(3);
-  deallog.attach(logfile);
 
   FullMatrix<double> A(3,3,entries_A);
   FullMatrix<double> C(3,3);
index d90193e407727c17b0f1e3f3bdc4650e2150a6c0..fc9216d022e57846e41999e498fc0dce1d80eb9b 100644 (file)
@@ -26,10 +26,9 @@ const double compare[9] = { 66,78,90,78,93,108,90,108,126 };
 int
 main ()
 {
-  std::ofstream logfile("output");
+  initlog();
   deallog << std::fixed;
   deallog << std::setprecision(3);
-  deallog.attach(logfile);
 
   FullMatrix<double> A(3,3,entries_A);
   FullMatrix<double> C(3,3);
index c4b71a4fb55cde39258300df1643682f4ff40413..394e36019397543d8d100ba8b6b160a730d0d15b 100644 (file)
@@ -156,9 +156,8 @@ main()
 {
   try
     {
-      std::ofstream logfile("output");
       deallog << std::setprecision (2);
-      deallog.attach(logfile);
+      initlog();
       deallog.depth_console(0);
 
       check<double> ();
index 53ede2b030094fc72de8e38f4b8627269b92348a..e2f496b570600193779c02b4fb89ad962a8d59ba 100644 (file)
@@ -26,11 +26,10 @@ const double entries[9] = { 11.1,12.2,13.3,21.456,22.12345678901,23,31,32,33 };
 int
 main ()
 {
-  std::ofstream logfile("output");
+  initlog();
+  std::ostream &logfile = deallog.get_file_stream();
   deallog << std::fixed;
   deallog << std::setprecision(3);
-  deallog.attach(logfile);
-
   logfile << numbers::PI << std::endl;
 
   FullMatrix<double> T(3,3,entries);
@@ -47,5 +46,3 @@ main ()
 
   logfile << numbers::PI << std::endl;
 }
-
-
index 8e45d1daaa7791c32c4a36e1b4a79451c5d385c6..a78bb7343ac02b3c0ed756f3743d9f41e9e00994 100644 (file)
 #include <deal.II/grid/grid_out.h>
 
 
-std::ofstream logfile("output");
-
-
-
 template <int dim>
 void test1 (const bool keep_boundary)
 {
@@ -37,6 +33,7 @@ void test1 (const bool keep_boundary)
 
   GridTools::distort_random (0.1, tria, keep_boundary);
 
+  std::ostream &logfile = deallog.get_file_stream();
   deallog << "dim=" << dim << ", keep_boundary=" << keep_boundary << std::endl;
   GridOut().write_gnuplot (tria, logfile);
 }
@@ -45,9 +42,8 @@ void test1 (const bool keep_boundary)
 
 int main ()
 {
-  deallog << std::setprecision(4);
-  logfile << std::setprecision(4);
-  deallog.attach(logfile);
+  initlog();
+  deallog.get_file_stream() << std::setprecision(4);
 
   test1<1> (true);
   test1<1> (false);
@@ -58,4 +54,3 @@ int main ()
 
   return 0;
 }
-
index a0a6d26adadc27926b4ec052fc9145d682e6b894..2b3fcc1d84bd789dbea67c1aa0dbb51cf8ff5065 100644 (file)
@@ -105,12 +105,10 @@ void test()
 
 int main()
 {
-  std::ofstream logfile ("output");
+  initlog();
   deallog << std::setprecision (PRECISION);
-  deallog.attach(logfile);
 
   test<1>();
   test<2>();
   test<3>();
 }
-
index 7cb078c2198009b33f148354dd0a326cea6a0a38..192eda9c7d31428577025deeacbb19547b4b8c60 100644 (file)
@@ -69,8 +69,7 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
-  test(logfile);
+  test(deallog.get_file_stream());
 }
index 22247433202496206d893c8247cc74178d9c0bcf..99e884db3513649195054108dd0fef0cbb4d0a1a 100644 (file)
@@ -69,8 +69,7 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
-  test(logfile);
+  test(deallog.get_file_stream());
 }
index 5ee3374c6da329e37bd626511fed49e82c2d07cc..085f1a78efeb676d262f9166e1f263939928af2c 100644 (file)
@@ -31,9 +31,6 @@
 
 
 
-std::ofstream logfile("output");
-
-
 void test (const char *filename)
 {
   Triangulation<3> tria;
@@ -72,7 +69,7 @@ void test (const char *filename)
 int main ()
 {
   deallog << std::setprecision (2);
-  deallog.attach(logfile);
+  initlog();
 
   test (SOURCE_DIR "/grid_in_3d/1.in");
   test (SOURCE_DIR "/grid_in_3d/2.in");
@@ -82,4 +79,3 @@ int main ()
   test (SOURCE_DIR "/grid_in_3d/evil_0.in");
   test (SOURCE_DIR "/grid_in_3d/evil_4.in");
 }
-
index 9a7ba088427f850d36d00ab2134cbe58ec74678d..54c53bec0a7531196822dd417959a84b00856f73 100644 (file)
@@ -28,9 +28,6 @@
 #include <numeric>
 
 
-std::ofstream logfile("output");
-
-
 DeclException2 (ExcNumberMismatch,
                 int, int,
                 << "The numbers " << arg1 << " and " << arg2
@@ -83,6 +80,7 @@ void test ()
       cell->set_subdomain_id (subdomain);
     };
 
+  std::ostream &logfile = deallog.get_file_stream();
 
   // check 1: count number of cells
   // on some level
@@ -218,11 +216,9 @@ void test ()
 
 int main ()
 {
-  deallog << std::setprecision(4);
-  deallog.attach(logfile);
-
+  initlog ();
+  deallog.get_file_stream() << std::setprecision(4);
   test ();
 
   return 0;
 }
-
index 7cae4a080a4851116d96996cb9c2b1638ba8b521..a639de6d815b981071c9aec14131743b2b87f0d1 100644 (file)
@@ -28,9 +28,6 @@
 #include <numeric>
 
 
-std::ofstream logfile("output");
-
-
 DeclException2 (ExcNumberMismatch,
                 int, int,
                 << "The numbers " << arg1 << " and " << arg2
@@ -83,6 +80,7 @@ void test ()
       cell->set_subdomain_id (subdomain);
     };
 
+  std::ostream &logfile = deallog.get_file_stream();
 
   // check 1: count number of cells
   // on some level
@@ -217,11 +215,10 @@ void test ()
 
 int main ()
 {
-  deallog << std::setprecision(4);
-  deallog.attach(logfile);
+  initlog();
+  deallog.get_file_stream() << std::setprecision(4);
 
   test ();
 
   return 0;
 }
-
index 742cca4d30b73eb63fb97800eacf71c58ad5a2b3..b2d7fede1c51d60cdb61a997718f4b9986a89160 100644 (file)
@@ -28,9 +28,6 @@
 #include <numeric>
 
 
-std::ofstream logfile("output");
-
-
 DeclException2 (ExcNumberMismatch,
                 int, int,
                 << "The numbers " << arg1 << " and " << arg2
@@ -77,6 +74,7 @@ void test ()
       cell->set_subdomain_id (subdomain);
     };
 
+  std::ostream &logfile = deallog.get_file_stream();
 
   // check 1: count number of cells
   // on some level
@@ -103,11 +101,10 @@ void test ()
 
 int main ()
 {
-  deallog << std::setprecision(4);
-  deallog.attach(logfile);
+  initlog();
+  deallog.get_file_stream() << std::setprecision(4);
 
   test ();
 
   return 0;
 }
-
index 2c2c7e3a0cccc21591b7c92b3479a23b526ac302..11fae2b0bce6c4ff6a5d90a91d41755575ae0302 100644 (file)
@@ -64,11 +64,9 @@ void test()
 
 int main()
 {
-  std::ofstream logfile ("output");
-  deallog.attach(logfile);
+  initlog();
 
   test<1>();
   test<2>();
   test<3>();
 }
-
index cc0d4644eb47f5272d3384321fb3ca3af509ebd0..6ef44f39d359febb7479ec9a862be0f2ee5a1e71 100644 (file)
@@ -67,11 +67,9 @@ void test()
 
 int main()
 {
-  std::ofstream logfile ("output");
-  deallog.attach(logfile);
+  initlog();
 
   test<1>();
   test<2>();
   test<3>();
 }
-
index 2e06d3d6e2f4341f329ee8c1fb4ce0603a43509d..ef1ded774bc2039a6f42241b15ad88c8a02474e0 100644 (file)
@@ -67,11 +67,9 @@ void test()
 
 int main()
 {
-  std::ofstream logfile ("output");
-  deallog.attach(logfile);
+  initlog();
 
   test<1>();
   test<2>();
   test<3>();
 }
-
index c6726570a701d9967889a6e347bb4141ca2fcff5..08c3f3e24764d8fda9148ac9ab71783f018fd21c 100644 (file)
@@ -184,16 +184,15 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
   deallog.push("1d");
-  test<1>(logfile);
+  test<1>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("2d");
-  test<2>(logfile);
+  test<2>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("3d");
-  test<3>(logfile);
+  test<3>(deallog.get_file_stream());
   deallog.pop();
 }
index 88537ddcf08b7bf148d270e939eca2932f19a4be..561c1d355d00ef3aa3f7e1fd94321481d674d6a9 100644 (file)
@@ -61,10 +61,9 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
   deallog.push("3d");
-  test<3>(logfile);
+  test<3>(deallog.get_file_stream());
   deallog.pop();
 }
index 168c80dfe997e7bb58ec06dff137eabebc02174d..3acbd24ba28f6ccb76eabd12e41e47cef991d9b5 100644 (file)
@@ -51,14 +51,13 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
   deallog.push("2d");
-  test<2>(logfile);
+  test<2>(deallog.get_file_stream());
   deallog.pop();
 
   deallog.push("3d");
-  test<3>(logfile);
+  test<3>(deallog.get_file_stream());
   deallog.pop();
 }
index 7f72a5d405dab7710e85c340379aede398e2ef1c..e11de4b2165be2082a27febc303b89c1452f7333 100644 (file)
@@ -81,16 +81,15 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
   deallog.push("1d");
-  test<1>(logfile);
+  test<1>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("2d");
-  test<2>(logfile);
+  test<2>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("3d");
-  test<3>(logfile);
+  test<3>(deallog.get_file_stream());
   deallog.pop();
 }
index dad51d0745581df978f78718287d3a8ed2d2ce1c..693859742de05e1054940406bca398b722c1eb40 100644 (file)
@@ -124,16 +124,15 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
   deallog.push("1d");
-  test<1>(logfile);
+  test<1>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("2d");
-  test<2>(logfile);
+  test<2>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("3d");
-  test<3>(logfile);
+  test<3>(deallog.get_file_stream());
   deallog.pop();
 }
index 9cb1d15f185b37178fdead18abb5388e6b683bf8..f4a6afad3a167891c7d4bdb52f8eeb4aff69658d 100644 (file)
@@ -98,13 +98,12 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
   deallog.push("2d");
-  test<2>(logfile);
+  test<2>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("3d");
-  test<3>(logfile);
+  test<3>(deallog.get_file_stream());
   deallog.pop();
 }
index 2abeea255109a046672665c6f33c69c3665c28cf..895cd52be747398cffdcf191868ee6f7dad2529a 100644 (file)
@@ -106,8 +106,7 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
-  test<3>(logfile);
+  test<3>(deallog.get_file_stream());
 }
index 930330d36e48dda041c7cd2bac80d8021ad79dd1..37c4469519a18db33324e49e2dbe0056297722ce 100644 (file)
@@ -42,8 +42,7 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
-  test<3>(logfile);
+  test<3>(deallog.get_file_stream());
 }
index 679e2a33c0a4e07ccdab561e04cbc65ce6fea296..a8ec4d960ab813c40091850b4128ba31ceaaee6b 100644 (file)
@@ -52,9 +52,8 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
-  test<2>(logfile);
-  test<3>(logfile);
+  test<2>(deallog.get_file_stream());
+  test<3>(deallog.get_file_stream());
 }
index c61edff98646e267dbe5e21886fef38212b9dfad..56cce3381cca7c970391380d7dab4f3871639ba3 100644 (file)
@@ -81,16 +81,15 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
   deallog.push("1-2");
-  test<1,2>(logfile);
+  test<1,2>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("1-3");
-  test<1,3>(logfile);
+  test<1,3>(deallog.get_file_stream());
   deallog.pop();
   deallog.push("2-3");
-  test<2,3>(logfile);
+  test<2,3>(deallog.get_file_stream());
   deallog.pop();
 }
index 9b8b0f19182c061c8dd2f2458a26fd06b4e68cc6..f106dbb0b063a268c11c5f4466fee173e0920f04 100644 (file)
@@ -24,9 +24,6 @@
 
 #include <iostream>
 
-std::ofstream logfile("output");
-
-
 template <int dim>
 void check_rect1 (unsigned int n, bool color, bool log)
 {
@@ -47,14 +44,14 @@ void check_rect1 (unsigned int n, bool color, bool log)
   if (dim == 2)
     {
       if (log)
-        grid_out.write_xfig (tria, logfile);
+        grid_out.write_xfig (tria, deallog.get_file_stream());
       else
         grid_out.write_xfig (tria, std::cout);
     }
   else
     {
       if (log)
-        grid_out.write_dx (tria, logfile);
+        grid_out.write_dx (tria, deallog.get_file_stream());
       else
         grid_out.write_dx (tria, std::cout);
     }
@@ -63,6 +60,8 @@ void check_rect1 (unsigned int n, bool color, bool log)
 
 int main()
 {
+  initlog();
+
   check_rect1<2> (1, true, true);
   check_rect1<2> (3, true, true);
   check_rect1<3> (1, true, true);
index a78d08b289b8fc7736ee3a222758f90a44c74950..99b71546cd36218ae63748cdae2e8a78362c1191 100644 (file)
@@ -1,3 +1,4 @@
+
 #FIG 3.2
 Landscape
 Center
index 7a402ed0ff42db195786da5d3b8ebb4d8e1e194c..7dfd5b3c7063957474227294598cf6d753e65ec0 100644 (file)
@@ -59,9 +59,8 @@ void test(std::ostream &out)
 
 int main()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
+  initlog();
 
-  test<1,2>(logfile);
-  test<2,3>(logfile);
+  test<1,2>(deallog.get_file_stream());
+  test<2,3>(deallog.get_file_stream());
 }
index b1d1a3a4809c4812534658ad088235aef968ed62..b9850a37aa0bd0640a7cd45e31e68d23615a0b70 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 template <int dim>
-void check_parallelepiped (std::ofstream &logfile)
+void check_parallelepiped (std::ostream &logfile)
 {
   // Data structure defining dim coordinates that make up a
   // parallelepiped.
@@ -77,7 +77,8 @@ void check_parallelepiped (std::ofstream &logfile)
 int main ()
 {
   deal_II_exceptions::disable_abort_on_exception();
-  std::ofstream logfile ("output");
+  initlog();
+  std::ostream &logfile = deallog.get_file_stream();
 
   check_parallelepiped<1>(logfile);
   check_parallelepiped<2>(logfile);
index 3a8ca65a9d71823973ceb4b34da3a6aebb8b16d8..164bd359a1b77a0d56c17a7d277a10670350997e 100644 (file)
@@ -1,3 +1,4 @@
+
 ExcInvalidInputOrientation ("The triangulation you are trying to create will consist of cells" " with negative measures. This is usually the result of input data" " that does not define a right-handed coordinate system. The usual" " fix for this is to ensure that in 1D the given point is to the" " right of the origin (or the given edge tensor is positive), in 2D" " that the two edges (and their cross product) obey the right-hand" " rule (which may usually be done by switching the order of the" " points or edge tensors), or in 3D that the edges form a" " right-handed coordinate system (which may also be accomplished by" " switching the order of the first two points or edge tensors).")
 ExcInvalidInputOrientation ("The triangulation you are trying to create will consist of cells" " with negative measures. This is usually the result of input data" " that does not define a right-handed coordinate system. The usual" " fix for this is to ensure that in 1D the given point is to the" " right of the origin (or the given edge tensor is positive), in 2D" " that the two edges (and their cross product) obey the right-hand" " rule (which may usually be done by switching the order of the" " points or edge tensors), or in 3D that the edges form a" " right-handed coordinate system (which may also be accomplished by" " switching the order of the first two points or edge tensors).")
 ExcInvalidInputOrientation ("The triangulation you are trying to create will consist of cells" " with negative measures. This is usually the result of input data" " that does not define a right-handed coordinate system. The usual" " fix for this is to ensure that in 1D the given point is to the" " right of the origin (or the given edge tensor is positive), in 2D" " that the two edges (and their cross product) obey the right-hand" " rule (which may usually be done by switching the order of the" " points or edge tensors), or in 3D that the edges form a" " right-handed coordinate system (which may also be accomplished by" " switching the order of the first two points or edge tensors).")

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.