]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add ConditionalOStream::get_stream(). Use it.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Mar 2011 15:33:07 +0000 (15:33 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Mar 2011 15:33:07 +0000 (15:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@23472 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/examples/step-32/step-32.cc
deal.II/include/deal.II/base/conditional_ostream.h

index 8c25ff432c94f9514e2034eac6c1b485febbea11..e2175b4605c7779224f9c481704576b1efd2070e 100644 (file)
@@ -84,6 +84,11 @@ should be fixed now.
 <h3>Specific improvements</h3>
 
 <ol>
+<li> New: There is now a new function ConditionalOStream::get_stream().
+<br>
+(WB, 2011/03/09)
+</li>
+
 <li> Fixed: FESystem::get_unit_face_support_points would refuse to return
 anything if one of the base elements did not have support points. This
 condition has been relaxed: it now only doesn't return anything if this
index 1dff0e7722fd2d7d95617907ac24258d9cf4a2fd..b9642cf42ec3ee7158d69bca3acb10dc6e75974a 100644 (file)
 #include <numerics/error_estimator.h>
 #include <numerics/solution_transfer.h>
 
-#include <fstream>
-#include <iostream>
-#include <limits>
-
                                 // This is the only include file that is new:
                                 // We use an IndexSet to describe the
                                 // %parallel partitioning of vectors and
 #include <distributed/solution_transfer.h>
 #include <distributed/grid_refinement.h>
 
+#include <fstream>
 #include <iostream>
 #include <sstream>
+#include <limits>
+#include <locale>
 #include <string>
 
 
@@ -1944,6 +1943,11 @@ void BoussinesqFlowProblem<dim>::setup_dofs ()
                      n_p = stokes_dofs_per_block[1],
                     n_T = temperature_dof_handler.n_dofs();
 
+                                      // print dof numbers with 1000s
+                                      // separator since they are frequently
+                                      // large
+  std::locale s = pcout.get_stream().getloc();
+  pcout.get_stream().imbue(std::locale(""));
   pcout << "Number of active cells: "
        << triangulation.n_global_active_cells()
        << " (on "
@@ -1955,6 +1959,7 @@ void BoussinesqFlowProblem<dim>::setup_dofs ()
        << " (" << n_u << '+' << n_p << '+'<< n_T <<')'
        << std::endl
        << std::endl;
+  pcout.get_stream().imbue(s);
 
 
 
index bc7dafbd56d8e99e78dc017c446797aea6f99249..85b0829067769d69e0241a9e26e0e0faa82df8cf 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -113,6 +113,12 @@ class ConditionalOStream
                                      */
     bool is_active() const;
 
+                                    /**
+                                     * Return a reference to the stream
+                                     * currently in use.
+                                     */
+    std::ostream & get_stream () const;
+    
                                     /**
                                      * Output a constant something through
                                      * this stream. This function must be @p
@@ -182,6 +188,14 @@ ConditionalOStream::operator<< (std::ostream& (*p) (std::ostream&)) const
 }
 
 
+inline
+std::ostream &
+ConditionalOStream::get_stream () const
+{
+  return output_stream;
+}
+
+
 DEAL_II_NAMESPACE_CLOSE
 
 #endif

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.