1 #ifndef AMREX_PLOTFILEUTIL_H_
2 #define AMREX_PLOTFILEUTIL_H_
3 #include <AMReX_Config.H>
22 std::string
LevelPath (
int level,
const std::string &levelPrefix =
"Level_");
26 const std::string &levelPrefix =
"Level_",
27 const std::string &mfPrefix =
"Cell");
31 const std::string &plotfilename,
32 const std::string &levelPrefix =
"Level_");
36 const std::string &plotfilename,
37 const std::string &levelPrefix =
"Level_",
38 const std::string &mfPrefix =
"Cell");
55 const std::string &subDirPrefix,
65 const Vector<BoxArray> &bArray,
66 const Vector<std::string> &varnames,
67 const Vector<Geometry> &geom,
69 const Vector<int> &level_steps,
70 const Vector<IntVect> &ref_ratio,
71 const std::string &versionName =
"HyperCLaw-V1.1",
72 const std::string &levelPrefix =
"Level_",
73 const std::string &mfPrefix =
"Cell");
77 const Vector<std::string> &varnames,
81 const std::string &versionName =
"HyperCLaw-V1.1",
82 const std::string &levelPrefix =
"Level_",
83 const std::string &mfPrefix =
"Cell",
84 const Vector<std::string>& extra_dirs = Vector<std::string>());
88 const Vector<const MultiFab*> &mf,
89 const Vector<std::string> &varnames,
90 const Vector<Geometry> &geom,
92 const Vector<int> &level_steps,
93 const Vector<IntVect> &ref_ratio,
94 const std::string &versionName =
"HyperCLaw-V1.1",
95 const std::string &levelPrefix =
"Level_",
96 const std::string &mfPrefix =
"Cell",
97 const Vector<std::string>& extra_dirs = Vector<std::string>());
112 void WriteMLMF (
const std::string &plotfilename,
113 const Vector<const MultiFab*>& mf,
114 const Vector<Geometry> &geom);
117 const Vector<const MultiFab*>& mf,
118 const Vector<std::string>& varnames,
119 const Vector<Geometry>& geom, Real time,
const Vector<int>& level_steps,
120 const Vector<IntVect>& ref_ratio,
121 const std::string &versionName =
"HyperCLaw-V1.1",
122 const std::string &levelPrefix =
"Level_",
123 const std::string &mfPrefix =
"Cell",
124 const Vector<std::string>& extra_dirs = Vector<std::string>());
128 void EB_WriteSingleLevelPlotfile (
const std::string &plotfilename,
130 const Vector<std::string> &varnames,
131 const Geometry &geom,
134 const std::string &versionName =
"HyperCLaw-V1.1",
135 const std::string &levelPrefix =
"Level_",
136 const std::string &mfPrefix =
"Cell",
137 const Vector<std::string>& extra_dirs = Vector<std::string>());
139 void EB_WriteMultiLevelPlotfile (
const std::string &plotfilename,
141 const Vector<const MultiFab*> &mf,
142 const Vector<std::string> &varnames,
143 const Vector<Geometry> &geom,
145 const Vector<int> &level_steps,
146 const Vector<IntVect> &ref_ratio,
147 const std::string &versionName =
"HyperCLaw-V1.1",
148 const std::string &levelPrefix =
"Level_",
149 const std::string &mfPrefix =
"Cell",
150 const Vector<std::string>& extra_dirs = Vector<std::string>());
162 [[nodiscard]] Real
time () const noexcept {
return m_impl->time(); }
166 [[nodiscard]]
int refRatio (
int level)
const noexcept {
return m_impl->refRatio(level); }
168 [[nodiscard]]
int levelStep (
int level)
const noexcept {
return m_impl->levelStep(level); }
189 [[nodiscard]]
int nComp () const noexcept {
return m_impl->nComp(); }
193 MultiFab get (
int level, std::string
const& varname) noexcept {
return m_impl->get(level, varname); }
196 std::unique_ptr<PlotFileDataImpl>
m_impl;
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:550
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
Definition: AMReX_PlotFileDataImpl.H:12
Definition: AMReX_PlotFileUtil.H:156
void syncDistributionMap(int level, PlotFileData const &src) noexcept
Definition: AMReX_PlotFileUtil.H:176
const DistributionMapping & DistributionMap(int level) const noexcept
Definition: AMReX_PlotFileUtil.H:172
Array< Real, AMREX_SPACEDIM > probSize() const noexcept
Definition: AMReX_PlotFileUtil.H:182
std::unique_ptr< PlotFileDataImpl > m_impl
Definition: AMReX_PlotFileUtil.H:196
Array< Real, AMREX_SPACEDIM > probHi() const noexcept
Definition: AMReX_PlotFileUtil.H:184
int coordSys() const noexcept
Definition: AMReX_PlotFileUtil.H:178
const BoxArray & boxArray(int level) const noexcept
Definition: AMReX_PlotFileUtil.H:170
MultiFab get(int level) noexcept
Definition: AMReX_PlotFileUtil.H:192
Box probDomain(int level) const noexcept
Definition: AMReX_PlotFileUtil.H:180
PlotFileData(std::string const &plotfile_name)
Definition: AMReX_PlotFileUtil.H:158
IntVect nGrowVect(int level) const noexcept
Definition: AMReX_PlotFileUtil.H:190
void syncDistributionMap(PlotFileData const &src) noexcept
Definition: AMReX_PlotFileUtil.H:174
Array< Real, AMREX_SPACEDIM > probLo() const noexcept
Definition: AMReX_PlotFileUtil.H:183
MultiFab get(int level, std::string const &varname) noexcept
Definition: AMReX_PlotFileUtil.H:193
int finestLevel() const noexcept
Definition: AMReX_PlotFileUtil.H:164
int spaceDim() const noexcept
Definition: AMReX_PlotFileUtil.H:160
int refRatio(int level) const noexcept
Definition: AMReX_PlotFileUtil.H:166
const Vector< std::string > & varNames() const noexcept
Definition: AMReX_PlotFileUtil.H:187
Real time() const noexcept
Definition: AMReX_PlotFileUtil.H:162
int nComp() const noexcept
Definition: AMReX_PlotFileUtil.H:189
Array< Real, AMREX_SPACEDIM > cellSize(int level) const noexcept
Definition: AMReX_PlotFileUtil.H:185
int levelStep(int level) const noexcept
Definition: AMReX_PlotFileUtil.H:168
Definition: AMReX_Amr.cpp:49
std::string LevelFullPath(int level, const std::string &plotfilename, const std::string &levelPrefix)
return the full path of the level directory, e.g., plt00005/Level_5
Definition: AMReX_PlotFileUtil.cpp:29
std::string LevelPath(int level, const std::string &levelPrefix)
return the name of the level directory, e.g., Level_5
Definition: AMReX_PlotFileUtil.cpp:17
std::string MultiFabFileFullPrefix(int level, const std::string &plotfilename, const std::string &levelPrefix, const std::string &mfPrefix)
return the full path multifab prefix, e.g., plt00005/Level_5/Cell
Definition: AMReX_PlotFileUtil.cpp:41
void WriteMLMF(const std::string &plotfilename, const Vector< const MultiFab * > &mf, const Vector< Geometry > &geom)
write a plotfile to disk given: -plotfile name -vector of MultiFabs -vector of Geometrys variable nam...
Definition: AMReX_PlotFileUtil.cpp:249
void PreBuildDirectorHierarchy(const std::string &dirName, const std::string &, int nSubDirs, bool callBarrier)
prebuild a hierarchy of directories dirName is built first. if dirName exists, it is renamed....
Definition: AMReX_PlotFileUtil.cpp:56
void WriteSingleLevelPlotfile(const std::string &plotfilename, const MultiFab &mf, const Vector< std::string > &varnames, const Geometry &geom, Real time, int level_step, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix, const Vector< std::string > &extra_dirs)
Definition: AMReX_PlotFileUtil.cpp:341
void WriteMultiLevelPlotfile(const std::string &plotfilename, int nlevels, const Vector< const MultiFab * > &mf, const Vector< std::string > &varnames, const Vector< Geometry > &geom, Real time, const Vector< int > &level_steps, const Vector< IntVect > &ref_ratio, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix, const Vector< std::string > &extra_dirs)
Definition: AMReX_PlotFileUtil.cpp:159
std::string MultiFabHeaderPath(int level, const std::string &levelPrefix, const std::string &mfPrefix)
return the path of the multifab to write to the header, e.g., Level_5/Cell
Definition: AMReX_PlotFileUtil.cpp:22
void WriteMultiLevelPlotfileHeaders(const std::string &plotfilename, int nlevels, const Vector< const MultiFab * > &mf, const Vector< std::string > &varnames, const Vector< Geometry > &geom, Real time, const Vector< int > &level_steps, const Vector< IntVect > &ref_ratio, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix, const Vector< std::string > &extra_dirs)
Definition: AMReX_PlotFileUtil.cpp:285
void WriteGenericPlotfileHeader(std::ostream &HeaderFile, int nlevels, const Vector< BoxArray > &bArray, const Vector< std::string > &varnames, const Vector< Geometry > &geom, Real time, const Vector< int > &level_steps, const Vector< IntVect > &ref_ratio, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix)
Definition: AMReX_PlotFileUtil.cpp:73
std::array< T, N > Array
Definition: AMReX_Array.H:24