{ "thorn_name": "CactusNumerical/SlabTest", "url": "https://bitbucket.org/cactuscode/cactusnumerical.git", "configuration": "", "interface": "# Interface definition for thorn SlabTest\n# $Header$\n\nIMPLEMENTS: SlabTest\n\nINHERITS: Slab\n\nUSES INCLUDE HEADER: Slab.h\n\n\n\nCCTK_REAL gfs TYPE=gf\n{\n gfx gfy gfz\n} \"grid functions\"\n\nCCTK_INT igfs TYPE=gf\n{\n igfx igfy igfz\n} \"integer grid functions\"\n\nCCTK_REAL a1s TYPE=array DIM=1 SIZE=10\n{\n a1x a1y a1z\n} \"1D grid arrays\"\n\nCCTK_REAL a2s TYPE=array DIM=2 SIZE=10,10\n{\n a2x a2y a2z\n} \"2D grid arrays\"\n\nCCTK_REAL a3s TYPE=array DIM=3 SIZE=10,10,10\n{\n a3x a3y a3z\n} \"3D grid arrays\"\n\n\n\nCCTK_INT success \"Indicate a successful test\"\n", "param": "# Parameter definitions for thorn SlabTest\n# $Header$\n", "schedule": "# Schedule definitions for thorn SlabTest\n# $Header$\n\nSTORAGE: success\n\nSCHEDULE SlabTest_Test AT initial\n{\n LANG: C\n STORAGE: gfs a1s a2s a3s igfs\n} \"Test Slab transfer routines\"\n", "src": { "make.code.defn": "# Main make.code.defn file for thorn SlabTest\n# $Header$\n\n# Source files in this directory\nSRCS = slabtest.c\n\n# Subdirectories containing source files\nSUBDIRS = \n\n", "slabtest.c": "/* $Header$ */\n\n#include \n#include \n\n#include \"cctk.h\"\n#include \"cctk_Arguments.h\"\n\n#include \"Slab.h\"\n\n\n\nstatic const char * rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(TAT_SlabTest_slabtest_c);\n \n\n\nstatic void\nruntest (CCTK_ARGUMENTS,\n\t struct xferinfo const * restrict const info)\n{\n DECLARE_CCTK_ARGUMENTS;\n \n int i, j, k;\n \n int mismatch;\n\n# define nvars 2\n const int vartypes[nvars] = {CCTK_VARIABLE_REAL, CCTK_VARIABLE_INT};\n const void *srcdataptrs[nvars] = {gfx, igfx};\n void *dstdataptrs[nvars] = {gfy, igfy};\n \n int ierr;\n \n ierr = Slab_MultiTransfer\n (cctkGH, cctk_dim, info, -1,\n nvars, vartypes, srcdataptrs, vartypes, dstdataptrs);\n assert (!ierr);\n \n mismatch = 0;\n for (k=0; k= 2 && cctk_lbnd[0] + i < 5\n\t && cctk_lbnd[1] + j >= 3 && cctk_lbnd[1] + j < 5\n\t && cctk_lbnd[2] + k >= 4 && cctk_lbnd[2] + k < 6) {\n\t gfz[ind] = igfz[ind] = 10000 * (cctk_lbnd[0] + i + 2) + 100 * (cctk_lbnd[1] + j + 1) + (cctk_lbnd[2] + k - 1);\n\t} else {\n\t gfz[ind] = gfy[ind];\n\t igfz[ind] = igfy[ind];\n\t}\n }\n }\n }\n \n assert (cctk_dim <= 3);\n for (d=0; d= 2 && cctk_lbnd[0] + i < 4\n\t && cctk_lbnd[1] + j >= 3 && cctk_lbnd[1] + j < 6\n\t && cctk_lbnd[2] + k >= 4 && cctk_lbnd[2] + k < 6) {\n\t gfz[ind] = igfz[ind] = 10000 * (cctk_lbnd[2] + k + 1) + 100 * (cctk_lbnd[1] + j + 2) + (cctk_lbnd[0] + i - 1);\n\t} else {\n\t gfz[ind] = gfy[ind];\n\t igfz[ind] = igfy[ind];\n\t}\n }\n }\n }\n \n assert (cctk_dim <= 3);\n for (d=0; d= 2 && cctk_lbnd[0] + i < 5\n\t && cctk_lbnd[1] + j >= 3 && cctk_lbnd[1] + j < 5\n\t && cctk_lbnd[2] + k >= 4 && cctk_lbnd[2] + k < 6) {\n\t gfz[ind] = igfz[ind] = 10000 * (cctk_lbnd[2] + k + 1) + 100 * (cctk_lbnd[0] + i + 3) + (cctk_lbnd[1] + j - 2);\n\t} else {\n\t gfz[ind] = gfy[ind];\n\t igfz[ind] = igfy[ind];\n\t}\n }\n }\n }\n \n assert (cctk_dim <= 3);\n for (d=0; d= 2 && cctk_lbnd[0] + i < 4\n\t && cctk_lbnd[1] + j >= 3 && cctk_lbnd[1] + j < 6\n\t && cctk_lbnd[2] + k >= 4 && cctk_lbnd[2] + k < 6) {\n\t gfz[ind] = igfz[ind] = 10000 * (cctk_lbnd[2] + k + 1) + 100 * (cctk_lbnd[1] + j + 2) + (4 - cctk_lbnd[0] - i);\n\t} else {\n\t gfz[ind] = gfy[ind];\n\t igfz[ind] = igfy[ind];\n\t}\n }\n }\n }\n \n assert (cctk_dim <= 3);\n for (d=0; d$}\n\n% The title of the document (not necessarily the name of the Thorn)\n\\title{Testing the Slab thorn}\n\n% the date your document was last changed, if your document is in CVS, \n% please use:\n\\date{$ $Date$ $}\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}\nSlatTest tests the Slab thorn.\n\\end{abstract}\n\n% The following sections are suggestive only.\n% Remove them or add your own.\n\n\\section{Introduction}\n\n\\section{Physical System}\n\n\\section{Numerical Implementation}\n\n\\section{Using This Thorn}\n\n\\subsection{Obtaining This Thorn}\n\n\\subsection{Basic Usage}\n\n\\subsection{Special Behaviour}\n\n\\subsection{Interaction With Other Thorns}\n\n\\subsection{Support and Feedback}\n\n\\section{History}\n\n\\subsection{Thorn Source Code}\n\n\\subsection{Thorn Documentation}\n\n\\subsection{Acknowledgements}\n\n\n\\begin{thebibliography}{9}\n\n\\end{thebibliography}\n\n% Do not delete next line\n% END CACTUS THORNGUIDE\n\n\\end{document}\n" } }