aboutsummaryrefslogtreecommitdiff
path: root/CarpetExtra
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2008-03-01 22:23:39 -0600
committerErik Schnetter <schnetter@cct.lsu.edu>2008-03-01 22:23:39 -0600
commit538f9330d9ffacffcc224fcbd0dcc6aeab71d9ae (patch)
treea4a0cb08bb6e192f9f6ce2c7d9f1b49285bf2ef2 /CarpetExtra
parent6d9eced1782eeb2584734779ec979bb45ed1569c (diff)
New thorn CarpetExtra/ReductionTest
Diffstat (limited to 'CarpetExtra')
-rw-r--r--CarpetExtra/ReductionTest/README9
-rw-r--r--CarpetExtra/ReductionTest/doc/documentation.tex144
-rw-r--r--CarpetExtra/ReductionTest/interface.ccl18
-rw-r--r--CarpetExtra/ReductionTest/param.ccl11
-rw-r--r--CarpetExtra/ReductionTest/schedule.ccl41
-rw-r--r--CarpetExtra/ReductionTest/src/CoM.c99
-rw-r--r--CarpetExtra/ReductionTest/src/make.code.defn8
-rw-r--r--CarpetExtra/ReductionTest/test/reductiontest.par210
8 files changed, 540 insertions, 0 deletions
diff --git a/CarpetExtra/ReductionTest/README b/CarpetExtra/ReductionTest/README
new file mode 100644
index 000000000..e7b1e569c
--- /dev/null
+++ b/CarpetExtra/ReductionTest/README
@@ -0,0 +1,9 @@
+CVS info : $Header:$
+
+Cactus Code Thorn ReductionTest
+Thorn Author(s) : Christian D. Ott <cott@aei.mpg.de>
+Thorn Maintainer(s) : Christian D. Ott <cott@aei.mpg.de>
+--------------------------------------------------------------------------
+
+Purpose of the thorn:
+
diff --git a/CarpetExtra/ReductionTest/doc/documentation.tex b/CarpetExtra/ReductionTest/doc/documentation.tex
new file mode 100644
index 000000000..2a85f9ff3
--- /dev/null
+++ b/CarpetExtra/ReductionTest/doc/documentation.tex
@@ -0,0 +1,144 @@
+% *======================================================================*
+% Cactus Thorn template for ThornGuide documentation
+% Author: Ian Kelley
+% Date: Sun Jun 02, 2002
+% $Header: /cactusdevcvs/Cactus/doc/ThornGuide/template.tex,v 1.12 2004/01/07 20:12:39 rideout Exp $
+%
+% 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: /cactusdevcvs/Cactus/doc/ThornGuide/template.tex,v 1.12 2004/01/07 20:12:39 rideout Exp $
+
+\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{Christian D. Ott \textless cott@aei.mpg.de\textgreater}
+
+% The title of the document (not necessarily the name of the Thorn)
+\title{ReductionTest}
+
+% the date your document was last changed, if your document is in CVS,
+% please use:
+% \date{$ $Date: 2004/01/07 20:12:39 $ $}
+\date{April 18 2006}
+
+\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/ReductionTest/interface.ccl b/CarpetExtra/ReductionTest/interface.ccl
new file mode 100644
index 000000000..20a698e8a
--- /dev/null
+++ b/CarpetExtra/ReductionTest/interface.ccl
@@ -0,0 +1,18 @@
+# Interface definition for thorn ReductionTest
+# $Header:$
+
+implements: ReductionTest
+inherits: Whisky grid
+
+CCTK_REAL center_of_mass_helpers TYPE=GF TIMELEVELS=3 tags='prolongation="none"'
+{
+
+ dMx,dMy,dMz
+}
+
+CCTK_REAL center_of_mass TYPE=SCALAR
+{
+
+ Mx,My,Mz,Mr
+}
+
diff --git a/CarpetExtra/ReductionTest/param.ccl b/CarpetExtra/ReductionTest/param.ccl
new file mode 100644
index 000000000..160649261
--- /dev/null
+++ b/CarpetExtra/ReductionTest/param.ccl
@@ -0,0 +1,11 @@
+# Parameter definitions for thorn ReductionTest
+# $Header:$
+
+shares: grid
+
+USES KEYWORD domain
+
+
+
+
+
diff --git a/CarpetExtra/ReductionTest/schedule.ccl b/CarpetExtra/ReductionTest/schedule.ccl
new file mode 100644
index 000000000..fa9554756
--- /dev/null
+++ b/CarpetExtra/ReductionTest/schedule.ccl
@@ -0,0 +1,41 @@
+# Schedule definitions for thorn ReductionTest
+# $Header:$
+
+STORAGE: center_of_mass center_of_mass_helpers[3]
+
+SCHEDULE CoM_Local AT CCTK_INITIAL AFTER Whisky_Initial
+{
+
+ LANG: C
+ SYNC: center_of_mass_helpers
+} "Setup integrands for CoM calculation"
+
+SCHEDULE CoM_Local AT CCTK_EVOL AFTER MoL_Evolution
+{
+
+ LANG: C
+ SYNC: center_of_mass_helpers
+} "Setup integrands for CoM calculation"
+
+SCHEDULE CoM_Local AT Postregridinitial
+{
+
+ LANG: C
+ SYNC: center_of_mass_helpers
+} "Setup integrands for CoM calculation"
+
+SCHEDULE CoM_Local AT Postregrid
+{
+
+ LANG: C
+ SYNC: center_of_mass_helpers
+} "Setup integrands for CoM calculation"
+
+
+
+SCHEDULE CoM AT CCTK_ANALYSIS
+{
+
+ LANG: C
+ OPTIONS: GLOBAL
+} "CoM Reductions"
diff --git a/CarpetExtra/ReductionTest/src/CoM.c b/CarpetExtra/ReductionTest/src/CoM.c
new file mode 100644
index 000000000..6724ad7be
--- /dev/null
+++ b/CarpetExtra/ReductionTest/src/CoM.c
@@ -0,0 +1,99 @@
+#include "cctk.h"
+#include "cctk_Parameters.h"
+#include "cctk_Arguments.h"
+#include "util_Table.h"
+#include <assert.h>
+#include <math.h>
+
+void CoM_Local(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ int i,j,k,index;
+
+ int nx = cctk_lsh[0];
+ int ny = cctk_lsh[1];
+ int nz = cctk_lsh[2];
+
+ for (k=0;k<nz;k++)
+ for (j=0;j<ny;j++)
+ for (i=0;i<nx;i++) {
+
+ index = CCTK_GFINDEX3D(cctkGH,i,j,k);
+
+ dMx[index] = dens[index]*x[index];
+ dMy[index] = dens[index]*y[index];
+ dMz[index] = dens[index]*z[index];
+
+ }
+}
+
+
+void CoM(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+
+ int varindex = -1;
+ int ierr = 0;
+ int cf = 1.0;
+ int reduction_handle;
+ int vartype;
+
+ CCTK_REAL d3x,tiny,denstotal;
+
+ CCTK_REAL sym_factor1,sym_factor2,sym_factor3;
+
+ if (CCTK_EQUALS(domain,"bitant")){
+ sym_factor1 = 2.0e0;
+ sym_factor2 = 2.0e0;
+ sym_factor3 = 0.0e0;
+ } else if (CCTK_EQUALS(domain,"octant")){
+ sym_factor1 = 8.0e0;
+ sym_factor2 = 0.0e0;
+ sym_factor3 = 0.0e0;
+ } else {
+ sym_factor1 = 1.0e0;
+ sym_factor2 = 1.0e0;
+ sym_factor3 = 1.0e0;
+ }
+
+
+ reduction_handle = CCTK_ReductionHandle("sum");
+
+
+ varindex = CCTK_VarIndex("Whisky::dens");
+ assert(varindex>=0);
+ ierr = CCTK_Reduce(cctkGH, -1, reduction_handle,
+ 1, CCTK_VARIABLE_REAL, (void *)&denstotal, 1, varindex);
+ assert(!ierr);
+
+ varindex = CCTK_VarIndex("ReductionTest::dMx");
+ assert(varindex>=0);
+ ierr = CCTK_Reduce(cctkGH, -1, reduction_handle,
+ 1, CCTK_VARIABLE_REAL, (void *)Mx, 1, varindex);
+ assert(!ierr);
+
+ varindex = CCTK_VarIndex("ReductionTest::dMy");
+ assert(varindex>=0);
+ ierr = CCTK_Reduce(cctkGH, -1, reduction_handle,
+ 1, CCTK_VARIABLE_REAL, (void *)My, 1, varindex);
+ assert(!ierr);
+
+ varindex = CCTK_VarIndex("ReductionTest::dMz");
+ assert(varindex>=0);
+ ierr = CCTK_Reduce(cctkGH, -1, reduction_handle,
+ 1, CCTK_VARIABLE_REAL, (void *)Mz, 1, varindex);
+ assert(!ierr);
+
+ denstotal = sym_factor1*denstotal;
+ *Mx = sym_factor2*(*Mx)/(denstotal);
+ *My = sym_factor2*(*My)/(denstotal);
+ *Mz = sym_factor3*(*Mz)/(denstotal);
+ *Mr = sqrt( (*Mx)*(*Mx)+(*My)*(*My)+(*Mz)*(*Mz) );
+
+ CCTK_VInfo(CCTK_THORNSTRING,"Mr: %15.6E Mx: %15.6E My: %15.6E Mz %15.6E",*Mr,*Mx,*My,*Mz);
+}
+
diff --git a/CarpetExtra/ReductionTest/src/make.code.defn b/CarpetExtra/ReductionTest/src/make.code.defn
new file mode 100644
index 000000000..6f1f90aa2
--- /dev/null
+++ b/CarpetExtra/ReductionTest/src/make.code.defn
@@ -0,0 +1,8 @@
+# Main make.code.defn file for thorn ReductionTest
+# $Header:$
+
+# Source files in this directory
+SRCS = CoM.c
+
+# Subdirectories containing source files
+SUBDIRS =
diff --git a/CarpetExtra/ReductionTest/test/reductiontest.par b/CarpetExtra/ReductionTest/test/reductiontest.par
new file mode 100644
index 000000000..85a483338
--- /dev/null
+++ b/CarpetExtra/ReductionTest/test/reductiontest.par
@@ -0,0 +1,210 @@
+
+#--- Base and Driver Thorns
+
+ActiveThorns = " time
+ carpet
+ carpetlib
+ carpetregrid
+ carpetreduce
+ carpetslab
+ cartgrid3d
+ coordbase
+ mol
+ boundary
+ spacemask
+ carpetiobasic
+ carpetioscalar
+ carpetioascii
+ ioutil
+ symbase
+ aeilocalinterp
+ carpetinterp
+ "
+
+#--- Spacetime :-)
+
+ActiveThorns = " admbase
+ staticconformal
+ admconstraints
+ admcoupling
+ coordgauge
+ admmacros
+ bssn_mol
+ "
+
+#--- Hydrodynamics
+
+ActiveThorns = " whisky
+ whisky_init_data
+ whisky_rnsid
+ eos_base
+ eos_polytrope
+ reductiontest
+ "
+
+
+
+################## Output Related Stuff ##################################
+
+IOBasic::outInfo_vars = "whisky::rho admbase::alp"
+iobasic::outInfo_every = 1
+
+IOScalar::outScalar_vars = "whisky::rho admbase::alp"
+ioscalar::outScalar_every = 1
+
+IOASCII::out1D_vars = "whisky::rho admbase::alp"
+ioascii::out1D_every = 1
+
+
+#--- general
+
+
+#--- output directories
+IO::out_dir = $parfile
+
+#--- checkpoint recovery
+io::recover = "no"
+
+
+#--- output frequency
+
+io::out_single_precision = "yes"
+
+
+
+############################# DRIVER #####################################
+
+#--- Benchmarking
+
+carpet::constant_load_per_processor = "yes"
+
+#--- performance & infrastructure
+
+carpetlib::use_collective_communication_buffers = "yes"
+carpet::enable_all_storage = "no"
+CarpetLib::save_memory_during_regridding = "yes"
+
+#--- Carpet prolongation order settings
+
+Carpet::prolongation_order_space = 3
+Carpet::prolongation_order_time = 2
+
+
+#--- Carpet initial data setup parameters
+
+Carpet::init_3_timelevels = "yes"
+Carpet::init_each_timelevel = "no"
+
+
+#--- Grid Setup and carpet parameters
+
+
+carpet::buffer_width = 6
+
+driver::ghost_size = 3
+
+cartgrid3d::type = "box"
+cartgrid3d::domain = "full"
+cartgrid3d::avoid_origin = "no"
+
+cartgrid3d::dxyz = 1.0
+driver::global_nx = 30
+driver::global_ny = 30
+driver::global_nz = 30
+
+cactus::cctk_itlast = 128
+
+Carpet::domain_from_coordbase = "no"
+
+carpet::max_refinement_levels = 3
+carpetregrid::refinement_levels = 1
+
+carpetregrid::regrid_every = 16
+carpetregrid::num_new_levels = 1
+carpetregrid::activate_levels_on_regrid = "fixed"
+
+carpet::veryverbose = "no"
+carpet::verbose = "no"
+
+
+################## Spacetime Related Stuff #############################
+
+
+admbase::evolution_method = "adm_bssn"
+admbase::lapse_evolution_method = "1+log"
+admbase::shift_evolution_method = "static"
+
+boundary::radpower = 2
+
+admconstraints::bound = "static"
+
+bssn_mol::timelevels = 3
+
+
+######################## Hydro Related Stuff ###########################
+
+
+whisky::timelevels = 3
+
+whisky::whisky_rho_central = 1.61930347e-08
+whisky::riemann_solver = "Marquina"
+whisky::whisky_eos_type = "Polytype"
+whisky::whisky_eos_table = "2D_Polytrope"
+whisky::recon_method = "ppm"
+whisky::ppm_detect = "yes"
+whisky::whisky_stencil = 3
+whisky::bound = "none"
+
+whisky::EoS_Change = "no"
+EOS_Polytrope::eos_gamma = 2.0
+EOS_Polytrope::eos_k = 1.0
+EOS_Polytrope::use_cgs = "yes"
+EOS_Polytrope::gamma_ini = 2.0
+
+#------ Atmosphere treatment
+
+SpaceMask::use_mask = yes
+
+whisky::rho_rel_min = 1.e-5
+
+#------ Atmosphere only for
+whisky::initial_atmosphere_factor = 0.99
+
+
+
+####################### Initial Data #####################################
+
+
+admbase::initial_data = "rnsid"
+admbase::initial_lapse = "rnsid"
+admbase::initial_shift = "rnsid"
+admbase::metric_type = "physical"
+
+rnsid::axes_ratio = 1.0
+rnsid::accuracy = 1e-7
+
+rnsid::RNS_Gamma = 2.0
+rnsid::RNS_K = 100.0
+
+rnsid::recover_2Dmodel = "no"
+rnsid::save_2Dmodel = "no"
+
+#rnsid::mdiv = 151
+#rnsid::sdiv = 301
+
+
+
+
+##################### Infrastructure Related Stuff ########################
+
+#--- Time integration
+
+mol::ode_method = "icn"
+MoL::Generic_Type = "RK"
+MoL::MoL_Intermediate_Steps = 3
+time::dtfac = 0.375
+
+
+
+#---- Timer output
+cactus::cctk_timer_output = "FULL"