3 #include <AMReX_Config.H>
26 template <
typename T,
typename S>
27 std::ostream&
operator<<(std::ostream& os,
const std::pair<T, S>& v)
29 os <<
"(" << v.first <<
", " << v.second <<
")";
48 {
ss.precision(
os.precision()); }
58 {
ss.precision(
os.precision()); }
68 {
ss.precision(
os.precision()); }
101 (*func)(std::basic_ostream<
char, std::char_traits<char> >&))
111 std::ostringstream
ss;
169 template <
typename T>
176 (*func)(std::basic_ostream<
char, std::char_traits<char> >&))
188 std::string proc_file_name =
file_name +
"." + std::to_string(my_proc_global);
192 ofs.open(proc_file_name, std::ios_base::app);
193 if (!
ofs.is_open()) {
194 amrex::Error(
"Could not open file for appending in amrex::Print()");
196 ss.precision(
ofs.precision());
204 std::ostringstream
ss;
#define AMREX_D_TERM(a, b, c)
Definition: AMReX_SPACE.H:129
int MPI_Comm
Definition: AMReX_ccse-mpi.H:47
Print on all processors of the default communicator.
Definition: AMReX_Print.H:210
AllPrintToFile(std::string file_name_)
Example: AllPrint() << " x = " << x << ' ';.
Definition: AMReX_Print.H:213
Print on all processors of the default communicator.
Definition: AMReX_Print.H:117
AllPrint(std::ostream &os_=amrex::OutStream())
Example: AllPrint() << " x = " << x << ' ';.
Definition: AMReX_Print.H:120
This class prints to a file with a given base name.
Definition: AMReX_Print.H:128
static constexpr int AllProcs
Definition: AMReX_Print.H:131
PrintToFile(std::string file_name_, int rank_)
Definition: AMReX_Print.H:139
std::ofstream ofs
Definition: AMReX_Print.H:203
MPI_Comm comm
Definition: AMReX_Print.H:202
void Initialize()
Definition: AMReX_Print.H:184
PrintToFile & SetPrecision(int p)
Definition: AMReX_Print.H:164
int rank
Definition: AMReX_Print.H:201
PrintToFile(std::string file_name_, int rank_, MPI_Comm comm_)
Definition: AMReX_Print.H:145
PrintToFile(std::string file_name_)
Definition: AMReX_Print.H:133
PrintToFile(PrintToFile const &)=delete
PrintToFile(PrintToFile &&)=delete
std::string file_name
Definition: AMReX_Print.H:200
~PrintToFile()
Definition: AMReX_Print.H:151
PrintToFile & operator=(PrintToFile const &)=delete
std::ostringstream ss
Definition: AMReX_Print.H:204
PrintToFile & operator<<(const T &x)
Definition: AMReX_Print.H:170
This class provides the user with a few print options.
Definition: AMReX_Print.H:35
Print & operator<<(const T &x)
Definition: AMReX_Print.H:95
Print(std::ostream &os_=amrex::OutStream())
Print on I/O Processor of the default communicator Example: Print() << " x = " << x << ' ';.
Definition: AMReX_Print.H:44
Print(Print const &)=delete
~Print()
Definition: AMReX_Print.H:70
Print(int rank_, MPI_Comm comm_, std::ostream &os_=amrex::OutStream())
Print on process rank_ of communicator comm_ Example: Print(rank_, comm_) << " x = " << x << ' ';.
Definition: AMReX_Print.H:64
MPI_Comm comm
Definition: AMReX_Print.H:109
Print & SetPrecision(int p)
Definition: AMReX_Print.H:89
int rank
Definition: AMReX_Print.H:108
std::ostream & os
Definition: AMReX_Print.H:110
std::ostringstream ss
Definition: AMReX_Print.H:111
static constexpr int AllProcs
Definition: AMReX_Print.H:38
Print & operator=(Print const &)=delete
Print(int rank_, std::ostream &os_=amrex::OutStream())
Print on all processors of the default communicator Example: Print(Print::AllProcs) << " x = " << x <...
Definition: AMReX_Print.H:54
MPI_Comm CommunicatorSub() noexcept
sub-communicator for current frame
Definition: AMReX_ParallelContext.H:70
int MyProcSub() noexcept
my sub-rank in current frame
Definition: AMReX_ParallelContext.H:76
std::ofstream * OFSPtrSub() noexcept
Pointer to ofstream.
Definition: AMReX_ParallelContext.H:82
int IOProcessorNumberSub() noexcept
IO sub-rank in current frame.
Definition: AMReX_ParallelContext.H:78
int MyProc() noexcept
return the rank number local to the current Parallel Context
Definition: AMReX_ParallelDescriptor.H:125
integer function omp_get_thread_num()
Definition: AMReX_omp_mod.F90:37
Definition: AMReX_Amr.cpp:49
void Error(const std::string &msg)
Print out message to cerr and exit via amrex::Abort().
Definition: AMReX.cpp:219
std::ostream & OutStream()
Definition: AMReX.cpp:872
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Definition: AMReX_AmrMesh.cpp:1236
std::array< T, N > Array
Definition: AMReX_Array.H:24