Block-Structured AMR Software Framework
AMReX_PlotFileDataImpl.H
Go to the documentation of this file.
1 #ifndef AMREX_PLOT_FILE_DATA_IMPL_H_
2 #define AMREX_PLOT_FILE_DATA_IMPL_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX_MultiFab.H>
6 #include <AMReX_VisMF.H>
7 #include <string>
8 
9 namespace amrex {
10 
12 {
13 public:
14  PlotFileDataImpl (std::string const& plotfile_name);
15 
16  [[nodiscard]] int spaceDim () const noexcept { return m_spacedim; }
17 
18  [[nodiscard]] Real time () const noexcept { return m_time; }
19 
20  [[nodiscard]] int finestLevel () const noexcept { return m_finest_level; }
21 
22  [[nodiscard]] int refRatio (int level) const noexcept { return m_ref_ratio[level]; }
23 
24  [[nodiscard]] int levelStep (int level) const noexcept { return m_level_steps[level]; }
25 
26  [[nodiscard]] const BoxArray& boxArray (int level) const noexcept { return m_ba[level]; }
27 
28  [[nodiscard]] const DistributionMapping& DistributionMap (int level) const noexcept { return m_dmap[level]; }
29 
30  void syncDistributionMap (PlotFileDataImpl const& src) noexcept;
31 
32  void syncDistributionMap (int level, PlotFileDataImpl const& src) noexcept;
33 
34  [[nodiscard]] int coordSys () const noexcept { return m_coordsys; }
35 
36  [[nodiscard]] Box probDomain (int level) const noexcept { return m_prob_domain[level]; }
37 
38  [[nodiscard]] Array<Real,AMREX_SPACEDIM> probSize () const noexcept { return m_prob_size; }
39  [[nodiscard]] Array<Real,AMREX_SPACEDIM> probLo () const noexcept { return m_prob_lo; }
40  [[nodiscard]] Array<Real,AMREX_SPACEDIM> probHi () const noexcept { return m_prob_hi; }
41  [[nodiscard]] Array<Real,AMREX_SPACEDIM> cellSize (int level) const noexcept { return m_cell_size[level]; }
42 
43  [[nodiscard]] const Vector<std::string>& varNames () const noexcept { return m_var_names; }
44 
45  [[nodiscard]] int nComp () const noexcept { return m_ncomp; }
46  [[nodiscard]] IntVect nGrowVect (int level) const noexcept { return m_ngrow[level]; }
47 
48  MultiFab get (int level) noexcept;
49  MultiFab get (int level, std::string const& varname) noexcept;
50 
51 private:
52  std::string m_plotfile_name;
53  std::string m_file_version;
54  int m_ncomp;
57  Real m_time;
72 };
73 
74 }
75 
76 #endif
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:549
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
int coordSys() const noexcept
Definition: AMReX_PlotFileDataImpl.H:34
Vector< std::string > m_mf_name
Definition: AMReX_PlotFileDataImpl.H:67
Vector< BoxArray > m_ba
Definition: AMReX_PlotFileDataImpl.H:69
Vector< IntVect > m_ngrow
Definition: AMReX_PlotFileDataImpl.H:71
int m_coordsys
Definition: AMReX_PlotFileDataImpl.H:66
Vector< Array< Real, AMREX_SPACEDIM > > m_cell_size
Definition: AMReX_PlotFileDataImpl.H:65
Array< Real, AMREX_SPACEDIM > probLo() const noexcept
Definition: AMReX_PlotFileDataImpl.H:39
Real time() const noexcept
Definition: AMReX_PlotFileDataImpl.H:18
int m_nlevels
Definition: AMReX_PlotFileDataImpl.H:58
const Vector< std::string > & varNames() const noexcept
Definition: AMReX_PlotFileDataImpl.H:43
Vector< int > m_ref_ratio
Definition: AMReX_PlotFileDataImpl.H:62
Vector< Box > m_prob_domain
Definition: AMReX_PlotFileDataImpl.H:63
Vector< int > m_level_steps
Definition: AMReX_PlotFileDataImpl.H:64
int m_finest_level
Definition: AMReX_PlotFileDataImpl.H:58
std::string m_plotfile_name
Definition: AMReX_PlotFileDataImpl.H:52
Real m_time
Definition: AMReX_PlotFileDataImpl.H:57
const DistributionMapping & DistributionMap(int level) const noexcept
Definition: AMReX_PlotFileDataImpl.H:28
PlotFileDataImpl(std::string const &plotfile_name)
Definition: AMReX_PlotFileDataImpl.cpp:16
MultiFab get(int level) noexcept
Definition: AMReX_PlotFileDataImpl.cpp:124
Array< Real, AMREX_SPACEDIM > probHi() const noexcept
Definition: AMReX_PlotFileDataImpl.H:40
Vector< std::unique_ptr< VisMF > > m_vismf
Definition: AMReX_PlotFileDataImpl.H:68
std::string m_file_version
Definition: AMReX_PlotFileDataImpl.H:53
int m_ncomp
Definition: AMReX_PlotFileDataImpl.H:54
int finestLevel() const noexcept
Definition: AMReX_PlotFileDataImpl.H:20
Array< Real, AMREX_SPACEDIM > m_prob_hi
Definition: AMReX_PlotFileDataImpl.H:60
int levelStep(int level) const noexcept
Definition: AMReX_PlotFileDataImpl.H:24
Vector< std::string > m_var_names
Definition: AMReX_PlotFileDataImpl.H:55
int spaceDim() const noexcept
Definition: AMReX_PlotFileDataImpl.H:16
Box probDomain(int level) const noexcept
Definition: AMReX_PlotFileDataImpl.H:36
Array< Real, AMREX_SPACEDIM > m_prob_size
Definition: AMReX_PlotFileDataImpl.H:61
int m_spacedim
Definition: AMReX_PlotFileDataImpl.H:56
void syncDistributionMap(PlotFileDataImpl const &src) noexcept
Definition: AMReX_PlotFileDataImpl.cpp:107
Array< Real, AMREX_SPACEDIM > probSize() const noexcept
Definition: AMReX_PlotFileDataImpl.H:38
int refRatio(int level) const noexcept
Definition: AMReX_PlotFileDataImpl.H:22
IntVect nGrowVect(int level) const noexcept
Definition: AMReX_PlotFileDataImpl.H:46
const BoxArray & boxArray(int level) const noexcept
Definition: AMReX_PlotFileDataImpl.H:26
Array< Real, AMREX_SPACEDIM > cellSize(int level) const noexcept
Definition: AMReX_PlotFileDataImpl.H:41
Array< Real, AMREX_SPACEDIM > m_prob_lo
Definition: AMReX_PlotFileDataImpl.H:59
Vector< DistributionMapping > m_dmap
Definition: AMReX_PlotFileDataImpl.H:70
int nComp() const noexcept
Definition: AMReX_PlotFileDataImpl.H:45
Definition: AMReX_Amr.cpp:49
std::array< T, N > Array
Definition: AMReX_Array.H:24