/* fetch.c -- fetch molecule-sized piece of input array into struct data */ /* $Header$ */ #include "cctk.h" #include "../InterpLocalUniform.h" #include "structs.h" #include "fetch.h" /******************************************************************************/ /* * 1-D routines */ #undef INT_STRIDE_IJK #define INT_STRIDE_IJK int stride_i #undef DATA_REAL #define DATA_REAL(mi) ptr[stride_i*mi] #undef DATA_COMPLEX #define DATA_COMPLEX(mi) ptr[stride_i*mi][part] #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_1d_cube2_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_1d_cube_size2 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "1d.cube.size2/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_1d_cube3_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_1d_cube_size3 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "1d.cube.size3/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_1d_cube4_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_1d_cube_size4 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "1d.cube.size4/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_1d_cube5_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_1d_cube_size5 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "1d.cube.size5/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME_PREFIX #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_1d_cube6_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_1d_cube_size6 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "1d.cube.size6/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_1d_cube7_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_1d_cube_size7 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "1d.cube.size7/fetch-data.c" #include "fetch-template.c" /******************************************************************************/ /* * 2-D routines */ #undef INT_STRIDE_IJK #define INT_STRIDE_IJK int stride_i, int stride_j #undef DATA_REAL #define DATA_REAL(mi,mj) ptr[stride_i*mi + stride_j*mj] #undef DATA_COMPLEX #define DATA_COMPLEX(mi,mj) ptr[stride_i*mi + stride_j*mj][part] #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_2d_cube2_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_2d_cube_size2 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "2d.cube.size2/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_2d_cube3_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_2d_cube_size3 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "2d.cube.size3/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_2d_cube4_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_2d_cube_size4 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "2d.cube.size4/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_2d_cube5_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_2d_cube_size5 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "2d.cube.size5/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME_PREFIX #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_2d_cube6_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_2d_cube_size6 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "2d.cube.size6/fetch-data.c" #include "fetch-template.c" /******************************************************************************/ /* * 3-D routines */ #undef INT_STRIDE_IJK #define INT_STRIDE_IJK int stride_i, int stride_j, int stride_k #undef DATA_REAL #define DATA_REAL(mi,mj,mk) ptr[stride_i*mi + stride_j*mj + stride_k*mk] #undef DATA_COMPLEX #define DATA_COMPLEX(mi,mj,mk) ptr[stride_i*mi + stride_j*mj + stride_k*mk] \ [part] #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_3d_cube2_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_3d_cube_size2 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "3d.cube.size2/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_3d_cube3_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_3d_cube_size3 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "3d.cube.size3/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_3d_cube4_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_3d_cube_size4 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "3d.cube.size4/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_3d_cube5_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_3d_cube_size5 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "3d.cube.size5/fetch-data.c" #include "fetch-template.c" #undef FETCH_FUNCTION_NAME_PREFIX #undef FETCH_FUNCTION_NAME #define FETCH_FUNCTION_NAME(type) LocalInterp_fetch_3d_cube6_ ## type #undef DATA_STRUCT #define DATA_STRUCT data_struct_3d_cube_size6 #undef FETCH_DATA_FILE_NAME #define FETCH_DATA_FILE_NAME "3d.cube.size6/fetch-data.c" #include "fetch-template.c"