File size: 52,503 Bytes
0950351 10a2580 0950351 | 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 | {
"thorn_name": "CactusNumerical/InterpToArray",
"url": "https://bitbucket.org/cactuscode/cactusnumerical.git",
"configuration": "",
"interface": "# Interface definition for thorn InterpToArray\n\nIMPLEMENTS: InterpToArray\n\nCCTK_INT FUNCTION \\\n InterpGridArrays \\\n (CCTK_POINTER_TO_CONST IN cctkGH, \\\n CCTK_INT IN N_dims, \\\n CCTK_INT IN order, \\\n CCTK_INT IN N_interp_points, \\\n CCTK_POINTER_TO_CONST IN interp_coords, \\\n CCTK_INT IN N_input_arrays, \\\n CCTK_INT ARRAY IN input_array_indices, \\\n CCTK_INT IN N_output_arrays, \\\n CCTK_POINTER IN output_arrays)\nUSES FUNCTION InterpGridArrays\n\nPUBLIC:\n\nREAL scalars[nscalars] TYPE=scalar\n\nREAL arrays1d[narrays1d] TYPE=array DIM=1 DISTRIB=constant SIZE=array1d_npoints_i\nREAL arrays2d[narrays2d] TYPE=array DIM=2 DISTRIB=constant SIZE=array2d_npoints_i,array2d_npoints_j\nREAL arrays3d[narrays3d] TYPE=array DIM=3 DISTRIB=constant SIZE=array3d_npoints_i,array3d_npoints_j,array3d_npoints_k\n\nREAL parrays1d[nparrays1d] TYPE=array DIM=1 DISTRIB=default SIZE=parray1d_npoints_i GHOSTSIZE=nghosts\nREAL parrays2d[nparrays2d] TYPE=array DIM=2 DISTRIB=default SIZE=parray2d_npoints_i,parray2d_npoints_j GHOSTSIZE=nghosts,nghosts\nREAL parrays3d[nparrays3d] TYPE=array DIM=3 DISTRIB=default SIZE=parray3d_npoints_i,parray3d_npoints_j,parray3d_npoints_k GHOSTSIZE=nghosts,nghosts,nghosts\n",
"param": "# Parameter definitions for thorn InterpToArray\n\nRESTRICTED:\n\n# CCTK_InterpGridArrays parameters\n\nSTRING interpolator_name \"Name of the interpolator\" STEERABLE=always\n{\n \".*\" :: \"must be a registered interpolator\"\n} \"Lagrange polynomial interpolation\"\n\nSTRING interpolator_options \"Options for the interpolator\" STEERABLE=always\n{\n \".*\" :: \"must be a valid option specification\"\n} \"order=2\"\n\nSTRING interpolator_coordinates \"Coordinate system\" STEERABLE=always\n{\n \".*\" :: \"must be a registered coordinate system\"\n} \"cart3d\"\n\n# InterpGridArrays ie. CarpetInterp2 parameters\n\nBOOLEAN use_carpetinterp2 \"Use InterpGridArrays rather than CCTK_InterpGridArrays\" STEERABLE=always\n{\n} \"no\"\n\nINT carpetinterp2_interpolator_order \"Order of interpolation for CarpetInterp2\" STEERABLE=always\n{\n 0:* :: \"any order supported by CarpetInterp2\"\n} 2\n\n\n# Common parameters\n\nINT nghosts \"Number of ghost zones\"\n{\n 0:* :: \"\"\n} 0\n\n\n\nINT nscalars \"Number of grid scalars\"\n{\n 0:100 :: \"\"\n} 0\n\nSTRING scalar_vars[100] \"Names of the grid functions that should be interpolated on a point\" STEERABLE=always\n{\n \"^$\" :: \"do not interpolate\"\n \"^[A-Za-z][A-Za-z0-9_]*[:][:][A-Za-z][A-Za-z0-9_]*$\" :: \"grid function name\"\n} \"\"\n\nREAL scalar_x0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL scalar_y0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL scalar_z0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\n\n\nINT narrays1d \"Number of 1D grid arrays\"\n{\n 0:100 :: \"\"\n} 0\n\nSTRING array1d_vars[100] \"Names of the grid functions that should be interpolated on a line\" STEERABLE=always\n{\n \"^$\" :: \"do not interpolate\"\n \"^[A-Za-z][A-Za-z0-9_]*[:][:][A-Za-z][A-Za-z0-9_]*$\" :: \"grid function name\"\n} \"\"\n\nINT array1d_spacederivs[100] \"Space derivative orders for each grid function\"\n{\n 0:* :: \"\"\n} 0\n\nINT array1d_timederivs[100] \"Time derivative order for each grid function\"\n{\n 0:* :: \"\"\n} 0\n\nREAL array1d_x0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL array1d_y0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL array1d_z0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nINT array1d_npoints_i \"Number of grid points for the 1D grid arrays in the i direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL array1d_dx_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array1d_dy_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array1d_dz_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\n\n\nINT narrays2d \"Number of 2D grid arrays\"\n{\n 0:100 :: \"\"\n} 0\n\nSTRING array2d_vars[100] \"Names of the grid functions that should be interpolated on a 2D grid\" STEERABLE=always\n{\n \"^$\" :: \"do not interpolate\"\n \"^[A-Za-z][A-Za-z0-9_]*[:][:][A-Za-z][A-Za-z0-9_]*$\" :: \"grid function name\"\n} \"\"\n\nREAL array2d_x0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL array2d_y0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL array2d_z0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nINT array2d_npoints_i \"Number of grid points for the 2D grid arrays in the i direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL array2d_dx_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array2d_dy_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array2d_dz_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nINT array2d_npoints_j \"Number of grid points for the 2D grid arrays in the j direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL array2d_dx_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array2d_dy_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array2d_dz_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\n\n\nINT narrays3d \"Number of 3D grid arrays\"\n{\n 0:100 :: \"\"\n} 0\n\nSTRING array3d_vars[100] \"Names of the grid functions that should be interpolated on a 3D grid\" STEERABLE=always\n{\n \"^$\" :: \"do not interpolate\"\n \"^[A-Za-z][A-Za-z0-9_]*[:][:][A-Za-z][A-Za-z0-9_]*$\" :: \"grid function name\"\n} \"\"\n\nREAL array3d_x0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL array3d_y0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL array3d_z0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nINT array3d_npoints_i \"Number of grid points for the 3D grid arrays in the i direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL array3d_dx_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array3d_dy_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array3d_dz_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nINT array3d_npoints_j \"Number of grid points for the 3D grid arrays in the j direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL array3d_dx_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array3d_dy_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array3d_dz_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nINT array3d_npoints_k \"Number of grid points for the 3D grid arrays in the k direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL array3d_dx_k \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array3d_dy_k \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL array3d_dz_k \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\n\n\nINT nparrays1d \"Number of 1D parallel grid arrays\"\n{\n 0:100 :: \"\"\n} 0\n\nSTRING parray1d_vars[100] \"Names of the grid functions that should be interpolated on a line\" STEERABLE=always\n{\n \"^$\" :: \"do not interpolate\"\n \"^[A-Za-z][A-Za-z0-9_]*[:][:][A-Za-z][A-Za-z0-9_]*$\" :: \"grid function name\"\n} \"\"\n\nINT parray1d_spacederivs[100] \"Space derivative orders for each grid function\"\n{\n 0:* :: \"\"\n} 0\n\nINT parray1d_timederivs[100] \"Time derivative order for each grid function\"\n{\n 0:* :: \"\"\n} 0\n\nREAL parray1d_x0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL parray1d_y0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL parray1d_z0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nINT parray1d_npoints_i \"Number of grid points for the 1D grid parrays in the i direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL parray1d_dx_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray1d_dy_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray1d_dz_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\n\n\nINT nparrays2d \"Number of 2D parallel grid arrays\"\n{\n 0:100 :: \"\"\n} 0\n\nSTRING parray2d_vars[100] \"Names of the grid functions that should be interpolated on a 2D grid\" STEERABLE=always\n{\n \"^$\" :: \"do not interpolate\"\n \"^[A-Za-z][A-Za-z0-9_]*[:][:][A-Za-z][A-Za-z0-9_]*$\" :: \"grid function name\"\n} \"\"\n\nREAL parray2d_x0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL parray2d_y0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL parray2d_z0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nINT parray2d_npoints_i \"Number of grid points for the 2D parallel grid arrays in the i direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL parray2d_dx_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray2d_dy_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray2d_dz_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nINT parray2d_npoints_j \"Number of grid points for the 2D parallel grid arrays in the j direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL parray2d_dx_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray2d_dy_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray2d_dz_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\n\n\nINT nparrays3d \"Number of 3D grid parrays\"\n{\n 0:100 :: \"\"\n} 0\n\nSTRING parray3d_vars[100] \"Names of the grid functions that should be interpolated on a 3D grid\" STEERABLE=always\n{\n \"^$\" :: \"do not interpolate\"\n \"^[A-Za-z][A-Za-z0-9_]*[:][:][A-Za-z][A-Za-z0-9_]*$\" :: \"grid function name\"\n} \"\"\n\nREAL parray3d_x0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL parray3d_y0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nREAL parray3d_z0 \"Origin\" STEERABLE=always\n{\n *:* :: \"\"\n} 0.0\n\nINT parray3d_npoints_i \"Number of grid points for the 3D parallel grid arrays in the i direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL parray3d_dx_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray3d_dy_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray3d_dz_i \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nINT parray3d_npoints_j \"Number of grid points for the 3D parallel grid arrays in the j direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL parray3d_dx_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray3d_dy_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray3d_dz_j \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nINT parray3d_npoints_k \"Number of grid points for the 3D parallel grid arrays in the k direction\"\n{\n 0:* :: \"\"\n} 0\n\nREAL parray3d_dx_k \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray3d_dy_k \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n\nREAL parray3d_dz_k \"Spacing\" STEERABLE=always\n{\n 0.0:* :: \"\"\n} 0.0\n",
"schedule": "# Schedule definitions for thorn InterpToArray\n\nSCHEDULE InterpToArray AT analysis\n{\n LANG: C\n OPTIONS: global\n STORAGE: scalars arrays1d arrays2d arrays3d parrays1d parrays2d parrays3d\n TRIGGERS: scalars arrays1d arrays2d arrays3d parrays1d parrays2d parrays3d\n WRITES: InterpToArray::scalars(everywhere), arrays1d, arrays2d, arrays3d\n WRITES: InterpToArray::parrays1d(everywhere), parrays2d, parrays3d\n} \"Interpolate to grid arrays\"\n",
"src": {
"make.code.defn": "# Main make.code.defn file for thorn InterpToArray\n\n# Source files in this directory\nSRCS = interp.c\n\n# Subdirectories containing source files\nSUBDIRS = \n",
"interp.c": "#include <assert.h>\n#include <stdlib.h>\n\n#include <cctk.h>\n#include <cctk_Arguments.h>\n#include <cctk_Parameters.h>\n\n#include <util_Table.h>\n\n\n\nvoid\nInterpToArray (CCTK_ARGUMENTS)\n{\n DECLARE_CCTK_ARGUMENTS_InterpToArray;\n DECLARE_CCTK_PARAMETERS;\n \n \n \n int interpolator = -1;\n if (!use_carpetinterp2) {\n interpolator = CCTK_InterpHandle (interpolator_name);\n assert (interpolator >= 0);\n }\n \n int options_table = -1;\n if (!use_carpetinterp2) {\n options_table = Util_TableCreateFromString (interpolator_options);\n assert (options_table >= 0);\n }\n \n int coord_handle = -1;\n if (!use_carpetinterp2) {\n coord_handle = CCTK_CoordSystemHandle (interpolator_coordinates);\n assert (coord_handle >= 0);\n }\n \n \n\n /* Scalars */\n {\n int const nvars = nscalars;\n if (nvars > 0) {\n int const npoints = 1;\n \n CCTK_REAL * restrict const\n coordsx = malloc (npoints * sizeof * coordsx);\n assert (npoints==0 || coordsx);\n CCTK_REAL * restrict const\n coordsy = malloc (npoints * sizeof * coordsy);\n assert (npoints==0 || coordsy);\n CCTK_REAL * restrict const\n coordsz = malloc (npoints * sizeof * coordsz);\n assert (npoints==0 || coordsz);\n CCTK_POINTER_TO_CONST coords[3];\n coords[0] = coordsx;\n coords[1] = coordsy;\n coords[2] = coordsz;\n \n {\n int const n = 0;\n coordsx[n] = scalar_x0;\n coordsy[n] = scalar_y0;\n coordsz[n] = scalar_z0;\n }\n \n CCTK_INT * restrict const\n inputs = malloc (nvars * sizeof * inputs);\n assert (inputs);\n \n for (int n=0; n<nvars; ++n) {\n inputs[n] = CCTK_VarIndex (scalar_vars[n]);\n if (inputs[n] < 0) {\n inputs[n] = -1;\n }\n }\n \n CCTK_INT * restrict const\n output_types = malloc (nvars * sizeof * output_types);\n assert (output_types);\n \n for (int n=0; n<nvars; ++n) {\n output_types[n] = CCTK_VARIABLE_REAL;\n }\n \n CCTK_POINTER * restrict const outputs = malloc (nvars * sizeof * outputs);\n assert (outputs);\n \n for (int n=0; n<nvars; ++n) {\n outputs[n] = &scalars[npoints * n];\n }\n \n if (use_carpetinterp2)\n {\n int const ierr = InterpGridArrays\n (cctkGH, 3, carpetinterp2_interpolator_order,\n npoints, coords,\n nvars, inputs,\n nvars, outputs);\n assert (! ierr);\n }\n else\n {\n int const ierr = CCTK_InterpGridArrays\n (cctkGH, 3, interpolator, options_table, coord_handle,\n npoints, CCTK_VARIABLE_REAL, coords,\n nvars, inputs,\n nvars, output_types, outputs);\n assert (! ierr);\n }\n \n free (coordsx);\n free (coordsy);\n free (coordsz);\n free (inputs);\n free (output_types);\n free (outputs);\n }\n }\n \n \n \n /* 1D Arrays */\n {\n int const nvars = narrays1d;\n if (nvars > 0) {\n int const npoints = array1d_npoints_i;\n \n CCTK_REAL * restrict const\n coordsx = malloc (npoints * sizeof * coordsx);\n assert (npoints==0 || coordsx);\n CCTK_REAL * restrict const\n coordsy = malloc (npoints * sizeof * coordsy);\n assert (npoints==0 || coordsy);\n CCTK_REAL * restrict const\n coordsz = malloc (npoints * sizeof * coordsz);\n assert (npoints==0 || coordsz);\n CCTK_POINTER_TO_CONST coords[3];\n coords[0] = coordsx;\n coords[1] = coordsy;\n coords[2] = coordsz;\n \n#pragma omp parallel for\n for (int i=0; i<array1d_npoints_i; ++i) {\n int const n = i;\n coordsx[n] = array1d_x0 + i * array1d_dx_i;\n coordsy[n] = array1d_y0 + i * array1d_dy_i;\n coordsz[n] = array1d_z0 + i * array1d_dz_i;\n }\n \n CCTK_INT * restrict const\n inputs = malloc (nvars * sizeof * inputs);\n assert (inputs);\n \n for (int n=0; n<nvars; ++n) {\n inputs[n] = CCTK_VarIndex (array1d_vars[n]);\n assert (inputs[n] >= 0);\n if (inputs[n] < 0) {\n inputs[n] = -1;\n }\n }\n \n CCTK_INT * restrict const\n output_types = malloc (nvars * sizeof * output_types);\n assert (output_types);\n \n for (int n=0; n<nvars; ++n) {\n output_types[n] = CCTK_VARIABLE_REAL;\n }\n \n CCTK_POINTER * restrict const\n outputs = malloc (nvars * sizeof * outputs);\n assert (outputs);\n \n for (int n=0; n<nvars; ++n) {\n outputs[n] = &arrays1d[npoints * n];\n }\n \n CCTK_INT * restrict const\n operation_codes = malloc (nvars * sizeof * operation_codes);\n assert (operation_codes);\n \n for (int n=0; n<nvars; ++n) {\n operation_codes[n] = array1d_spacederivs[n];\n }\n \n {\n int const ierr = Util_TableSetIntArray\n (options_table, nvars, operation_codes, \"operation_codes\");\n assert (! ierr);\n }\n \n CCTK_INT * restrict const\n time_deriv_order = malloc (nvars * sizeof * time_deriv_order);\n assert (time_deriv_order);\n \n for (int n=0; n<nvars; ++n) {\n time_deriv_order[n] = array1d_timederivs[n];\n }\n \n {\n int const ierr = Util_TableSetIntArray\n (options_table, nvars, time_deriv_order, \"time_deriv_order\");\n assert (! ierr);\n }\n \n if (use_carpetinterp2)\n {\n int const ierr = InterpGridArrays\n (cctkGH, 3, carpetinterp2_interpolator_order,\n npoints, coords,\n nvars, inputs,\n nvars, outputs);\n assert (! ierr);\n }\n else\n {\n int const ierr = CCTK_InterpGridArrays\n (cctkGH, 3, interpolator, options_table, coord_handle,\n npoints, CCTK_VARIABLE_REAL, coords,\n nvars, inputs,\n nvars, output_types, outputs);\n assert (! ierr);\n }\n \n {\n int const ierr = Util_TableDeleteKey (options_table, \"operation_codes\");\n assert (! ierr);\n }\n \n {\n int const ierr =\n Util_TableDeleteKey (options_table, \"time_deriv_order\");\n assert (! ierr);\n }\n \n free (coordsx);\n free (coordsy);\n free (coordsz);\n free (inputs);\n free (output_types);\n free (outputs);\n free (operation_codes);\n free (time_deriv_order);\n }\n }\n \n \n \n /* 2D Arrays */\n {\n int const nvars = narrays2d;\n if (nvars > 0) {\n int const npoints = array2d_npoints_i * array2d_npoints_j;\n \n CCTK_REAL * restrict const\n coordsx = malloc (npoints * sizeof * coordsx);\n assert (npoints==0 || coordsx);\n CCTK_REAL * restrict const\n coordsy = malloc (npoints * sizeof * coordsy);\n assert (npoints==0 || coordsy);\n CCTK_REAL * restrict const\n coordsz = malloc (npoints * sizeof * coordsz);\n assert (npoints==0 || coordsz);\n CCTK_POINTER_TO_CONST coords[3];\n coords[0] = coordsx;\n coords[1] = coordsy;\n coords[2] = coordsz;\n \n#pragma omp parallel for\n for (int j=0; j<array2d_npoints_j; ++j) {\n for (int i=0; i<array2d_npoints_i; ++i) {\n const int n = i + array2d_npoints_i * j;\n coordsx[n] = array2d_x0 + i * array2d_dx_i + j * array2d_dx_j;\n coordsy[n] = array2d_y0 + i * array2d_dy_i + j * array2d_dy_j;\n coordsz[n] = array2d_z0 + i * array2d_dz_i + j * array2d_dz_j;\n }\n }\n \n CCTK_INT * restrict const\n inputs = malloc (nvars * sizeof * inputs);\n assert (inputs);\n \n for (int n=0; n<nvars; ++n) {\n inputs[n] = CCTK_VarIndex (array2d_vars[n]);\n if (inputs[n] < 0) {\n inputs[n] = -1;\n }\n }\n \n CCTK_INT * restrict const\n output_types = malloc (nvars * sizeof * output_types);\n assert (output_types);\n \n for (int n=0; n<nvars; ++n) {\n output_types[n] = CCTK_VARIABLE_REAL;\n }\n \n CCTK_POINTER * restrict const\n outputs = malloc (nvars * sizeof * outputs);\n assert (outputs);\n \n for (int n=0; n<nvars; ++n) {\n outputs[n] = &arrays2d[npoints * n];\n }\n \n if (use_carpetinterp2)\n {\n int const ierr = InterpGridArrays\n (cctkGH, 3, carpetinterp2_interpolator_order,\n npoints, coords,\n nvars, inputs,\n nvars, outputs);\n assert (! ierr);\n }\n else\n {\n int const ierr = CCTK_InterpGridArrays\n (cctkGH, 3, interpolator, options_table, coord_handle,\n npoints, CCTK_VARIABLE_REAL, coords,\n nvars, inputs,\n nvars, output_types, outputs);\n assert (! ierr);\n }\n \n free (coordsx);\n free (coordsy);\n free (coordsz);\n free (inputs);\n free (output_types);\n free (outputs);\n }\n }\n \n \n \n /* 3D Arrays */\n {\n int const nvars = narrays3d;\n if (nvars > 0) {\n int const npoints =\n array3d_npoints_i * array3d_npoints_j * array3d_npoints_k;\n \n CCTK_REAL * restrict const\n coordsx = malloc (npoints * sizeof * coordsx);\n assert (npoints==0 || coordsx);\n CCTK_REAL * restrict const\n coordsy = malloc (npoints * sizeof * coordsy);\n assert (npoints==0 || coordsy);\n CCTK_REAL * restrict const\n coordsz = malloc (npoints * sizeof * coordsz);\n assert (npoints==0 || coordsz);\n CCTK_POINTER_TO_CONST coords[3];\n coords[0] = coordsx;\n coords[1] = coordsy;\n coords[2] = coordsz;\n \n#pragma omp parallel for\n for (int k=0; k<array3d_npoints_k; ++k) {\n for (int j=0; j<array3d_npoints_j; ++j) {\n for (int i=0; i<array3d_npoints_i; ++i) {\n int const n = i + array3d_npoints_i * (j + array3d_npoints_j * k);\n coordsx[n] = array3d_x0 + i * array3d_dx_i + j * array3d_dx_j + k * array3d_dx_k;\n coordsy[n] = array3d_y0 + i * array3d_dy_i + j * array3d_dy_j + k * array3d_dy_k;\n coordsz[n] = array3d_z0 + i * array3d_dz_i + j * array3d_dz_j + k * array3d_dz_k;\n }\n }\n }\n \n CCTK_INT * restrict const\n inputs = malloc (nvars * sizeof * inputs);\n assert (inputs);\n \n for (int n=0; n<nvars; ++n) {\n inputs[n] = CCTK_VarIndex (array3d_vars[n]);\n if (inputs[n] < 0) {\n inputs[n] = -1;\n }\n }\n \n CCTK_INT * restrict const\n output_types = malloc (nvars * sizeof * output_types);\n assert (output_types);\n \n for (int n=0; n<nvars; ++n) {\n output_types[n] = CCTK_VARIABLE_REAL;\n }\n \n CCTK_POINTER * restrict const\n outputs = malloc (nvars * sizeof * outputs);\n assert (outputs);\n \n for (int n=0; n<nvars; ++n) {\n outputs[n] = &arrays3d[npoints * n];\n }\n \n if (use_carpetinterp2)\n {\n int const ierr = InterpGridArrays\n (cctkGH, 3, carpetinterp2_interpolator_order,\n npoints, coords,\n nvars, inputs,\n nvars, outputs);\n assert (! ierr);\n }\n else\n {\n int const ierr = CCTK_InterpGridArrays\n (cctkGH, 3, interpolator, options_table, coord_handle,\n npoints, CCTK_VARIABLE_REAL, coords,\n nvars, inputs,\n nvars, output_types, outputs);\n assert (! ierr);\n }\n \n free (coordsx);\n free (coordsy);\n free (coordsz);\n free (inputs);\n free (output_types);\n free (outputs);\n }\n }\n \n \n \n /* Parallel 1D Arrays */\n {\n int const nvars = nparrays1d;\n if (nvars > 0) {\n int const group = CCTK_GroupIndex (\"InterpToArray::parrays1d\");\n assert (group >= 0);\n cGroupDynamicData dyndata;\n {\n int const ierr = CCTK_GroupDynamicData (cctkGH, group, &dyndata);\n assert (! ierr);\n }\n assert (dyndata.dim == 1);\n int const npoints = dyndata.lsh[0];\n \n CCTK_REAL * restrict const\n coordsx = malloc (npoints * sizeof * coordsx);\n assert (npoints==0 || coordsx);\n CCTK_REAL * restrict const\n coordsy = malloc (npoints * sizeof * coordsy);\n assert (npoints==0 || coordsy);\n CCTK_REAL * restrict const\n coordsz = malloc (npoints * sizeof * coordsz);\n assert (npoints==0 || coordsz);\n CCTK_POINTER_TO_CONST coords[3];\n coords[0] = coordsx;\n coords[1] = coordsy;\n coords[2] = coordsz;\n \n#pragma omp parallel for\n for (int i=0; i<dyndata.lsh[0]; ++i) {\n int const n = i;\n coordsx[n] = (parray1d_x0 +\n (dyndata.lbnd[0] + i) * parray1d_dx_i);\n coordsy[n] = (parray1d_y0 +\n (dyndata.lbnd[0] + i) * parray1d_dy_i);\n coordsz[n] = (parray1d_z0 +\n (dyndata.lbnd[0] + i) * parray1d_dz_i);\n }\n \n CCTK_INT * restrict const\n inputs = malloc (nvars * sizeof * inputs);\n assert (inputs);\n \n for (int n=0; n<nvars; ++n) {\n inputs[n] = CCTK_VarIndex (parray1d_vars[n]);\n assert (inputs[n] >= 0);\n if (inputs[n] < 0) {\n inputs[n] = -1;\n }\n }\n \n CCTK_INT * restrict const\n output_types = malloc (nvars * sizeof * output_types);\n assert (output_types);\n \n for (int n=0; n<nvars; ++n) {\n output_types[n] = CCTK_VARIABLE_REAL;\n }\n \n CCTK_POINTER * restrict const\n outputs = malloc (nvars * sizeof * outputs);\n assert (outputs);\n \n for (int n=0; n<nvars; ++n) {\n outputs[n] = &parrays1d[npoints * n];\n }\n \n CCTK_INT * restrict const\n operation_codes = malloc (nvars * sizeof * operation_codes);\n assert (operation_codes);\n \n for (int n=0; n<nvars; ++n) {\n operation_codes[n] = parray1d_spacederivs[n];\n }\n \n {\n int const ierr = Util_TableSetIntArray\n (options_table, nvars, operation_codes, \"operation_codes\");\n assert (! ierr);\n }\n \n CCTK_INT * restrict const\n time_deriv_order = malloc (nvars * sizeof * time_deriv_order);\n assert (time_deriv_order);\n \n for (int n=0; n<nvars; ++n) {\n time_deriv_order[n] = parray1d_timederivs[n];\n }\n \n {\n int const ierr = Util_TableSetIntArray\n (options_table, nvars, time_deriv_order, \"time_deriv_order\");\n assert (! ierr);\n }\n \n if (use_carpetinterp2)\n {\n int const ierr = InterpGridArrays\n (cctkGH, 3, carpetinterp2_interpolator_order,\n npoints, coords,\n nvars, inputs,\n nvars, outputs);\n assert (! ierr);\n }\n else\n {\n int const ierr = CCTK_InterpGridArrays\n (cctkGH, 3, interpolator, options_table, coord_handle,\n npoints, CCTK_VARIABLE_REAL, coords,\n nvars, inputs,\n nvars, output_types, outputs);\n assert (! ierr);\n }\n \n {\n int const ierr = Util_TableDeleteKey (options_table, \"operation_codes\");\n assert (! ierr);\n }\n \n {\n int const ierr =\n Util_TableDeleteKey (options_table, \"time_deriv_order\");\n assert (! ierr);\n }\n \n free (coordsx);\n free (coordsy);\n free (coordsz);\n free (inputs);\n free (output_types);\n free (outputs);\n free (operation_codes);\n free (time_deriv_order);\n }\n }\n \n \n \n /* Parallel 2D Arrays */\n {\n int const nvars = nparrays2d;\n if (nvars > 0) {\n int const group = CCTK_GroupIndex (\"InterpToArray::parrays2d\");\n assert (group >= 0);\n cGroupDynamicData dyndata;\n {\n int const ierr = CCTK_GroupDynamicData (cctkGH, group, &dyndata);\n assert (! ierr);\n }\n assert (dyndata.dim == 2);\n int const npoints = dyndata.lsh[0] * dyndata.lsh[1];\n \n CCTK_REAL * restrict const\n coordsx = malloc (npoints * sizeof * coordsx);\n assert (npoints==0 || coordsx);\n CCTK_REAL * restrict const\n coordsy = malloc (npoints * sizeof * coordsy);\n assert (npoints==0 || coordsy);\n CCTK_REAL * restrict const\n coordsz = malloc (npoints * sizeof * coordsz);\n assert (npoints==0 || coordsz);\n CCTK_POINTER_TO_CONST coords[3];\n coords[0] = coordsx;\n coords[1] = coordsy;\n coords[2] = coordsz;\n \n#pragma omp parallel for\n for (int j=0; j<dyndata.lsh[1]; ++j) {\n for (int i=0; i<dyndata.lsh[0]; ++i) {\n int const n = i + dyndata.lsh[0] * j;\n coordsx[n] = (parray2d_x0 +\n (dyndata.lbnd[0] + i) * parray2d_dx_i +\n (dyndata.lbnd[1] + j) * parray2d_dx_j);\n coordsy[n] = (parray2d_y0 +\n (dyndata.lbnd[0] + i) * parray2d_dy_i +\n (dyndata.lbnd[1] + j) * parray2d_dy_j);\n coordsz[n] = (parray2d_z0 +\n (dyndata.lbnd[0] + i) * parray2d_dz_i +\n (dyndata.lbnd[1] + j) * parray2d_dz_j);\n }\n }\n \n CCTK_INT * restrict const\n inputs = malloc (nvars * sizeof * inputs);\n assert (inputs);\n \n for (int n=0; n<nvars; ++n) {\n inputs[n] = CCTK_VarIndex (parray2d_vars[n]);\n if (inputs[n] < 0) {\n inputs[n] = -1;\n }\n }\n \n CCTK_INT * restrict const\n output_types = malloc (nvars * sizeof * output_types);\n assert (output_types);\n \n for (int n=0; n<nvars; ++n) {\n output_types[n] = CCTK_VARIABLE_REAL;\n }\n \n CCTK_POINTER * restrict const\n outputs = malloc (nvars * sizeof * outputs);\n assert (outputs);\n \n for (int n=0; n<nvars; ++n) {\n outputs[n] = &parrays2d[npoints * n];\n }\n \n if (use_carpetinterp2)\n {\n int const ierr = InterpGridArrays\n (cctkGH, 3, carpetinterp2_interpolator_order,\n npoints, coords,\n nvars, inputs,\n nvars, outputs);\n assert (! ierr);\n }\n else\n {\n int const ierr = CCTK_InterpGridArrays\n (cctkGH, 3, interpolator, options_table, coord_handle,\n npoints, CCTK_VARIABLE_REAL, coords,\n nvars, inputs,\n nvars, output_types, outputs);\n assert (! ierr);\n }\n \n free (coordsx);\n free (coordsy);\n free (coordsz);\n free (inputs);\n free (output_types);\n free (outputs);\n }\n }\n \n \n \n /* Parallel 3D Arrays */\n {\n int const nvars = nparrays3d;\n if (nvars > 0) {\n int const group = CCTK_GroupIndex (\"InterpToArray::parrays3d\");\n assert (group >= 0);\n cGroupDynamicData dyndata;\n {\n int const ierr = CCTK_GroupDynamicData (cctkGH, group, &dyndata);\n assert (! ierr);\n }\n assert (dyndata.dim == 3);\n int const npoints = dyndata.lsh[0] * dyndata.lsh[1] * dyndata.lsh[2];\n \n CCTK_REAL * restrict const\n coordsx = malloc (npoints * sizeof * coordsx);\n assert (npoints==0 || coordsx);\n CCTK_REAL * restrict const\n coordsy = malloc (npoints * sizeof * coordsy);\n assert (npoints==0 || coordsy);\n CCTK_REAL * restrict const\n coordsz = malloc (npoints * sizeof * coordsz);\n assert (npoints==0 || coordsz);\n CCTK_POINTER_TO_CONST coords[3];\n coords[0] = coordsx;\n coords[1] = coordsy;\n coords[2] = coordsz;\n \n#pragma omp parallel for\n for (int k=0; k<dyndata.lsh[2]; ++k) {\n for (int j=0; j<dyndata.lsh[1]; ++j) {\n for (int i=0; i<dyndata.lsh[0]; ++i) {\n int const n = i + dyndata.lsh[0] * (j + dyndata.lsh[1] * k);\n coordsx[n] = (parray3d_x0 +\n (dyndata.lbnd[0] + i) * parray3d_dx_i +\n (dyndata.lbnd[1] + j) * parray3d_dx_j +\n (dyndata.lbnd[2] + k) * parray3d_dx_k);\n coordsy[n] = (parray3d_y0 +\n (dyndata.lbnd[0] + i) * parray3d_dy_i +\n (dyndata.lbnd[1] + j) * parray3d_dy_j +\n (dyndata.lbnd[2] + k) * parray3d_dy_k);\n coordsz[n] = (parray3d_z0 +\n (dyndata.lbnd[0] + i) * parray3d_dz_i +\n (dyndata.lbnd[1] + j) * parray3d_dz_j +\n (dyndata.lbnd[2] + k) * parray3d_dz_k);\n }\n }\n }\n \n CCTK_INT * restrict const\n inputs = malloc (nvars * sizeof * inputs);\n assert (inputs);\n \n for (int n=0; n<nvars; ++n) {\n inputs[n] = CCTK_VarIndex (parray3d_vars[n]);\n if (inputs[n] < 0) {\n inputs[n] = -1;\n }\n }\n \n CCTK_INT * restrict const\n output_types = malloc (nvars * sizeof * output_types);\n assert (output_types);\n \n for (int n=0; n<nvars; ++n) {\n output_types[n] = CCTK_VARIABLE_REAL;\n }\n \n CCTK_POINTER * restrict const\n outputs = malloc (nvars * sizeof * outputs);\n assert (outputs);\n \n for (int n=0; n<nvars; ++n) {\n outputs[n] = &parrays3d[npoints * n];\n }\n \n if (use_carpetinterp2)\n {\n int const ierr = InterpGridArrays\n (cctkGH, 3, carpetinterp2_interpolator_order,\n npoints, coords,\n nvars, inputs,\n nvars, outputs);\n assert (! ierr);\n }\n else\n {\n int const ierr = CCTK_InterpGridArrays\n (cctkGH, 3, interpolator, options_table, coord_handle,\n npoints, CCTK_VARIABLE_REAL, coords,\n nvars, inputs,\n nvars, output_types, outputs);\n assert (! ierr);\n }\n \n free (coordsx);\n free (coordsy);\n free (coordsz);\n free (inputs);\n free (output_types);\n free (outputs);\n }\n }\n \n \n \n if (options_table >= 0)\n {\n int const ierr = Util_TableDestroy (options_table);\n assert (! ierr);\n }\n}\n"
},
"test": {
"test.ccl": "# Carpet output contains empty lines whose number depends the number of processes\nTEST wavetoy2\n{\n NPROCS 2\n}\n",
"wavetoy2.par": "!DESC \"Test InterpToArray with WaveToy initial data\"\n\nActiveThorns = \"\n Boundary\n CartGrid3D\n CoordBase\n IDScalarWaveC\n CarpetIOASCII\n CarpetIOBasic\n CarpetIOScalar\n IOUtil\n InterpToArray\n LocalReduce\n Carpet\n CarpetLib\n GSL\n LoopControl\n InitBase\n CarpetInterp2\n CarpetReduce\n CarpetSlab\n SymBase\n WaveToyC\n\"\n\nCactus::cctk_itlast = 0\n\ndriver::global_nx = 15\ndriver::global_ny = 15\ndriver::global_nz = 15\ndriver::ghost_size = 2\n\ngrid::type = \"byspacing\"\ngrid::dxyz = 0.6\n\nIDScalarWave::initial_data = \"Gaussian\"\nIDScalarWave::sigma = 2.8\nIDScalarWave::radius = 5.0\n\n\n\nInterpToArray::use_carpetinterp2 = \"yes\"\nInterpToArray::carpetinterp2_interpolator_order = 2\n\nInterpToArray::narrays2d = 1\nInterpToArray::array2d_vars[0] = \"wavetoy::phi\"\nInterpToArray::array2d_x0 = -1.0\nInterpToArray::array2d_y0 = -1.0\nInterpToArray::array2d_z0 = -1.0\nInterpToArray::array2d_dx_i = 0.5\nInterpToArray::array2d_dy_j = 0.4\nInterpToArray::array2d_dz_j = 0.1\nInterpToArray::array2d_npoints_i = 3\nInterpToArray::array2d_npoints_j = 4\n\nInterpToArray::nparrays3d = 1\nInterpToArray::parray3d_vars[0] = \"wavetoy::phi\"\nInterpToArray::parray3d_x0 = -1.0\nInterpToArray::parray3d_y0 = -1.0\nInterpToArray::parray3d_z0 = -1.0\nInterpToArray::parray3d_dx_i = 0.5\nInterpToArray::parray3d_dy_j = 0.5\nInterpToArray::parray3d_dz_k = 0.5\nInterpToArray::parray3d_npoints_i = 3\nInterpToArray::parray3d_npoints_j = 4\nInterpToArray::parray3d_npoints_k = 5\n\n\n\nIO::out_dir = $parfile\nIO::parfile_write = \"no\"\nIO::out_fileinfo = \"none\"\n\nIOScalar::outScalar_reductions = \"norm1 norm2 minimum maximum norm_inf\"\nIOScalar::outScalar_every = 1\nIOScalar::outScalar_vars = \"\n InterpToArray::arrays2d[0]\n InterpToArray::parrays3d[0]\n\"\n\nIOASCII::out1D_every = 1\nIOASCII::compact_format = \"yes\"\nIOASCII::output_ghost_points = \"no\"\nIOASCII::out1D_vars = \"\n InterpToArray::scalars\n InterpToArray::arrays2d\n InterpToArray::parrays3d\n\"\n",
"wavetoy.par": "!DESC \"Test InterpToArray with WaveToy initial data\"\n\nActiveThorns = \"\n Boundary\n CartGrid3D\n CoordBase\n IDScalarWaveC\n IOASCII\n IOBasic\n IOUtil\n InterpToArray\n LocalInterp\n LocalReduce\n PUGH\n PUGHInterp\n PUGHReduce\n PUGHSlab\n SymBase\n WaveToyC\n\"\n\nCactus::cctk_itlast = 0\n\ndriver::global_nx = 15\ndriver::global_ny = 15\ndriver::global_nz = 15\ndriver::ghost_size = 2\n\ngrid::type = \"byspacing\"\ngrid::dxyz = 0.6\n\nIDScalarWave::initial_data = \"Gaussian\"\nIDScalarWave::sigma = 2.8\nIDScalarWave::radius = 5.0\n\n\n\nInterpToArray::interpolator_name = \"uniform cartesian\"\n\nInterpToArray::narrays2d = 1\nInterpToArray::array2d_vars[0] = \"wavetoy::phi\"\nInterpToArray::array2d_x0 = -1.0\nInterpToArray::array2d_y0 = -1.0\nInterpToArray::array2d_z0 = -1.0\nInterpToArray::array2d_dx_i = 0.5\nInterpToArray::array2d_dy_j = 0.4\nInterpToArray::array2d_dz_j = 0.1\nInterpToArray::array2d_npoints_i = 3\nInterpToArray::array2d_npoints_j = 4\n\nInterpToArray::nparrays3d = 1\nInterpToArray::parray3d_vars[0] = \"wavetoy::phi\"\nInterpToArray::parray3d_x0 = -1.0\nInterpToArray::parray3d_y0 = -1.0\nInterpToArray::parray3d_z0 = -1.0\nInterpToArray::parray3d_dx_i = 0.5\nInterpToArray::parray3d_dy_j = 0.5\nInterpToArray::parray3d_dz_k = 0.5\nInterpToArray::parray3d_npoints_i = 3\nInterpToArray::parray3d_npoints_j = 4\nInterpToArray::parray3d_npoints_k = 5\n\n\n\nIO::out_dir = $parfile\nIO::parfile_write = \"no\"\nIO::out_fileinfo = \"none\"\n\nIOBasic::outScalar_reductions = \"norm1 norm2 minimum maximum norm_inf\"\nIOBasic::outScalar_every = 1\nIOBasic::outScalar_vars = \"\n wavetoy::phi\n InterpToArray::arrays2d[0]\n InterpToArray::parrays3d[0]\n\"\n\nIOASCII::out1D_every = 1\nIOASCII::out1D_vars = \"\n wavetoy::phi\n InterpToArray::scalars\n InterpToArray::arrays2d\n InterpToArray::parrays3d\n\"\n",
"wavetoy2/arrays2d[0].norm_inf.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.255929043803271\n",
"wavetoy2/arrays2d[0].norm2.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.168525955789019\n",
"wavetoy2/parrays3d[0].x.asc": "# 1D ASCII output created by CarpetIOASCII\n#\n0\t0 0 0\t0\t0.255929043803271\n0\t1 0 0\t0\t0.20945834089817\n0\t2 0 0\t0\t0.193918918322488\n\n",
"wavetoy2/arrays2d[0].x.asc": "# 1D ASCII output created by CarpetIOASCII\n#\n0\t0 0\t0\t0.255929043803271\n0\t1 0\t0\t0.20945834089817\n0\t2 0\t0\t0.193918918322488\n\n",
"wavetoy2/parrays3d[0].y.asc": "# 1D ASCII output created by CarpetIOASCII\n#\n0\t0 0 0\t0\t0.255929043803271\n0\t0 1 0\t0\t0.20945834089817\n0\t0 2 0\t0\t0.193918918322488\n0\t0 3 0\t0\t0.20945834089817\n\n",
"wavetoy2/parrays3d[0].minimum.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.0575070381476306\n",
"wavetoy2/arrays2d[0].y.asc": "# 1D ASCII output created by CarpetIOASCII\n#\n0\t0 0\t0\t0.255929043803271\n0\t0 1\t0\t0.204490368041785\n0\t0 2\t0\t0.173853957866224\n0\t0 3\t0\t0.164387756102711\n\n",
"wavetoy2/arrays2d[0].z.asc": "# 1D ASCII output created by CarpetIOASCII\n#\n0\t0 0\t0\t0.255929043803271\n",
"wavetoy2/parrays3d[0].d.asc": "# 1D ASCII output created by CarpetIOASCII\n#\n0\t0 0 0\t0\t0 0 0\t0.255929043803271\n0\t1 1 1\t0\t1 1 1\t0.111155027559738\n0\t2 2 2\t0\t2 2 2\t0.0575070381476306\n",
"wavetoy2/parrays3d[0].z.asc": "# 1D ASCII output created by CarpetIOASCII\n#\n0\t0 0 0\t0\t0.255929043803271\n0\t0 0 1\t0\t0.20945834089817\n0\t0 0 2\t0\t0.193918918322488\n\n0\t0 0 3\t0\t0.20945834089817\n0\t0 0 4\t0\t0.255929043803271\n\n",
"wavetoy2/parrays3d[0].norm_inf.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.255929043803271\n",
"wavetoy2/arrays2d[0].norm1.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.162223918469515\n",
"wavetoy2/parrays3d[0].maximum.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.255929043803271\n",
"wavetoy2/parrays3d[0].norm1.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.147238120771799\n",
"wavetoy2/arrays2d[0].minimum.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.0981997271447794\n",
"wavetoy2/parrays3d[0].norm2.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.154432972668436\n",
"wavetoy2/arrays2d[0].maximum.asc": "# Scalar ASCII output created by CarpetIOScalar\n#\n0 0 0.255929043803271\n",
"wavetoy/arrays2d[0]_norm2.xg": "\"arrays2d[0] v time\n0.0000000000000\t0.1685259557890\n",
"wavetoy/phi_norm_inf.xg": "\"phi v time\n0.0000000000000\t0.9999198827161\n",
"wavetoy/phi_3D_diagonal.xg": "\n\n\"Time = 0.0000000000000\n-6.7549981495186\t\t0.6751235936513\n-5.7157676649773\t\t0.9367420144351\n-4.6765371804360\t\t0.9867432223551\n-3.6373066958946\t\t0.7891067225602\n-2.5980762113533\t\t0.4790874265193\n-1.5588457268120\t\t0.2208214420284\n-0.5196152422707\t\t0.0772707537752\n0.5196152422707\t\t0.0772707537752\n1.5588457268120\t\t0.2208214420284\n2.5980762113533\t\t0.4790874265193\n3.6373066958946\t\t0.7891067225602\n4.6765371804360\t\t0.9867432223551\n5.7157676649773\t\t0.9367420144351\n6.7549981495186\t\t0.6751235936513\n7.7942286340599\t\t0.3693975497431\n",
"wavetoy/parrays3d[0]_x_[0][0].xg": "\n\n\"Time = 0.0000000000000\n0\t\t0.2559290438033\n1\t\t0.2094583408982\n2\t\t0.1939189183225\n",
"wavetoy/parrays3d[0]_z_[0][0].xg": "\n\n\"Time = 0.0000000000000\n0\t\t0.2559290438033\n1\t\t0.2094583408982\n2\t\t0.1939189183225\n3\t\t0.2094583408982\n4\t\t0.2559290438033\n",
"wavetoy/parrays3d[0]_maximum.xg": "\"parrays3d[0] v time\n0.0000000000000\t0.2559290438033\n",
"wavetoy/arrays2d[0]_norm_inf.xg": "\"arrays2d[0] v time\n0.0000000000000\t0.2559290438033\n",
"wavetoy/phi_y_[7][7].xg": "\n\n\"Time = 0.0000000000000\n-3.9000000000000\t\t0.8624762718586\n-3.3000000000000\t\t0.6998161919677\n-2.7000000000000\t\t0.5192102694005\n-2.1000000000000\t\t0.3529089299372\n-1.5000000000000\t\t0.2208214420284\n-0.9000000000000\t\t0.1292593546971\n-0.3000000000000\t\t0.0772707537752\n0.3000000000000\t\t0.0772707537752\n0.9000000000000\t\t0.1292593546971\n1.5000000000000\t\t0.2208214420284\n2.1000000000000\t\t0.3529089299372\n2.7000000000000\t\t0.5192102694005\n3.3000000000000\t\t0.6998161919677\n3.9000000000000\t\t0.8624762718586\n4.5000000000000\t\t0.9710346043534\n",
"wavetoy/phi_norm2.xg": "\"phi v time\n0.0000000000000\t0.8424968585241\n",
"wavetoy/parrays3d[0]_y_[0][0].xg": "\n\n\"Time = 0.0000000000000\n0\t\t0.2559290438033\n1\t\t0.2094583408982\n2\t\t0.1939189183225\n3\t\t0.2094583408982\n",
"wavetoy/phi_maximum.xg": "\"phi v time\n0.0000000000000\t0.9999198827161\n",
"wavetoy/arrays2d[0]_maximum.xg": "\"arrays2d[0] v time\n0.0000000000000\t0.2559290438033\n",
"wavetoy/parrays3d[0]_minimum.xg": "\"parrays3d[0] v time\n0.0000000000000\t0.0575070381476\n",
"wavetoy/parrays3d[0]_norm1.xg": "\"parrays3d[0] v time\n0.0000000000000\t0.1472381207718\n",
"wavetoy/phi_x_[7][7].xg": "\n\n\"Time = 0.0000000000000\n-3.9000000000000\t\t0.8624762718586\n-3.3000000000000\t\t0.6998161919677\n-2.7000000000000\t\t0.5192102694005\n-2.1000000000000\t\t0.3529089299372\n-1.5000000000000\t\t0.2208214420284\n-0.9000000000000\t\t0.1292593546971\n-0.3000000000000\t\t0.0772707537752\n0.3000000000000\t\t0.0772707537752\n0.9000000000000\t\t0.1292593546971\n1.5000000000000\t\t0.2208214420284\n2.1000000000000\t\t0.3529089299372\n2.7000000000000\t\t0.5192102694005\n3.3000000000000\t\t0.6998161919677\n3.9000000000000\t\t0.8624762718586\n4.5000000000000\t\t0.9710346043534\n",
"wavetoy/phi_norm1.xg": "\"phi v time\n0.0000000000000\t0.8148785107206\n",
"wavetoy/arrays2d[0]_norm1.xg": "\"arrays2d[0] v time\n0.0000000000000\t0.1622239184695\n",
"wavetoy/phi_z_[7][7].xg": "\n\n\"Time = 0.0000000000000\n-3.9000000000000\t\t0.8624762718586\n-3.3000000000000\t\t0.6998161919677\n-2.7000000000000\t\t0.5192102694005\n-2.1000000000000\t\t0.3529089299372\n-1.5000000000000\t\t0.2208214420284\n-0.9000000000000\t\t0.1292593546971\n-0.3000000000000\t\t0.0772707537752\n0.3000000000000\t\t0.0772707537752\n0.9000000000000\t\t0.1292593546971\n1.5000000000000\t\t0.2208214420284\n2.1000000000000\t\t0.3529089299372\n2.7000000000000\t\t0.5192102694005\n3.3000000000000\t\t0.6998161919677\n3.9000000000000\t\t0.8624762718586\n4.5000000000000\t\t0.9710346043534\n",
"wavetoy/phi_minimum.xg": "\"phi v time\n0.0000000000000\t0.0772707537752\n",
"wavetoy/arrays2d[0]_minimum.xg": "\"arrays2d[0] v time\n0.0000000000000\t0.0981997271448\n",
"wavetoy/parrays3d[0]_3D_diagonal.xg": "\n\n\"Time = 0.0000000000000\n0\t\t0.2559290438033\n1\t\t0.1111550275597\n2\t\t0.0575070381476\n",
"wavetoy/parrays3d[0]_norm2.xg": "\"parrays3d[0] v time\n0.0000000000000\t0.1544329726684\n",
"wavetoy/arrays2d[0]_y_[0].xg": "\n\n\"Time = 0.0000000000000\n0\t\t0.2559290438033\n1\t\t0.2044903680418\n2\t\t0.1738539578662\n3\t\t0.1643877561027\n",
"wavetoy/arrays2d[0]_x_[0].xg": "\n\n\"Time = 0.0000000000000\n0\t\t0.2559290438033\n1\t\t0.2094583408982\n2\t\t0.1939189183225\n",
"wavetoy/parrays3d[0]_norm_inf.xg": "\"parrays3d[0] v time\n0.0000000000000\t0.2559290438033\n"
},
"doc": {
"documentation.tex": "% *======================================================================*\n% Cactus Thorn template for ThornGuide documentation\n% Author: Ian Kelley\n% Date: Sun Jun 02, 2002\n%\n% Thorn documentation in the latex file doc/documentation.tex\n% will be included in ThornGuides built with the Cactus make system.\n% The scripts employed by the make system automatically include\n% pages about variables, parameters and scheduling parsed from the\n% relevant thorn CCL files.\n%\n% This template contains guidelines which help to assure that your\n% documentation will be correctly added to ThornGuides. More\n% information is available in the Cactus UsersGuide.\n%\n% Guidelines:\n% - Do not change anything before the line\n% % START CACTUS THORNGUIDE\",\n% except for filling in the title, author, date, etc. fields.\n% - Each of these fields should only be on ONE line.\n% - Author names should be separated with a \\\\ or a comma.\n% - You can define your own macros, but they must appear after\n% the START CACTUS THORNGUIDE line, and must not redefine standard\n% latex commands.\n% - To avoid name clashes with other thorns, 'labels', 'citations',\n% 'references', and 'image' names should conform to the following\n% convention:\n% ARRANGEMENT_THORN_LABEL\n% For example, an image wave.eps in the arrangement CactusWave and\n% thorn WaveToyC should be renamed to CactusWave_WaveToyC_wave.eps\n% - Graphics should only be included using the graphicx package.\n% More specifically, with the \"\\includegraphics\" command. Do\n% not specify any graphic file extensions in your .tex file. This\n% will allow us to create a PDF version of the ThornGuide\n% via pdflatex.\n% - References should be included with the latex \"\\bibitem\" command.\n% - Use \\begin{abstract}...\\end{abstract} instead of \\abstract{...}\n% - Do not use \\appendix, instead include any appendices you need as\n% standard sections.\n% - For the benefit of our Perl scripts, and for future extensions,\n% please use simple latex.\n%\n% *======================================================================*\n%\n% Example of including a graphic image:\n% \\begin{figure}[ht]\n% \t\\begin{center}\n% \t \\includegraphics[width=6cm]{MyArrangement_MyThorn_MyFigure}\n% \t\\end{center}\n% \t\\caption{Illustration of this and that}\n% \t\\label{MyArrangement_MyThorn_MyLabel}\n% \\end{figure}\n%\n% Example of using a label:\n% \\label{MyArrangement_MyThorn_MyLabel}\n%\n% Example of a citation:\n% \\cite{MyArrangement_MyThorn_Author99}\n%\n% Example of including a reference\n% \\bibitem{MyArrangement_MyThorn_Author99}\n% {J. Author, {\\em The Title of the Book, Journal, or periodical}, 1 (1999),\n% 1--16. {\\tt http://www.nowhere.com/}}\n%\n% *======================================================================*\n\n% If you are using CVS use this line to give version information\n\n\\documentclass{article}\n\n% Use the Cactus ThornGuide style file\n% (Automatically used from Cactus distribution, if you have a\n% thorn without the Cactus Flesh download this from the Cactus\n% homepage at www.cactuscode.org)\n\\usepackage{../../../../doc/latex/cactus}\n\n\\begin{document}\n\n% The author of the documentation\n\\author{Erik Schnetter \\textless schnetter@cct.lsu.edu\\textgreater}\n\n% The title of the document (not necessarily the name of the Thorn)\n\\title{InterpToArray}\n\n\\date{June 30, 2010}\n\n\\maketitle\n\n% Do not delete next line\n% START CACTUS THORNGUIDE\n\n% Add all definitions used in this documentation here\n% \\def\\mydef etc\n\n% Add an abstract for this thorn's documentation\n\\begin{abstract}\n Interpolate grid functions to grid arrays on a regular grid of\n locations, so that these can e.g.\\ be output more easily.\n\\end{abstract}\n\n% The following sections are suggestive only.\n% Remove them or add your own.\n\n\\section{Introduction}\nSome post-processing and visualisation tools cannot handle mesh\nrefinement or multi-block systems. These tools then require\ninterpolating the result onto a regular, uniform grid. This is what\nthis thorn does.\n\nInterpToArray can interpolate to 0D, 1D, 2D, and 3D grids. The\ninterpolation result is stored in grid arrays. These can be either\nreplicated or distributed over all processes. Note that using\nreplicated (DISTRIB=constant) grid arrays can require a substantial\namount of memory on each process.\n\n\\section{Numerical Implementation}\nInterpToArray uses standard Cactus interpolators such as PUGHInterp or\nCarpetInterp.\n\n\\section{Using This Thorn}\nThe variables which should be interpolated are specified by\nparameters; currently, up to 100 variables can be interpolated.\n\nThe interpolator and its options are also specified via parameters.\n\nFinally, the locations of the points of the regular grid are also\nspecified via parameters. These grid points are specified via an\n\\emph{origin} and \\emph{offsets}, and they do not have to be aligned\nwith the coordinate axes. For example, a 2D grid is specified via\nthree (real) vectors $x^a$, $di^a$, and $dj^a$, and via its (integer)\nsize $ni$ and $nj$. The coordinates of the grid points are then given\nvia\n$$\nx^a(i,j) = x^a + i \\cdot di^a + j \\cdot dj^a\n$$\nfor $0 \\le i < ni$ and $0 \\le j < nj$. Grids with other dimensions\nare specified equivalently.\n\n% Do not delete next line\n% END CACTUS THORNGUIDE\n\n\\end{document}\n"
}
} |