summaryrefslogtreecommitdiff
path: root/src/include/cctk_Interp.h
blob: ace23eeb35adae9200c989d77504e1660da5fcce (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
 /*@@
   @header  cctk_Interp.h
   @date    July 07 1999
   @author  Thomas Radke
   @desc
            Header file for using interpolation operators
   @enddesc

   @history
   @date    July 07 1999
   @author  Thomas Radke
   @hdesc   Just copied from cctk_Reduction.h

   @date    Thu Feb 21 14:36:02 CET 2002
   @author  Jonathan Thornburg <jthorn@aei.mpg.de>
   @hdesc   add more comments, add new stuff for new interpolator API
   @endhistory

   @version $Header$
 @@*/


#ifndef _CCTK_INTERP_H_
#define _CCTK_INTERP_H_

#ifdef CCODE

#ifdef __cplusplus
extern "C"
{
#endif

/*
 * typedefs for interpolation operator routines
 */
typedef int (*cInterpOpLocalUniform) (int N_dims,
                                      int param_table_handle,
                                      /***** coordinate system *****/
                                      const CCTK_REAL coord_origin[],
                                      const CCTK_REAL coord_delta[],
                                      /***** interpolation points *****/
                                      int N_interp_points,
                                      int interp_coords_type_code,
                                      const void *const interp_coords[],
                                      /***** input arrays *****/
                                      int N_input_arrays,
                                      const CCTK_INT input_array_dims[],
                                      const CCTK_INT input_array_type_codes[],
                                      const void *const input_arrays[],
                                      /***** output arrays *****/
                                      int N_output_arrays,
                                      const CCTK_INT output_array_type_codes[],
                                      void *const output_arrays[]);

/*
 * prototypes for user-visible interpolation-registration API
 */
int CCTK_InterpHandle (const char *name);

int CCTK_InterpRegisterOpLocalUniform (cInterpOpLocalUniform operator_ptr,
                                       const char *operator_name,
                                       const char *thorn_name);

const char *CCTK_InterpOperatorImplementation (int handle);
const char *CCTK_InterpOperator (int handle);
int CCTK_NumInterpOperators (void);


/*
 * prototypes for user-visible interpolation API
 */
int CCTK_InterpLocalUniform (int N_dims,
                             int operator_handle,
                             int param_table_handle,
                             /***** coordinate system *****/
                             const CCTK_REAL coord_origin[],
                             const CCTK_REAL coord_delta[],
                             /***** interpolation points *****/
                             int N_interp_points,
                             int interp_coords_type_code,
                             const void *const interp_coords[],
                             /***** input arrays *****/
                             int N_input_arrays,
                             const CCTK_INT input_array_dims[],
                             const CCTK_INT input_array_type_codes[],
                             const void *const input_arrays[],
                             /***** output arrays *****/
                             int N_output_arrays,
                             const CCTK_INT output_array_type_codes[],
                             void *const output_arrays[]);

#ifdef __cplusplus
}
#endif

#endif /* ifdef CCODE */

/*
 * error codes for CCTK_InterpLocalUniform()
 */

/* the grid is too small for the selected interpolation molecule */
#define CCTK_ERROR_INTERP_GRID_TOO_SMALL (-1000)
/* ... old code for backwards compatability */
#define CCTK_ERROR_INTERP_GRID_TOO_TINY  CCTK_ERROR_INTERP_GRID_TOO_SMALL

/*
 * the (multiprocessor) grid's ghostzone size is too small for the selected
 * interpolation molecule (or this processor's chunk of the grid is too small)
 */
#define CCTK_ERROR_INTERP_GHOST_SIZE_TOO_SMALL (-1001)

/*
 * an interpolation point is outside (or too close to an edge of)
 * the input grid
 */
#define CCTK_ERROR_INTERP_POINT_OUTSIDE (-1002)
/* ... old code for backwards compatability */
#define CCTK_ERROR_INTERP_POINT_X_RANGE CCTK_ERROR_INTERP_POINT_OUTSIDE

/* an interpolation point is in (or too close to) an excised region */
#define CCTK_ERROR_INTERP_POINT_EXCISED (-1003)

#endif  /* _INTERP_H_ */