aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/carpet_public.h
blob: e511669e15a47002540f4fbf1115191acf6a91e4 (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 CARPET_PUBLIC_H
#define CARPET_PUBLIC_H

#include <cctk.h>

#ifdef CCTK_MPI
#  include <mpi.h>
#else
#  include "nompi.h"
#endif


/* Tell thorns that the Carpet routines exist */
#define HAVE_CARPET



#ifdef __cplusplus
namespace Carpet {
  extern "C" {
#endif
    
    /* Carpet's GH extension */
    struct CarpetGH {
      
#if 0
      /* Maximum number of refinement levels */
      int maxreflevels;
      
      /* Refinement levels */
      int reflevels;
      
      /* Refinement factor */
      int reffact;
      
      /* Refinement factor on finest possible grid */
      int maxreflevelfact;
      
      /* Base multigrid level */
      int basemglevel;
      
      /* Multigrid levels */
      int mglevels;
      
      /* Multigrid factor */
      int mgfact;
      
      /* Multigrid factor on coarsest grid */
      int maxmglevelfact;
#endif
      
      /* Maps */
      int maps;
      
      
      
#if 0
      /* Current position on the grid hierarchy */
      int reflevel;
      int mglevel;
#endif
      int map;
#if 0
      int component;
      
      /* Current refinement factor */
      int reflevelfact;
      
      /* Current multigrid factor */
      int mglevelfact;
#endif
      
      
      
#if 0
      /* Number of buffer zones */
      int const * nbufferzones;
#endif
      
    };
    
    struct CarpetGH const * GetCarpetGH (const cGH * const cgh)
      CCTK_ATTRIBUTE_PURE;
    
    
    
    /* Prolongation management */
    CCTK_INT CarpetEnableProlongating (const CCTK_INT flag);
    CCTK_INT CarpetQueryProlongating (void);
    
    
    
    /* Grid function access */
    CCTK_POINTER Carpet_VarDataPtrI (CCTK_POINTER_TO_CONST const cctkGH,
                                     CCTK_INT const m,
                                     CCTK_INT const rl,
                                     CCTK_INT const c,
                                     CCTK_INT const tl,
                                     CCTK_INT const varindex);
    
    
    
    /* Call a schedule group */
    int CallScheduleGroup (cGH * const cgh, const char * const group);
    
    /* Call a local function */
    int CallLocalFunction (cGH * const cgh,
                           void (* const function) (cGH * const cgh));
    int CallSinglemapFunction (cGH * const cgh,
                               void (* const function) (cGH * const cgh));
    int CallLevelFunction (cGH * const cgh,
                           void (* const function) (cGH * const cgh));
    int CallGlobalFunction (cGH * const cgh,
                            void (* const function) (cGH * const cgh));
    int CallMetaFunction (cGH * const cgh,
                          void (* const function) (cGH * const cgh));
    
    
    
    /* Helper functions */
    MPI_Comm CarpetMPIComm (void) CCTK_ATTRIBUTE_PURE;
    MPI_Datatype CarpetMPIDatatype (int vartype) CCTK_ATTRIBUTE_PURE;
    MPI_Datatype CarpetSimpleMPIDatatype (int vartype) CCTK_ATTRIBUTE_PURE;
    int CarpetSimpleMPIDatatypeLength (int vartype) CCTK_ATTRIBUTE_PURE;
    
    
    
#ifdef __cplusplus
  } /* extern "C" */
} /* namespace Carpet */
#endif

#endif /* !defined(CARPET_PUBLIC_H) */