aboutsummaryrefslogtreecommitdiff
path: root/src/SymBase.h
blob: 51b08adb19269203251b2a1287ffe5607726ca1d (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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*@@
  @file      SymBase.h
  @author    Erik Schnetter
  @date      2004/03/07 09:48:53
  @desc
             Declarations for thorn SymBase
  @version   $Header$
  @enddesc
@@*/

#ifndef SYMBASE_H
#define SYMBASE_H



#include "cctk.h"
#include "cctk_Arguments.h"



/* SymBase's GH extension */
struct SymBase
{
  /* The table handles below identify tables that have the following
     entries:
     
     CCTK_INT symmetry_handle[2*dim]
     CCTK_INT symmetry_zone_width[2*dim]
     CCTK_FPOINTER symmetry_interpolate[2*dim]
     
     dim is here the dimension of the group containing the variable,
     i.e. there is one entry per face.  The true type of the
     symmetry_interpolate entries is SymmetryInterpolateFPointer.
     
     (Given that user code is not allowed to modify these tables, and
     that this structure is defined here in this header file, there is
     no real need to use tables for this.  It would be possible to put
     these data directly into this structure, thereby simplifying user
     code and not make anything less flexible.)
  */
  
  /* Grid symmetry table handle */
  int sym_table;

  /* Grid array symmetry table handles, one handle per grid
     variable */
  int *array_sym_tables;
};



typedef
CCTK_INT
(* SymmetryInterpolateFPointer) (CCTK_POINTER_TO_CONST const cctkGH_,
                                 CCTK_INT const N_dims,
                                 CCTK_INT const local_interp_handle,
                                 CCTK_INT const param_table_handle,
                                 CCTK_INT const coord_system_handle,
                                 CCTK_INT const N_interp_points,
                                 CCTK_INT const interp_coords_type,
                                 CCTK_POINTER_TO_CONST const interp_coords[],
                                 CCTK_INT const N_input_arrays,
                                 CCTK_INT const input_array_indices[],
                                 CCTK_INT const N_output_arrays,
                                 CCTK_INT const output_array_types[],
                                 CCTK_POINTER const output_arrays[],
                                 CCTK_INT const faces);



/* Number of registered symmetries */
extern int SymBase_num_symmetries;

/* The names of these symmetries */
extern const char **SymBase_symmetry_names;



/* Startup.c */
int SymBase_Startup (void);
void *SymBase_Setup (tFleshConfig * const config,
                     int const convlev, cGH * const cctkGH);

/* Handles.c */
CCTK_INT SymBase_SymmetryRegister (CCTK_STRING const sym_name);
CCTK_INT SymBase_SymmetryHandleOfName (CCTK_STRING const sym_name);
CCTK_POINTER_TO_CONST SymBase_SymmetryNameOfHandle (CCTK_INT const
                                                    sym_handle);

/* Faces.c */
CCTK_INT
SymBase_SymmetryRegisterFaces (CCTK_INT const sym_table,
                               CCTK_INT const group_dim,
                               CCTK_INT const sym_handle,
                               CCTK_INT const *const which_faces,
                               CCTK_INT const *const new_symmetry_zone_width);
CCTK_INT
SymBase_SymmetryRegisterGrid (CCTK_POINTER const cctkGH_,
                              CCTK_INT const sym_handle,
                              CCTK_INT const *const which_faces,
                              CCTK_INT const *const new_symmetry_zone_width);
CCTK_INT
SymBase_SymmetryRegisterGI (CCTK_POINTER const cctkGH_,
                            CCTK_INT const sym_handle,
                            CCTK_INT const *const which_faces,
                            CCTK_INT const *const new_symmetry_zone_width,
                            CCTK_INT const group_index);
CCTK_INT
SymBase_SymmetryRegisterGN (CCTK_POINTER const cctkGH_,
                            CCTK_INT const sym_handle,
                            CCTK_INT const *const which_faces,
                            CCTK_INT const *const new_symmetry_zone_width,
                            CCTK_STRING const group_name);

CCTK_INT
SymBase_SymmetryRegisterInterpolatorFaces (CCTK_INT const sym_table,
                                           CCTK_INT const group_dim,
                                           CCTK_INT const sym_handle,
                                           SymmetryInterpolateFPointer const new_symmetry_interpolate);
CCTK_INT
SymBase_SymmetryRegisterGridInterpolator (CCTK_POINTER const cctkGH_,
                                          CCTK_INT const sym_handle,
                                          SymmetryInterpolateFPointer const new_symmetry_interpolate);

/* Table.c */
CCTK_INT
SymBase_SymmetryTableHandleForGrid (CCTK_POINTER_TO_CONST const cctkGH_);
CCTK_INT
SymBase_SymmetryTableHandleForGI (CCTK_POINTER_TO_CONST const cctkGH_,
                                  CCTK_INT const group_index);
CCTK_INT
SymBase_SymmetryTableHandleForGN (CCTK_POINTER_TO_CONST const cctkGH_,
                                  CCTK_STRING const group_name);

/* Interpolate.c */
CCTK_INT
SymBase_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_,
                             CCTK_INT const N_dims,
                             CCTK_INT const local_interp_handle,
                             CCTK_INT const param_table_handle,
                             CCTK_INT const coord_system_handle,
                             CCTK_INT const N_interp_points,
                             CCTK_INT const interp_coords_type,
                             CCTK_POINTER_TO_CONST const interp_coords[],
                             CCTK_INT const N_input_arrays,
                             CCTK_INT const input_array_indices[],
                             CCTK_INT const N_output_arrays,
                             CCTK_INT const output_array_types[],
                             CCTK_POINTER const output_arrays[]);
CCTK_INT
SymBase_SymmetryInterpolateFaces (CCTK_POINTER_TO_CONST const cctkGH_,
                                  CCTK_INT const N_dims,
                                  CCTK_INT const local_interp_handle,
                                  CCTK_INT const param_table_handle,
                                  CCTK_INT const coord_system_handle,
                                  CCTK_INT const N_interp_points,
                                  CCTK_INT const interp_coords_type,
                                  CCTK_POINTER_TO_CONST const interp_coords[],
                                  CCTK_INT const N_input_arrays,
                                  CCTK_INT const input_array_indices[],
                                  CCTK_INT const N_output_arrays,
                                  CCTK_INT const output_array_types[],
                                  CCTK_POINTER const output_arrays[],
                                  CCTK_INT const faces);

/* Statistics.c */
void
SymBase_Statistics (CCTK_ARGUMENTS);

/* Check.c */
void
SymBase_Check (CCTK_ARGUMENTS);



#endif /* ! defined SYMBASE_H */