aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev/CarpetIOF5/src/writer.hh
blob: 94b31d3cd356611049fe2b8ebb6c8cd37d4b8841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef WRITER_HH
#define WRITER_HH

#include "cctk.h"

#include "bbox.hh"
#include "defs.hh"
#include "dh.hh"

#include "file.hh"
#include "simulation.hh"
#include "tensor_component.hh"
#include "timestep.hh"
#include "topology.hh"



namespace CarpetIOF5 {
  
  class writer_t {
    
    cGH const * const m_cctkGH;
    int const m_variable;
    
  public:
    
    writer_t (cGH const * cctkGH,
              int variable);
    
    void
    write (F5::file_t & file)
      const;
    
  private:
    
    void
    write_meta (F5::file_t & file,
                bool have_metafile)
      const;
    
    void
    write_one_mglevel (F5::timestep_t & timestep,
                       bool have_metafile)
      const;
    
    void
    write_global (F5::simulation_t & simulation,
                  bool have_metafile)
      const;
    
    void
    write_one_reflevel (F5::simulation_t & simulation,
                        bool have_metafile)
      const;
    
    void
    write_one_map (F5::simulation_t & simulation,
                   bool have_metafile)
      const;
    
    void
    write_one_component (F5::tensor_component_t & tensor_component,
                         bool have_metafile)
      const;
    
    bbox<int,dim> const &
    determine_region (dh::dboxes const & boxes)
      const;
    
  };
  
} // namespace CarpetIOF5

#endif  // #ifndef WRITER_HH