Block-Structured AMR Software Framework
AMReX_EB_chkpt_file.H
Go to the documentation of this file.
1 #ifndef AMREX_EB_CHKPT_FILE_H_
2 #define AMREX_EB_CHKPT_FILE_H_
3 
4 #include <AMReX_MultiFab.H>
5 
6 namespace amrex::EB2 {
7 
8 class ChkptFile
9 {
10 private:
11  std::string m_restart_file;
12 
13  std::string m_volfrac_name = "volfrac";
14  std::string m_centroid_name = "centroid";
15  std::string m_bndryarea_name = "bndryarea";
16  std::string m_bndrycent_name = "bndrycent";
17  std::string m_bndrynorm_name = "bndrynorm";
18  std::string m_levelset_name = "levelset";
19 
21  = {AMREX_D_DECL("areafrac_x", "areafrac_y", "areafrac_z")};
23  = {AMREX_D_DECL("facecent_x", "facecent_y", "facecent_z")};
25  = {AMREX_D_DECL("edgecent_x", "edgecent_y", "edgecent_z")};
26 
27  void writeHeader (const BoxArray& cut_ba, const BoxArray& covered_ba, const Geometry& geom,
28  const IntVect& ngrow, bool extend_domain_face, int max_grid_size) const;
29 
30  void writeToFile (const MultiFab& mf, const std::string& mf_name) const;
31 
32 
33 public:
34  ChkptFile (std::string fname);
35 
36  void read_from_chkpt_file (BoxArray& cut_grids, BoxArray& covered_grids,
37  DistributionMapping& dmap,
38  MultiFab& volfrac, MultiFab& centroid, MultiFab& bndryarea,
39  MultiFab& bndrycent, MultiFab& bndrynorm,
43  MultiFab& levelset, int ng_gfab, const Geometry& geom,
44  const IntVect& ngrow_finest, bool extend_domain_face, int max_grid_size) const;
45 
46  void write_to_chkpt_file (const BoxArray& cut_grids,
47  const BoxArray& covered_grids,
48  const MultiFab& volfrac,
49  const MultiFab& centroid, const MultiFab& bndryarea,
50  const MultiFab& bndrycent, const MultiFab& bndrynorm,
51  const Array<MultiFab,AMREX_SPACEDIM>& areafrac,
52  const Array<MultiFab,AMREX_SPACEDIM>& facecent,
53  const Array<MultiFab,AMREX_SPACEDIM>& edgecent,
54  const MultiFab& levelset, const Geometry& geom,
55  const IntVect& ngrow, bool extend_domain_face, int max_grid_size) const;
56 };
57 
58 }
59 
60 #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
Definition: AMReX_EB_chkpt_file.H:9
amrex::Vector< std::string > m_facecent_name
Definition: AMReX_EB_chkpt_file.H:23
std::string m_centroid_name
Definition: AMReX_EB_chkpt_file.H:14
ChkptFile(std::string fname)
Definition: AMReX_EB_chkpt_file.cpp:99
std::string m_bndryarea_name
Definition: AMReX_EB_chkpt_file.H:15
std::string m_bndrycent_name
Definition: AMReX_EB_chkpt_file.H:16
std::string m_bndrynorm_name
Definition: AMReX_EB_chkpt_file.H:17
void writeToFile(const MultiFab &mf, const std::string &mf_name) const
Definition: AMReX_EB_chkpt_file.cpp:92
void read_from_chkpt_file(BoxArray &cut_grids, BoxArray &covered_grids, DistributionMapping &dmap, MultiFab &volfrac, MultiFab &centroid, MultiFab &bndryarea, MultiFab &bndrycent, MultiFab &bndrynorm, Array< MultiFab, AMREX_SPACEDIM > &areafrac, Array< MultiFab, AMREX_SPACEDIM > &facecent, Array< MultiFab, AMREX_SPACEDIM > &edgecent, MultiFab &levelset, int ng_gfab, const Geometry &geom, const IntVect &ngrow_finest, bool extend_domain_face, int max_grid_size) const
Definition: AMReX_EB_chkpt_file.cpp:104
std::string m_levelset_name
Definition: AMReX_EB_chkpt_file.H:18
void write_to_chkpt_file(const BoxArray &cut_grids, const BoxArray &covered_grids, const MultiFab &volfrac, const MultiFab &centroid, const MultiFab &bndryarea, const MultiFab &bndrycent, const MultiFab &bndrynorm, const Array< MultiFab, AMREX_SPACEDIM > &areafrac, const Array< MultiFab, AMREX_SPACEDIM > &facecent, const Array< MultiFab, AMREX_SPACEDIM > &edgecent, const MultiFab &levelset, const Geometry &geom, const IntVect &ngrow, bool extend_domain_face, int max_grid_size) const
Definition: AMReX_EB_chkpt_file.cpp:305
amrex::Vector< std::string > m_edgecent_name
Definition: AMReX_EB_chkpt_file.H:25
std::string m_restart_file
Definition: AMReX_EB_chkpt_file.H:11
void writeHeader(const BoxArray &cut_ba, const BoxArray &covered_ba, const Geometry &geom, const IntVect &ngrow, bool extend_domain_face, int max_grid_size) const
Definition: AMReX_EB_chkpt_file.cpp:26
std::string m_volfrac_name
Definition: AMReX_EB_chkpt_file.H:13
amrex::Vector< std::string > m_areafrac_name
Definition: AMReX_EB_chkpt_file.H:21
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
Definition: AMReX_FabArrayBase.H:32
AMREX_EXPORT int max_grid_size
Definition: AMReX_EB2.cpp:23
AMREX_EXPORT bool extend_domain_face
Definition: AMReX_EB2.cpp:24
std::array< T, N > Array
Definition: AMReX_Array.H:24