LifeV
Displayer.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 ************************************************************************
4 
5  This file is part of the LifeV Applications.
6  Copyright (C) 2009-2010 EPFL, Politecnico di Milano
7 
8  This library is free software; you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as
10  published by the Free Software Foundation; either version 2.1 of the
11  License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21  USA
22 
23 ************************************************************************
24 */
25 /*!
26  * @file
27  *
28  * @brief Template input variables for more general output messages:
29  * now it is possible to display not only strings but also Int, Real, etc..
30  *
31  * @date 2009-03-02
32  * @author Paolo Crosetto <crosetto@iacspc70.epfl.ch>
33  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
34  *
35  * @maintainer Radu Popescu <radu.popescu@epfl.ch>
36  */
37 
38 #include<lifev/core/util/Displayer.hpp>
39 
40 namespace LifeV
41 {
42 
43 // ===================================================
44 // Constructors & Destructor
45 // ===================================================
47  M_comm (commPtr_Type() ),
48  M_verbose (true)
49 {
50  if (M_comm)
51  {
52  M_verbose = M_comm->MyPID() == 0;
53  }
54 }
55 
56 Displayer::Displayer ( const commPtr_Type& comm ) :
57  M_comm ( comm ),
58  M_verbose ( true )
59 {
60  if ( M_comm )
61  {
62  M_verbose = M_comm->MyPID() == 0;
63  }
64 }
65 
66 Displayer::Displayer ( const Displayer& displayer ) :
67  M_comm ( displayer.M_comm ),
68  M_verbose ( displayer.M_verbose )
69 {
70 }
71 
72 // =================
73 // Methods
74 // =================
75 const bool&
77 {
78  return M_verbose;
79 }
80 
81 // =================
82 // Set methods
83 // =================
84 
85 void
87 {
88  M_comm = comm;
89  if ( M_comm.get() )
90  {
91  M_verbose = M_comm->MyPID() == 0;
92  }
93 }
94 
95 } // Namespace LifeV
Displayer(const commPtr_Type &comm)
Definition: Displayer.cpp:56
std::shared_ptr< comm_Type > commPtr_Type
Definition: Displayer.hpp:70
void setCommunicator(const commPtr_Type &comm)
Set the communicator.
Definition: Displayer.cpp:86
void updateInverseJacobian(const UInt &iQuadPt)
const bool & isLeader() const
Determine if it is the leader.
Definition: Displayer.cpp:76
Displayer(const Displayer &displayer)
Copy constructor.
Definition: Displayer.cpp:66
Displayer()
Constructor.
Definition: Displayer.cpp:46
commPtr_Type M_comm
Definition: Displayer.hpp:176
Displayer - This class is used to display messages in parallel simulations.
Definition: Displayer.hpp:62