MFEM  v3.4
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
globals.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 
13 #include "../config/config.hpp"
14 #include "globals.hpp"
15 #include <iostream>
16 #include <sstream>
17 #include <iomanip>
18 
19 namespace mfem
20 {
21 
22 OutStream out(std::cout);
23 OutStream err(std::cerr);
24 
25 
26 std::string MakeParFilename(const std::string &prefix, const int myid,
27  const std::string suffix, const int width)
28 {
29  std::stringstream fname;
30  fname << prefix << std::setw(width) << std::setfill('0') << myid << suffix;
31  return fname.str();
32 }
33 
34 
35 #ifdef MFEM_USE_MPI
36 
37 MPI_Comm MFEM_COMM_WORLD = MPI_COMM_WORLD;
38 
40 {
41  return MFEM_COMM_WORLD;
42 }
43 
44 void SetGlobalMPI_Comm(MPI_Comm comm)
45 {
46  MFEM_COMM_WORLD = comm;
47 }
48 
49 #endif
50 
51 }
std::string MakeParFilename(const std::string &prefix, const int myid, const std::string suffix, const int width)
Construct a string of the form &quot;&lt;prefix&gt;&lt;myid&gt;&lt;suffix&gt;&quot; where the integer myid is padded with leading...
Definition: globals.cpp:26
MPI_Comm MFEM_COMM_WORLD
Definition: globals.cpp:37
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
Definition: globals.hpp:69
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
Definition: globals.hpp:64
void SetGlobalMPI_Comm(MPI_Comm comm)
Set MFEM&#39;s &quot;global&quot; MPI communicator.
Definition: globals.cpp:44
MPI_Comm GetGlobalMPI_Comm()
Get MFEM&#39;s &quot;global&quot; MPI communicator.
Definition: globals.cpp:39