Hipace
IOUtil.H
Go to the documentation of this file.
1 /* Copyright 2020-2021
2  *
3  * This file is part of HiPACE++.
4  *
5  * Authors: MaxThevenet, Severin Diederichs
6  * License: BSD-3-Clause-LBNL
7  */
8 #ifndef HIPACE_IOUTIL_H_
9 #define HIPACE_IOUTIL_H_
10 
11 #include <AMReX_REAL.H>
12 #include <AMReX_IntVect.H>
13 #include <AMReX_RealVect.H>
14 #include <AMReX_MultiFab.H>
15 
16 #include <cstdint>
17 #include <vector>
18 
19 #ifdef HIPACE_USE_OPENPMD
20 #include <openPMD/openPMD.hpp>
21 #endif
22 
23 namespace utils
24 {
33  std::vector< double >
35 
41  std::vector<std::uint64_t>
42  getReversedVec ( const amrex::IntVect& v );
43 
49  std::vector<double>
50  getReversedVec ( const amrex::Real* v );
51 
60  bool doDiagnostics (int output_period, int output_step, int max_step,
61  amrex::Real output_time, amrex::Real max_time);
62 
63 #ifdef HIPACE_USE_OPENPMD
64  std::pair< std::string, std::string >
65  name2openPMD ( std::string const& fullName );
66 
72  std::map< openPMD::UnitDimension, double >
73  getUnitDimension ( std::string const & record_name );
74 #endif
75 
76 }
77 
78 #endif
Definition: IOUtil.H:24
bool doDiagnostics(int output_period, int output_step, int max_step, amrex::Real output_time, amrex::Real max_time)
returns whether output should be writen to file
Definition: IOUtil.cpp:71
std::vector< std::uint64_t > getReversedVec(const amrex::IntVect &v)
Convert an IntVect to a std::vector<std::uint64_t> and reverse the order of the elements (used for co...
Definition: IOUtil.cpp:35
std::vector< double > getRelativeCellPosition(amrex::Box const &box)
Definition: IOUtil.cpp:17