From 11c4d98017cbb86d08e15fd1b549180184b58a26 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Thu, 3 Sep 2009 16:19:15 -0500 Subject: Import Carpet Ignore-this: 309b4dd613f4af2b84aa5d6743fdb6b3 --- CarpetExtra/ReductionTest3/README | 9 + CarpetExtra/ReductionTest3/doc/documentation.tex | 144 +++++++++++++++ CarpetExtra/ReductionTest3/interface.ccl | 20 +++ CarpetExtra/ReductionTest3/par/reductiontest.par | 186 +++++++++++++++++++ CarpetExtra/ReductionTest3/param.ccl | 11 ++ CarpetExtra/ReductionTest3/schedule.ccl | 49 +++++ CarpetExtra/ReductionTest3/src/CoM.c | 99 ++++++++++ CarpetExtra/ReductionTest3/src/make.code.defn | 8 + CarpetExtra/ReductionTest3/test/reductiontest.par | 210 ++++++++++++++++++++++ 9 files changed, 736 insertions(+) create mode 100644 CarpetExtra/ReductionTest3/README create mode 100644 CarpetExtra/ReductionTest3/doc/documentation.tex create mode 100644 CarpetExtra/ReductionTest3/interface.ccl create mode 100644 CarpetExtra/ReductionTest3/par/reductiontest.par create mode 100644 CarpetExtra/ReductionTest3/param.ccl create mode 100644 CarpetExtra/ReductionTest3/schedule.ccl create mode 100644 CarpetExtra/ReductionTest3/src/CoM.c create mode 100644 CarpetExtra/ReductionTest3/src/make.code.defn create mode 100644 CarpetExtra/ReductionTest3/test/reductiontest.par (limited to 'CarpetExtra') diff --git a/CarpetExtra/ReductionTest3/README b/CarpetExtra/ReductionTest3/README new file mode 100644 index 000000000..e7b1e569c --- /dev/null +++ b/CarpetExtra/ReductionTest3/README @@ -0,0 +1,9 @@ +CVS info : $Header:$ + +Cactus Code Thorn ReductionTest +Thorn Author(s) : Christian D. Ott +Thorn Maintainer(s) : Christian D. Ott +-------------------------------------------------------------------------- + +Purpose of the thorn: + diff --git a/CarpetExtra/ReductionTest3/doc/documentation.tex b/CarpetExtra/ReductionTest3/doc/documentation.tex new file mode 100644 index 000000000..2a85f9ff3 --- /dev/null +++ b/CarpetExtra/ReductionTest3/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/ReductionTest3/interface.ccl b/CarpetExtra/ReductionTest3/interface.ccl new file mode 100644 index 000000000..46ce46253 --- /dev/null +++ b/CarpetExtra/ReductionTest3/interface.ccl @@ -0,0 +1,20 @@ +# Interface definition for thorn ReductionTest +# $Header:$ + +implements: ReductionTest3 +inherits: grid + +CCTK_REAL myredvar TYPE=GF TIMELEVELS=3 tags='ProlongationParameter="Whisky::Whisky_Prolongation_Type" tensortypealias="Scalar" tensorweight=+1.0 interpolator="matter"' + +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/ReductionTest3/par/reductiontest.par b/CarpetExtra/ReductionTest3/par/reductiontest.par new file mode 100644 index 000000000..4b3eb6155 --- /dev/null +++ b/CarpetExtra/ReductionTest3/par/reductiontest.par @@ -0,0 +1,186 @@ +#--- Base and Driver Thorns + +ActiveThorns = "time + coordbase + mol + boundary + spacemask + symbase + aeilocalinterp + nanchecker + constants + ioutil + initbase + carpet + carpetlib + carpetregrid2 + carpetreduce + carpetinterp + loopcontrol + cartgrid3d + carpetslab + triggerterminationmanual + RotatingSymmetry90 + ReflectionSymmetry + Slab + " + +#--- Output related thorns + +ActiveThorns = " carpetioascii + carpetioscalar + carpetiohdf5 + carpetiobasic + " + +#--- Spacetime :-) + + +ActiveThorns = " + ReductionTest3 + " + +############################# Flesh Stuff ################################## +Cactus::cctk_run_title = "Reduction Test" +Cactus::cctk_full_warnings = yes +Cactus::highlight_warning_messages = no +#Cactus::cctk_timer_output = "full" +Cactus::cctk_itlast = 64 + +############################# Output Related ################################## +IO::out_dir = $par +IO::checkpoint_dir = $par +IO::recover_dir = $par +iohdf5::out_dir = $par +IO::out_single_precision = yes + +#--- checkpoint recovery +io::recover = no +iohdf5::checkpoint = no +io::checkpoint_every = 32 +io::checkpoint_keep = 3 +carpetiohdf5::use_reflevels_from_checkpoint = "yes" + +IOBasic::outInfo_vars = "Carpet::average_physical_time_per_hour" + +carpetioscalar::outScalar_vars = " + " +carpetioascii::out0D_vars = " + " + + +carpetioascii::out1D_vars = " + " + +iohdf5::out_vars = " + " + +#--- output frequency + +iohdf5::out_criterion = "divisor" +carpetioascii::out1D_criterion = "divisor" +carpetioascii::out2D_criterion = "divisor" + +carpetioascii::out0D_criterion = "divisor" +carpetioscalar::outScalar_criterion = "divisor" + +#carpetioscalar::outScalar_dt = 0.203 +#carpetioscalar::out0D_dt = 0.203 +#IOASCII::out1D_dt = +#IOASCII::out2D_dt = -1 + +carpetioscalar::outScalar_every = 32 +carpetioascii::out0D_every = 32 +carpetioascii::out1D_every = 256 +carpetioascii::out2D_every = -1 +iohdf5::out_every = -1 + +carpetiobasic::outInfo_every = 1 +carpetiobasic::real_min = 1.0e-2 + +IOASCII::one_file_per_group = yes +IOASCII::output_symmetry_points = no +IOASCII::out1D_d = no +############################# Driver ################################## +# Carpet Parameters +Carpet::domain_from_coordbase = yes +Carpet::max_refinement_levels = 2 + +driver::ghost_size = 3 +Carpet::use_buffer_zones = yes + +Carpet::prolongation_order_space = 3 +Carpet::prolongation_order_time = 2 + +Carpet::init_fill_timelevels = yes + +Carpet::verbose = no +Carpet::veryverbose = no + +Carpet::output_timers_every = 4096 +CarpetLib::print_timestats_every = 4096 +CarpetLib::print_memstats_every = 4096 + +############################# Grid ################################## + +CoordBase::domainsize = "minmax" +CoordBase::xmin = 0.0 +CoordBase::ymin = 0.0 +CoordBase::zmin = 0.0 +CoordBase::xmax = 40.0 +CoordBase::ymax = 40.0 +CoordBase::zmax = 40.0 + +CoordBase::spacing = "gridspacing" +CoordBase::dx = 1.0 +CoordBase::dy = 1.0 +CoordBase::dz = 1.0 + +CartGrid3D::type = "coordbase" +CartGrid3D::domain = "full" +CartGrid3D::avoid_originx = no +CartGrid3D::avoid_originy = no +CartGrid3D::avoid_originz = no + +CoordBase::boundary_size_x_lower = 3 +CoordBase::boundary_size_y_lower = 3 +CoordBase::boundary_size_z_lower = 3 +CoordBase::boundary_shiftout_x_lower = 1 +CoordBase::boundary_shiftout_y_lower = 1 +CoordBase::boundary_shiftout_z_lower = 1 + +ReflectionSymmetry::reflection_z = yes +ReflectionSymmetry::avoid_origin_z = no + +#CoordBase::boundary_size_x_upper = 3 +#CoordBase::boundary_size_y_upper = 3 +#CoordBase::boundary_size_z_upper = 3 + +CarpetRegrid2::min_distance = 0 +CarpetRegrid2::boundary_shiftout = -10 +CarpetRegrid2::ensure_proper_nesting = yes + +CarpetRegrid2::num_centres = 1 +CarpetRegrid2::num_levels_1 = 1 +CarpetRegrid2::position_x_1 = 0 +CarpetRegrid2::position_y_1 = 0 +CarpetRegrid2::position_z_1 = 0 +CarpetRegrid2::radius_1[1] = 20.0 # 1.6 +#CarpetRegrid2::radius_1[2] = 40.0 # 0.8 +#CarpetRegrid2::radius_1[3] = 20.0 # 0.4 +#CarpetRegrid2::radius_1[4] = 12.0 # 0.2 + +CarpetRegrid2::regrid_every = 16 +CarpetRegrid2::movement_threshold_1 = 0.0e0 +CarpetRegrid2::radius_change_threshold_1 = 0.0e0 + +############################# Time Integration ################################## +# Time integration parameters +MoL::ODE_Method = "RK3" +MoL::Generic_Type = "RK" +MoL::MoL_Intermediate_Steps = 3 +MoL::MoL_Num_Scratch_Levels = 2 + +Time::dtfac = 0.25 + +############################ Analysis ############################### diff --git a/CarpetExtra/ReductionTest3/param.ccl b/CarpetExtra/ReductionTest3/param.ccl new file mode 100644 index 000000000..160649261 --- /dev/null +++ b/CarpetExtra/ReductionTest3/param.ccl @@ -0,0 +1,11 @@ +# Parameter definitions for thorn ReductionTest +# $Header:$ + +shares: grid + +USES KEYWORD domain + + + + + diff --git a/CarpetExtra/ReductionTest3/schedule.ccl b/CarpetExtra/ReductionTest3/schedule.ccl new file mode 100644 index 000000000..92a70fce8 --- /dev/null +++ b/CarpetExtra/ReductionTest3/schedule.ccl @@ -0,0 +1,49 @@ +# Schedule definitions for thorn ReductionTest +# $Header:$ + +STORAGE: center_of_mass center_of_mass_helpers[3] myredvar[3] + +SCHEDULE CoM3_Local AT CCTK_INITIAL AFTER Whisky_Initial +{ + + LANG: C + SYNC: center_of_mass_helpers +} "Setup integrands for CoM calculation" + +SCHEDULE CoM3_Local AT CCTK_EVOL AFTER MoL_Evolution +{ + + LANG: C + SYNC: center_of_mass_helpers +} "Setup integrands for CoM calculation" + +SCHEDULE CoM3_Local AT Postregridinitial +{ + + LANG: C + SYNC: center_of_mass_helpers +} "Setup integrands for CoM calculation" + +SCHEDULE CoM3_Local AT Postregrid +{ + + LANG: C + SYNC: center_of_mass_helpers +} "Setup integrands for CoM calculation" + + + +SCHEDULE CoM3 AT CCTK_ANALYSIS +{ + + LANG: C + OPTIONS: GLOBAL +} "CoM Reductions" + + +#SCHEDULE CoM3 AT Postregrid AFTER CoM3_Local +#{ +# +# LANG: C +# OPTIONS: GLOBAL +#} "CoM Reductions" diff --git a/CarpetExtra/ReductionTest3/src/CoM.c b/CarpetExtra/ReductionTest3/src/CoM.c new file mode 100644 index 000000000..2347e3e9a --- /dev/null +++ b/CarpetExtra/ReductionTest3/src/CoM.c @@ -0,0 +1,99 @@ +#include "cctk.h" +#include "cctk_Parameters.h" +#include "cctk_Arguments.h" +#include "util_Table.h" +#include +#include + +void CoM3_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=0); + ierr = CCTK_Reduce(cctkGH, -1, reduction_handle, + 1, CCTK_VARIABLE_REAL, (void *)&denstotal, 1, varindex); + assert(!ierr); + + varindex = CCTK_VarIndex("ReductionTest3::dMx"); + assert(varindex>=0); + ierr = CCTK_Reduce(cctkGH, -1, reduction_handle, + 1, CCTK_VARIABLE_REAL, (void *)Mx, 1, varindex); + assert(!ierr); + + varindex = CCTK_VarIndex("ReductionTest3::dMy"); + assert(varindex>=0); + ierr = CCTK_Reduce(cctkGH, -1, reduction_handle, + 1, CCTK_VARIABLE_REAL, (void *)My, 1, varindex); + assert(!ierr); + + varindex = CCTK_VarIndex("ReductionTest3::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/ReductionTest3/src/make.code.defn b/CarpetExtra/ReductionTest3/src/make.code.defn new file mode 100644 index 000000000..6f1f90aa2 --- /dev/null +++ b/CarpetExtra/ReductionTest3/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/ReductionTest3/test/reductiontest.par b/CarpetExtra/ReductionTest3/test/reductiontest.par new file mode 100644 index 000000000..85a483338 --- /dev/null +++ b/CarpetExtra/ReductionTest3/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" -- cgit v1.2.3