aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev/CarpetIOF5_standalone/src/topology.hh
blob: e179e71db71d56d12662fdc68f7fcf0b0d9b3625 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef TOPOLOGY_HH
#define TOPOLOGY_HH

#include <hdf5.h>

#include "cctk.h"

#include "defs.hh"
#include "vect.hh"

#include "simulation.hh"
#include "utils.hh"



namespace CarpetIOF5 {
  
  namespace F5 {
    
    class topology_t {
      
      topology_t ();
      topology_t (topology_t const &);
      topology_t operator= (topology_t const &);
      
    protected:
      
      simulation_t & m_simulation;
      
      string m_name;
      
      hid_t m_hdf5_topology;
      
      topology_t (simulation_t & simulation);
      
    public:
      
      virtual
      ~ topology_t ();
      
    public:
      
      simulation_t &
      get_simulation ()
        const;
      
      void
      get_link_destination (int proc,
                            string & filename,
                            string & objectname)
        const;
      
      hid_t
      get_hdf5_topology ()
        const;
      
      virtual bool
      invariant ()
        const;
    };
    
    
    
    class unigrid_topology_t : public topology_t {
      
      unigrid_topology_t ();
      unigrid_topology_t (unigrid_topology_t const &);
      unigrid_topology_t operator= (unigrid_topology_t const &);
      
    public:
      
      // Create unigrid topology
      unigrid_topology_t (simulation_t & simulation);
      
      virtual
      ~ unigrid_topology_t ();
      
      virtual bool
      invariant ()
        const;
    };
  
  
  
    class mesh_refinement_topology_t : public topology_t {
      
      int const m_refinement_level;
      int const m_max_refinement_levels;
      vect<int, dim> const m_level_refinement_factor;
      vect<int, dim> const m_max_refinement_factor;
      
      mesh_refinement_topology_t ();
      mesh_refinement_topology_t (mesh_refinement_topology_t const &);
      mesh_refinement_topology_t
      operator= (mesh_refinement_topology_t const &);
      
    public:
      
      mesh_refinement_topology_t (simulation_t & simulation,
                                  int map,
                                  int maps,
                                  int refinement_level,
                                  int max_refinement_levels,
                                  vect<int, dim> const & level_refinement_factors,
                                  vect<int, dim> const & max_refinement_factors);
      
      void
      calculate_level_origin_delta (vect<CCTK_REAL, dim> const & coarse_origin,
                                    vect<CCTK_REAL, dim> const & coarse_delta,
                                    vect<int, dim> const & level_offset,
                                    vect<int, dim> const & level_offset_denominator,
                                    vect<CCTK_REAL, dim> & level_origin,
                                    vect<CCTK_REAL, dim> & level_delta)
        const;
      
      virtual
      ~ mesh_refinement_topology_t ();
      
      void
      get_link_destination (string & filename,
                            string & objectname)
        const;
      
      virtual bool
      invariant ()
        const;
    };
    
  } // namespace F5
  
} // namespace CarpetIOF5

#endif // #ifndef TOPOLOGY_HH