From d8cc74e37df4ff3750ccaed11b67e152cc0295f3 Mon Sep 17 00:00:00 2001 From: Roland Haas Date: Tue, 10 Sep 2013 16:34:09 -0700 Subject: CarpetEFenceTest: test electric fence in CarpetLib --- CarpetExtra/CarpetEFenceTest/README | 9 ++ CarpetExtra/CarpetEFenceTest/configuration.ccl | 1 + CarpetExtra/CarpetEFenceTest/doc/documentation.tex | 144 +++++++++++++++++++++ CarpetExtra/CarpetEFenceTest/interface.ccl | 4 + CarpetExtra/CarpetEFenceTest/param.ccl | 7 + CarpetExtra/CarpetEFenceTest/schedule.ccl | 8 ++ CarpetExtra/CarpetEFenceTest/src/breach_fence.c | 21 +++ CarpetExtra/CarpetEFenceTest/src/make.code.defn | 7 + CarpetExtra/CarpetEFenceTest/test/test_lower.par | 58 +++++++++ .../test/test_lower/test_lower.par | 58 +++++++++ 10 files changed, 317 insertions(+) create mode 100644 CarpetExtra/CarpetEFenceTest/README create mode 100644 CarpetExtra/CarpetEFenceTest/configuration.ccl create mode 100644 CarpetExtra/CarpetEFenceTest/doc/documentation.tex create mode 100644 CarpetExtra/CarpetEFenceTest/interface.ccl create mode 100644 CarpetExtra/CarpetEFenceTest/param.ccl create mode 100644 CarpetExtra/CarpetEFenceTest/schedule.ccl create mode 100644 CarpetExtra/CarpetEFenceTest/src/breach_fence.c create mode 100644 CarpetExtra/CarpetEFenceTest/src/make.code.defn create mode 100644 CarpetExtra/CarpetEFenceTest/test/test_lower.par create mode 100644 CarpetExtra/CarpetEFenceTest/test/test_lower/test_lower.par diff --git a/CarpetExtra/CarpetEFenceTest/README b/CarpetExtra/CarpetEFenceTest/README new file mode 100644 index 000000000..d625e148d --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/README @@ -0,0 +1,9 @@ +Cactus Code Thorn CarpetEFenceTest +Author(s) : Roland Haas +Maintainer(s): Roland Haas +Licence : GPL v2+ +-------------------------------------------------------------------------- + +1. Purpose + +not documented diff --git a/CarpetExtra/CarpetEFenceTest/configuration.ccl b/CarpetExtra/CarpetEFenceTest/configuration.ccl new file mode 100644 index 000000000..b9ee53a55 --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/configuration.ccl @@ -0,0 +1 @@ +# Configuration definitions for thorn CarpetEFenceTest diff --git a/CarpetExtra/CarpetEFenceTest/doc/documentation.tex b/CarpetExtra/CarpetEFenceTest/doc/documentation.tex new file mode 100644 index 000000000..3aac055cc --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/doc/documentation.tex @@ -0,0 +1,144 @@ +% *======================================================================* +% 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 +% relevant 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 separated with a \\ or a comma. +% - You can define your own macros, but they must appear after +% the START CACTUS THORNGUIDE line, and must 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 graphicx package. +% More specifically, with the "\includegraphics" command. Do +% not specify any graphic file extensions in your .tex file. This +% will allow us 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{...} +% - Do not use \appendix, instead include any appendices you need as +% standard sections. +% - 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/latex/cactus} + +\begin{document} + +% The author of the documentation +\author{Roland Haas \textless rhaas@caltech.edu\textgreater} + +% The title of the document (not necessarily the name of the Thorn) +\title{CarpetEFenceTest} + +% the date your document was last changed, if your document is in CVS, +% please use: +% \date{$ $Date: 2004-01-07 12:12:39 -0800 (Wed, 07 Jan 2004) $ $} +\date{September 10 2013} + +\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{Examples} + +\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/CarpetExtra/CarpetEFenceTest/interface.ccl b/CarpetExtra/CarpetEFenceTest/interface.ccl new file mode 100644 index 000000000..30676c1f9 --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/interface.ccl @@ -0,0 +1,4 @@ +# Interface definition for thorn CarpetEFenceTest +implements: CarpetEFenceTest + +CCTK_REAL sheep TYPE=GF "test grid function" diff --git a/CarpetExtra/CarpetEFenceTest/param.ccl b/CarpetExtra/CarpetEFenceTest/param.ccl new file mode 100644 index 000000000..2a3ea7f6f --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/param.ccl @@ -0,0 +1,7 @@ +# Parameter definitions for thorn CarpetEFenceTest + +KEYWORD breach_at "where to breach the fence" +{ + "upper" :: "lower boundary, idx = -1" + "lower" :: "upper boundary idx = prod(cctk_lsh[i]-1)+1" +} "lower" diff --git a/CarpetExtra/CarpetEFenceTest/schedule.ccl b/CarpetExtra/CarpetEFenceTest/schedule.ccl new file mode 100644 index 000000000..8fc5e142f --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/schedule.ccl @@ -0,0 +1,8 @@ +# Schedule definitions for thorn CarpetEFenceTest + +STORAGE: sheep + +schedule CarpetEFenceTest_BreachFence AT CCTK_INITIAL +{ + LANG: C +} "breach fence" diff --git a/CarpetExtra/CarpetEFenceTest/src/breach_fence.c b/CarpetExtra/CarpetEFenceTest/src/breach_fence.c new file mode 100644 index 000000000..3d41795e5 --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/src/breach_fence.c @@ -0,0 +1,21 @@ +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" + +void CarpetEFenceTest_BreachFence(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_PARAMETERS; + DECLARE_CCTK_ARGUMENTS; + + int idx; + if(CCTK_EQUALS(breach_at,"lower")) { + idx = -1; + } else if(CCTK_EQUALS(breach_at,"upper")) { + idx = CCTK_GFINDEX3D(cctkGH, cctk_lsh[0], cctk_lsh[1]-1, cctk_lsh[2]-1); + } else { + /* this should never happen */ + CCTK_ERROR("Uknown breach_at value"); + } + + sheep[idx] = 42; +} diff --git a/CarpetExtra/CarpetEFenceTest/src/make.code.defn b/CarpetExtra/CarpetEFenceTest/src/make.code.defn new file mode 100644 index 000000000..75ae6086f --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/src/make.code.defn @@ -0,0 +1,7 @@ +# Main make.code.defn file for thorn CarpetEFenceTest + +# Source files in this directory +SRCS = breach_fence.c + +# Subdirectories containing source files +SUBDIRS = diff --git a/CarpetExtra/CarpetEFenceTest/test/test_lower.par b/CarpetExtra/CarpetEFenceTest/test/test_lower.par new file mode 100644 index 000000000..fba042b38 --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/test/test_lower.par @@ -0,0 +1,58 @@ +Cactus::cctk_itlast = 0 + + + +ActiveThorns = "IOUtil" + +IO::out_dir = $parfile + + + +ActiveThorns = "InitBase" + +ActiveThorns = "LoopControl" + + + +ActiveThorns = "Carpet CarpetLib" + +Carpet::domain_from_coordbase = yes +Carpet::max_refinement_levels = 1 + +driver::ghost_size = 1 + +Carpet::init_fill_timelevels = yes + +Carpet::poison_new_timelevels = yes +CarpetLib::poison_new_memory = yes + + + +ActiveThorns = "Boundary CartGrid3D CoordBase SymBase" + +CoordBase::domainsize = "minmax" + +CoordBase::xmin = -1.00 +CoordBase::ymin = -1.00 +CoordBase::zmin = -1.00 +CoordBase::xmax = +1.00 +CoordBase::ymax = +1.00 +CoordBase::zmax = +1.00 +CoordBase::dx = 0.02 +CoordBase::dy = 0.02 +CoordBase::dz = 0.02 + +CoordBase::boundary_size_x_lower = 1 +CoordBase::boundary_size_y_lower = 1 +CoordBase::boundary_size_z_lower = 1 +CoordBase::boundary_size_x_upper = 1 +CoordBase::boundary_size_y_upper = 1 +CoordBase::boundary_size_z_upper = 1 + +CartGrid3D::type = "coordbase" + + + +ActiveThorns = "CarpetEFenceTest" + +CarpetEFenceTest::breach_at = "lower" diff --git a/CarpetExtra/CarpetEFenceTest/test/test_lower/test_lower.par b/CarpetExtra/CarpetEFenceTest/test/test_lower/test_lower.par new file mode 100644 index 000000000..fba042b38 --- /dev/null +++ b/CarpetExtra/CarpetEFenceTest/test/test_lower/test_lower.par @@ -0,0 +1,58 @@ +Cactus::cctk_itlast = 0 + + + +ActiveThorns = "IOUtil" + +IO::out_dir = $parfile + + + +ActiveThorns = "InitBase" + +ActiveThorns = "LoopControl" + + + +ActiveThorns = "Carpet CarpetLib" + +Carpet::domain_from_coordbase = yes +Carpet::max_refinement_levels = 1 + +driver::ghost_size = 1 + +Carpet::init_fill_timelevels = yes + +Carpet::poison_new_timelevels = yes +CarpetLib::poison_new_memory = yes + + + +ActiveThorns = "Boundary CartGrid3D CoordBase SymBase" + +CoordBase::domainsize = "minmax" + +CoordBase::xmin = -1.00 +CoordBase::ymin = -1.00 +CoordBase::zmin = -1.00 +CoordBase::xmax = +1.00 +CoordBase::ymax = +1.00 +CoordBase::zmax = +1.00 +CoordBase::dx = 0.02 +CoordBase::dy = 0.02 +CoordBase::dz = 0.02 + +CoordBase::boundary_size_x_lower = 1 +CoordBase::boundary_size_y_lower = 1 +CoordBase::boundary_size_z_lower = 1 +CoordBase::boundary_size_x_upper = 1 +CoordBase::boundary_size_y_upper = 1 +CoordBase::boundary_size_z_upper = 1 + +CartGrid3D::type = "coordbase" + + + +ActiveThorns = "CarpetEFenceTest" + +CarpetEFenceTest::breach_at = "lower" -- cgit v1.2.3