aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Requirements/src/Requirements.hh
blob: 26647c9d8d9f55f9672669549b5f7b28af643b8a (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
#ifndef REQUIREMENTS_HH
#define REQUIREMENTS_HH

#include <cctk.h>
#include <cctk_Schedule.h>

#include <vector>
  
namespace Requirements {
  
  using namespace std;
  
  namespace valid {
    enum valid_t { nowhere, interior, everywhere };
  }

  enum zones_t { BIT_NONE, BIT_INTERIOR, BIT_BOUNDARY, BIT_GHOSTZONES, BIT_BOUNDARY_GHOSTZONES };
  
  // Set up basic grid structure
  void Setup(int maps);
  // Change number of allocated time levels
  void ChangeStorage(vector<int> const& groups, vector<int> const& timelevels,
                     int reflevel);
  // Regrid, set new number of refinement levels, mark all levels as
  // invalid
  void Regrid(int reflevels);
  // Recompose, ensures valid data on one level, indicating whether
  // boundaries are valid (e.g. if recomposing was a no-op)
  void Recompose(int reflevel, valid::valid_t where);
  // Free data structures after regridding
  void RegridFree();
  // Cycle time levels
  void Cycle(int reflevel);
  // Before calling a routine: ensure all reads clauses are
  // satisfied
  // TODO: Either combine these "before" and "after" routines, or
  // split the other routines as well
  void BeforeRoutine(cFunctionData const* function_data,
                     int reflevel, int map,
                     int timelevel, int timelevel_offset);
  // After calling a routine: update according to writes clauses
  void AfterRoutine(cFunctionData const* function_data,
                    CCTK_INT cctk_iteration,
                    int reflevel, int map,
                    int timelevel, int timelevel_offset);
  // Synchronise and prolongate
  // TODO: This does not handle variables that are not prolongated
  // TODO: This does not handle buffer zones
  void Sync(cFunctionData const* function_data, CCTK_INT cctk_iteration,
            vector<int> const& groups, int reflevel, int timelevel);
  // Restrict
  void Restrict(vector<int> const& groups, CCTK_INT cctk_iteration, int reflevel);
  
} // namespace Requirements

#endif // #ifndef REQUIREMENTS_HH