Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_OutputStream_DefaultImpl.cpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Panzer: A partial differential equation assembly
4// engine for strongly coupled complex multiphysics systems
5//
6// Copyright 2011 NTESS and the Panzer contributors.
7// SPDX-License-Identifier: BSD-3-Clause
8// *****************************************************************************
9// @HEADER
10
12#include "Teuchos_FancyOStream.hpp"
13#include "Teuchos_Assert.hpp"
14
15namespace panzer {
16
19
22
24 setOStream(const Teuchos::RCP<Teuchos::FancyOStream>& os)
25 {
26 m_out = os;
27 m_out->setOutputToRootOnly(0);
28 m_pout = Teuchos::rcp(new Teuchos::FancyOStream(os->getOStream()));
29 m_pout->copyAllOutputOptions(*m_out);
30 m_pout->setOutputToRootOnly(-1);
31 }
32
33 Teuchos::RCP<Teuchos::FancyOStream>
35 {
36 return m_out;
37 }
38
39 Teuchos::FancyOStream& OutputStreamDefaultImpl::out() const
40 {
41 return *m_out;
42 }
43
44 Teuchos::FancyOStream& OutputStreamDefaultImpl::pout() const
45 {
46 return *m_pout;
47 }
48
53
58
60 doOutput(EVerbosityLevel vl, bool only_for_exact_level) const
61 {
62 if ( !only_for_exact_level &&
63 (Teuchos::as<int>(vl) >= Teuchos::as<int>(m_level)) )
64 return true;
65
66 if (only_for_exact_level && (vl == m_level) )
67 return true;
68
69 return false;
70 }
71
72}
Teuchos::RCP< Teuchos::FancyOStream > m_pout
void setOStream(const Teuchos::RCP< Teuchos::FancyOStream > &os)
Teuchos::RCP< Teuchos::FancyOStream > m_out
Teuchos::RCP< Teuchos::FancyOStream > getOStream() const
bool doOutput(EVerbosityLevel vl, bool only_for_exact_level=false) const
Returns true if vl is equal to or greater than the object's verbosity level.