-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#ifndef CONDITIONAL_OSTREAMS_H_ | ||
#define CONDITIONAL_OSTREAMS_H_ | ||
|
||
#include <deal.II/base/conditional_ostream.h> | ||
#include <deal.II/base/mpi.h> | ||
|
||
#include <ostream> | ||
|
||
/** | ||
* \brief A class that allows printing to different output streams that are classified | ||
* based on their verbosity. For now, this consists of two stream the release and debug. | ||
* The debug stream provides more information that may be useful when debugging. | ||
*/ | ||
class conditionalOStreams | ||
{ | ||
public: | ||
/** | ||
* \brief Constructor. | ||
*/ | ||
conditionalOStreams(); | ||
|
||
/** | ||
* \brief Generic parallel output stream. Used for essential information in release and | ||
* debug mode. | ||
*/ | ||
static const dealii::ConditionalOStream pout_base; | ||
|
||
/** | ||
* \brief Verbose parallel output stream. Used for additional information in debug mode. | ||
*/ | ||
static const dealii::ConditionalOStream pout_verbose; | ||
}; | ||
|
||
// NOLINTBEGIN | ||
const dealii::ConditionalOStream conditionalOStreams::pout_base( | ||
std::cout, | ||
dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0); | ||
|
||
const dealii::ConditionalOStream conditionalOStreams::pout_verbose( | ||
std::cout, | ||
#ifndef DEBUG | ||
false && | ||
#endif | ||
dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0); | ||
// NOLINTEND | ||
|
||
#endif |