LifeV
Displayer Class Reference

Displayer - This class is used to display messages in parallel simulations. More...

#include <Displayer.hpp>

+ Collaboration diagram for Displayer:

Protected Attributes

commPtr_Type M_comm
 
bool M_verbose
 

Public Types

typedef Epetra_Comm comm_Type
 
typedef std::shared_ptr< comm_TypecommPtr_Type
 

Constructors & Destructor

 Displayer ()
 Constructor. More...
 
 Displayer (const commPtr_Type &comm)
 
 Displayer (const Displayer &displayer)
 Copy constructor. More...
 
virtual ~Displayer ()
 Destructor. More...
 

Methods

template<typename T1 >
void leaderPrint (const T1 &message1) const
 Print one message. More...
 
template<typename T1 , typename T2 >
void leaderPrint (const T1 &message1, const T2 &message2) const
 Print two messages. More...
 
template<typename T1 , typename T2 , typename T3 >
void leaderPrint (const T1 &message1, const T2 &message2, const T3 &message3) const
 Print three messages. More...
 
template<typename T1 >
void leaderPrintMax (const T1 &message1, const Real &localMax) const
 Print the maximum value among the processors. More...
 
template<typename T1 , typename T2 >
void leaderPrintMax (const T1 &message1, const Real &localMax, const T2 &message2) const
 Print the maximum value among the processors. More...
 
const bool & isLeader () const
 Determine if it is the leader. More...
 

Set Methods

void setCommunicator (const commPtr_Type &comm)
 Set the communicator. More...
 

Get Methods

const commPtr_Typecomm () const
 Get the communicator. More...
 

Detailed Description

Displayer - This class is used to display messages in parallel simulations.

Author
Paolo Crosetto, Cristiano Malossi

If a communicator is passed to the constructor only one processor (the leader) will print out the message. If no communicator is passed to the constructor every processor prints the messages.

Definition at line 62 of file Displayer.hpp.

Member Typedef Documentation

◆ comm_Type

typedef Epetra_Comm comm_Type

Definition at line 69 of file Displayer.hpp.

◆ commPtr_Type

typedef std::shared_ptr< comm_Type > commPtr_Type

Definition at line 70 of file Displayer.hpp.

Constructor & Destructor Documentation

◆ Displayer() [1/3]

Displayer ( )

Constructor.

Definition at line 46 of file Displayer.cpp.

+ Here is the caller graph for this function:

◆ Displayer() [2/3]

Displayer ( const commPtr_Type comm)
explicit

Definition at line 56 of file Displayer.cpp.

+ Here is the caller graph for this function:

◆ Displayer() [3/3]

Displayer ( const Displayer displayer)

Copy constructor.

Parameters
displayerDisplayer

Definition at line 66 of file Displayer.cpp.

◆ ~Displayer()

virtual ~Displayer ( )
inlinevirtual

Destructor.

Definition at line 90 of file Displayer.hpp.

Member Function Documentation

◆ leaderPrint() [1/3]

void leaderPrint ( const T1 &  message1) const

Print one message.

Parameters
message1message to print out

Definition at line 187 of file Displayer.hpp.

◆ leaderPrint() [2/3]

void leaderPrint ( const T1 &  message1,
const T2 &  message2 
) const

Print two messages.

Parameters
message1first message to print out
message2second message to print out

Definition at line 197 of file Displayer.hpp.

◆ leaderPrint() [3/3]

void leaderPrint ( const T1 &  message1,
const T2 &  message2,
const T3 &  message3 
) const

Print three messages.

Parameters
message1first message to print out
message2second message to print out
message3third message to print out

Definition at line 207 of file Displayer.hpp.

◆ leaderPrintMax() [1/2]

void leaderPrintMax ( const T1 &  message1,
const Real localMax 
) const

Print the maximum value among the processors.

Take a Real input value from all processors in the communicator, computes the max, returns the max to all processors of the communicator. Then processor 0 of the communicator prints it.

Parameters
message1message to print out
localMaxInt or Real local maximum value that we want to print

Definition at line 217 of file Displayer.hpp.

◆ leaderPrintMax() [2/2]

void leaderPrintMax ( const T1 &  message1,
const Real localMax,
const T2 &  message2 
) const

Print the maximum value among the processors.

Take a Real input value from all processors in the communicator, computes the max, returns the max to all processors of the communicator. Then processor 0 of the communicator prints it.

Parameters
message1message to print out
message2second message to print out
localMaxInt or Real local maximum value that we want to print

Definition at line 238 of file Displayer.hpp.

◆ isLeader()

const bool & isLeader ( ) const

Determine if it is the leader.

Returns
true if it is process 0 of the communicator

Definition at line 76 of file Displayer.cpp.

+ Here is the caller graph for this function:

◆ setCommunicator()

void setCommunicator ( const commPtr_Type comm)

Set the communicator.

Parameters
commthe communicator

Definition at line 86 of file Displayer.cpp.

+ Here is the caller graph for this function:

◆ comm()

const commPtr_Type& comm ( ) const
inline

Get the communicator.

Returns
the communicator

Definition at line 167 of file Displayer.hpp.

+ Here is the caller graph for this function:

Field Documentation

◆ M_comm

commPtr_Type M_comm
protected

Definition at line 176 of file Displayer.hpp.

◆ M_verbose

bool M_verbose
protected

Definition at line 177 of file Displayer.hpp.


The documentation for this class was generated from the following files: