diff options
author | jthorn <jthorn@df1f8a13-aa1d-4dd4-9681-27ded5b42416> | 2002-09-01 18:10:41 +0000 |
---|---|---|
committer | jthorn <jthorn@df1f8a13-aa1d-4dd4-9681-27ded5b42416> | 2002-09-01 18:10:41 +0000 |
commit | f66e9bbb167e3e3e98b0647e30fa22139d6f28f0 (patch) | |
tree | 01b5d8d23679ef302f5df71c1a62fe1bb1b6628e /src/GeneralizedPolynomial-Uniform/common/fetch.c | |
parent | 5ae03060c304e68a184efaf4d77a6d46d3bd24ce (diff) |
reorganize common to Lagrange and Hermite interpolators
(i.e. code depending only on molecule size/shape)
--> now there are separate *functions* rather than just code fragments
--> ../template.c should hopefully compile in finite time.....
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalInterp/trunk@109 df1f8a13-aa1d-4dd4-9681-27ded5b42416
Diffstat (limited to 'src/GeneralizedPolynomial-Uniform/common/fetch.c')
-rw-r--r-- | src/GeneralizedPolynomial-Uniform/common/fetch.c | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/src/GeneralizedPolynomial-Uniform/common/fetch.c b/src/GeneralizedPolynomial-Uniform/common/fetch.c new file mode 100644 index 0000000..ee4e5a1 --- /dev/null +++ b/src/GeneralizedPolynomial-Uniform/common/fetch.c @@ -0,0 +1,179 @@ +/* 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" |