From 7882dfdbfcdf6f97e6e9bb6cf69c33bc07e149d2 Mon Sep 17 00:00:00 2001 From: schnetter Date: Tue, 22 Oct 2002 14:59:28 +0000 Subject: Testing the Slab thorn. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SlabTest/trunk@2 732e31d2-b375-409b-9bd3-699c3b2c9da5 --- README | 10 ++ doc/documentation.tex | 140 ++++++++++++++++++++ interface.ccl | 30 +++++ par/slabtest.par | 11 ++ param.ccl | 2 + schedule.ccl | 8 ++ src/make.code.defn | 9 ++ src/slabtest.c | 348 ++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 558 insertions(+) create mode 100644 README create mode 100644 doc/documentation.tex create mode 100644 interface.ccl create mode 100644 par/slabtest.par create mode 100644 param.ccl create mode 100644 schedule.ccl create mode 100644 src/make.code.defn create mode 100644 src/slabtest.c diff --git a/README b/README new file mode 100644 index 0000000..3f456b5 --- /dev/null +++ b/README @@ -0,0 +1,10 @@ +CVS info : $Header$ + +Cactus Code Thorn SlabTest +Thorn Author(s) : Erik Schnetter +Thorn Maintainer(s) : Erik Schnetter +-------------------------------------------------------------------------- + +Purpose of the thorn: + +This thorn tests the slab transfer routines of the thorn Slab. diff --git a/doc/documentation.tex b/doc/documentation.tex new file mode 100644 index 0000000..7ab6c41 --- /dev/null +++ b/doc/documentation.tex @@ -0,0 +1,140 @@ +% *======================================================================* +% Cactus Thorn template for ThornGuide documentation +% Author: Ian Kelley +% Date: Sun Jun 02, 2002 +% $Header$ +% +% Thorn documentation in the latex file doc/documentation.tex +% will be included in ThornGuides built with the Cactus make system. +% The scripts employed by the make system automatically include +% pages about variables, parameters and scheduling parsed from the +% relevent thorn CCL files. +% +% This template contains guidelines which help to assure that your +% documentation will be correctly added to ThornGuides. More +% information is available in the Cactus UsersGuide. +% +% Guidelines: +% - Do not change anything before the line +% % START CACTUS THORNGUIDE", +% except for filling in the title, author, date etc. fields. +% - Each of these fields should only be on ONE line. +% - Author names should be sparated with a \\ or a comma +% - You can define your own macros are OK, but they must appear after +% the START CACTUS THORNGUIDE line, and do not redefine standard +% latex commands. +% - To avoid name clashes with other thorns, 'labels', 'citations', +% 'references', and 'image' names should conform to the following +% convention: +% ARRANGEMENT_THORN_LABEL +% For example, an image wave.eps in the arrangement CactusWave and +% thorn WaveToyC should be renamed to CactusWave_WaveToyC_wave.eps +% - Graphics should only be included using the graphix package. +% More specifically, with the "includegraphics" command. Do +% not specify any graphic file extensions in your .tex file. This +% will allow us (later) to create a PDF version of the ThornGuide +% via pdflatex. | +% - References should be included with the latex "bibitem" command. +% - use \begin{abstract}...\end{abstract} instead of \abstract{...} +% - For the benefit of our Perl scripts, and for future extensions, +% please use simple latex. +% +% *======================================================================* +% +% Example of including a graphic image: +% \begin{figure}[ht] +% \begin{center} +% \includegraphics[width=6cm]{MyArrangement_MyThorn_MyFigure} +% \end{center} +% \caption{Illustration of this and that} +% \label{MyArrangement_MyThorn_MyLabel} +% \end{figure} +% +% Example of using a label: +% \label{MyArrangement_MyThorn_MyLabel} +% +% Example of a citation: +% \cite{MyArrangement_MyThorn_Author99} +% +% Example of including a reference +% \bibitem{MyArrangement_MyThorn_Author99} +% {J. Author, {\em The Title of the Book, Journal, or periodical}, 1 (1999), +% 1--16. {\tt http://www.nowhere.com/}} +% +% *======================================================================* + +% If you are using CVS use this line to give version information +% $Header$ + +\documentclass{article} + +% Use the Cactus ThornGuide style file +% (Automatically used from Cactus distribution, if you have a +% thorn without the Cactus Flesh download this from the Cactus +% homepage at www.cactuscode.org) +\usepackage{../../../../doc/ThornGuide/cactus} + +\begin{document} + +% The author of the documentation +\author{Erik Schnetter $<$schnetter@uni-tuebingen.de$>$} + +% The title of the document (not necessarily the name of the Thorn) +\title{} + +% the date your document was last changed, if your document is in CVS, +% please use: +% \date{$ $Date$ $} +\date{October 16 2002} + +\maketitle + +% Do not delete next line +% START CACTUS THORNGUIDE + +% Add all definitions used in this documentation here +% \def\mydef etc + +% Add an abstract for this thorn's documentation +\begin{abstract} + +\end{abstract} + +% The following sections are suggestive only. +% Remove them or add your own. + +\section{Introduction} + +\section{Physical System} + +\section{Numerical Implementation} + +\section{Using This Thorn} + +\subsection{Obtaining This Thorn} + +\subsection{Basic Usage} + +\subsection{Special Behaviour} + +\subsection{Interaction With Other Thorns} + +\subsection{Support and Feedback} + +\section{History} + +\subsection{Thorn Source Code} + +\subsection{Thorn Documentation} + +\subsection{Acknowledgements} + + +\begin{thebibliography}{9} + +\end{thebibliography} + +% Do not delete next line +% END CACTUS THORNGUIDE + +\end{document} diff --git a/interface.ccl b/interface.ccl new file mode 100644 index 0000000..ac13f1e --- /dev/null +++ b/interface.ccl @@ -0,0 +1,30 @@ +# Interface definition for thorn SlabTest +# $Header$ + +IMPLEMENTS: SlabTest + +INHERITS: Slab + +USES INCLUDE HEADER: Slab.h + + + +CCTK_REAL gfs TYPE=gf +{ + gfx gfy gfz +} "grid functions" + +CCTK_REAL a1s TYPE=array DIM=1 SIZE=10 +{ + a1x a1y a1z +} "1D grid arrays" + +CCTK_REAL a2s TYPE=array DIM=2 SIZE=10,10 +{ + a2x a2y a2z +} "2D grid arrays" + +CCTK_REAL a3s TYPE=array DIM=3 SIZE=10,10,10 +{ + a3x a3y a3z +} "3D grid arrays" diff --git a/par/slabtest.par b/par/slabtest.par new file mode 100644 index 0000000..9709567 --- /dev/null +++ b/par/slabtest.par @@ -0,0 +1,11 @@ +# $Header$ + +cactus::cctk_itlast = 0 + +ActiveThorns = "PUGH" + +driver::global_nx = 10 +driver::global_ny = 11 +driver::global_nz = 12 + +ActiveThorns = "Slab SlabTest" diff --git a/param.ccl b/param.ccl new file mode 100644 index 0000000..3c3265a --- /dev/null +++ b/param.ccl @@ -0,0 +1,2 @@ +# Parameter definitions for thorn SlabTest +# $Header$ diff --git a/schedule.ccl b/schedule.ccl new file mode 100644 index 0000000..03253a7 --- /dev/null +++ b/schedule.ccl @@ -0,0 +1,8 @@ +# Schedule definitions for thorn SlabTest +# $Header$ + +SCHEDULE SlabTest_Test AT initial +{ + LANG: C + STORAGE: gfs a1s a2s a3s +} "Test Slab transfer routines" diff --git a/src/make.code.defn b/src/make.code.defn new file mode 100644 index 0000000..802e911 --- /dev/null +++ b/src/make.code.defn @@ -0,0 +1,9 @@ +# Main make.code.defn file for thorn SlabTest +# $Header$ + +# Source files in this directory +SRCS = slabtest.c + +# Subdirectories containing source files +SUBDIRS = + diff --git a/src/slabtest.c b/src/slabtest.c new file mode 100644 index 0000000..93fc4ff --- /dev/null +++ b/src/slabtest.c @@ -0,0 +1,348 @@ +/* $Header$ */ + +#include +#include + +#include "cctk.h" +#include "cctk_Arguments.h" + +#include "Slab.h" + + + +static const char * rcsid = "$Header$"; + +CCTK_FILEVERSION(TAT_SlabTest_slabtest_c); + + + +static void runtest (CCTK_ARGUMENTS, struct xferinfo const * const info) +{ + DECLARE_CCTK_ARGUMENTS; + + int i, j, k; + + int mismatch; + + int ierr; + + ierr = Slab_Transfer + (cctkGH, cctk_dim, info, CCTK_VARIABLE_REAL, gfx, CCTK_VARIABLE_REAL, gfy); + assert (!ierr); + + mismatch = 0; + for (k=0; k= 2 && cctk_lbnd[0] + i < 5 + && cctk_lbnd[1] + j >= 3 && cctk_lbnd[1] + j < 5 + && cctk_lbnd[2] + k >= 4 && cctk_lbnd[2] + k < 6) { + gfz[ind] = 10000 * (cctk_lbnd[0] + i + 2) + 100 * (cctk_lbnd[1] + j + 1) + (cctk_lbnd[2] + k - 1); + } else { + gfz[ind] = gfy[ind]; + } + } + } + } + + assert (cctk_dim <= 3); + for (d=0; d= 2 && cctk_lbnd[0] + i < 4 + && cctk_lbnd[1] + j >= 3 && cctk_lbnd[1] + j < 6 + && cctk_lbnd[2] + k >= 4 && cctk_lbnd[2] + k < 6) { + gfz[ind] = 10000 * (cctk_lbnd[2] + k + 1) + 100 * (cctk_lbnd[1] + j + 2) + (cctk_lbnd[0] + i - 1); + } else { + gfz[ind] = gfy[ind]; + } + } + } + } + + assert (cctk_dim <= 3); + for (d=0; d= 2 && cctk_lbnd[0] + i < 5 + && cctk_lbnd[1] + j >= 3 && cctk_lbnd[1] + j < 5 + && cctk_lbnd[2] + k >= 4 && cctk_lbnd[2] + k < 6) { + gfz[ind] = 10000 * (cctk_lbnd[2] + k + 1) + 100 * (cctk_lbnd[0] + i + 3) + (cctk_lbnd[1] + j - 2); + } else { + gfz[ind] = gfy[ind]; + } + } + } + } + + assert (cctk_dim <= 3); + for (d=0; d= 2 && cctk_lbnd[0] + i < 4 + && cctk_lbnd[1] + j >= 3 && cctk_lbnd[1] + j < 6 + && cctk_lbnd[2] + k >= 4 && cctk_lbnd[2] + k < 6) { + gfz[ind] = 10000 * (cctk_lbnd[2] + k + 1) + 100 * (cctk_lbnd[1] + j + 2) + (4 - cctk_lbnd[0] - i); + } else { + gfz[ind] = gfy[ind]; + } + } + } + } + + assert (cctk_dim <= 3); + for (d=0; d