From: Wolfgang Bangerth Date: Wed, 9 Mar 2011 15:33:07 +0000 (+0000) Subject: Add ConditionalOStream::get_stream(). Use it. X-Git-Tag: v8.0.0~4230 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09fbda455a2ea63e889ae331568150feace59457;p=dealii.git Add ConditionalOStream::get_stream(). Use it. git-svn-id: https://svn.dealii.org/trunk@23472 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 8c25ff432c..e2175b4605 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -84,6 +84,11 @@ should be fixed now.

Specific improvements

    +
  1. New: There is now a new function ConditionalOStream::get_stream(). +
    +(WB, 2011/03/09) +
  2. +
  3. 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 diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index 1dff0e7722..b9642cf42e 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -70,10 +70,6 @@ #include #include -#include -#include -#include - // This is the only include file that is new: // We use an IndexSet to describe the // %parallel partitioning of vectors and @@ -84,8 +80,11 @@ #include #include +#include #include #include +#include +#include #include @@ -1944,6 +1943,11 @@ void BoussinesqFlowProblem::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::setup_dofs () << " (" << n_u << '+' << n_p << '+'<< n_T <<')' << std::endl << std::endl; + pcout.get_stream().imbue(s); diff --git a/deal.II/include/deal.II/base/conditional_ostream.h b/deal.II/include/deal.II/base/conditional_ostream.h index bc7dafbd56..85b0829067 100644 --- a/deal.II/include/deal.II/base/conditional_ostream.h +++ b/deal.II/include/deal.II/base/conditional_ostream.h @@ -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