-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TestSubscycling: test subcycling in time
- Loading branch information
Showing
9 changed files
with
263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Cactus Code Thorn TestSubcycling | ||
Author(s) : Roland Haas <[email protected]> | ||
Maintainer(s): Roland Haas <[email protected]> | ||
Licence : NCSA | ||
-------------------------------------------------------------------------- | ||
|
||
1. Purpose | ||
|
||
not documented |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Configuration definitions for thorn TestSubcycling | ||
|
||
REQUIRES Loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
% *======================================================================* | ||
% 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 [email protected]\textgreater} | ||
|
||
% The title of the document (not necessarily the name of the Thorn) | ||
\title{TestSubcycling} | ||
|
||
% the date your document was last changed, if your document is in CVS, | ||
% please use: | ||
% \date{$ $Date$ $} | ||
% when using git instead record the commit ID: | ||
% \date{\gitrevision{<path-to-your-.git-directory>}} | ||
\date{February 26 2024} | ||
|
||
\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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Interface definition for thorn TestSubcycling | ||
implements: TestSubcycling | ||
|
||
USES INCLUDE HEADER: loop.hxx | ||
|
||
CCTK_REAL iteration TYPE=GF CENTERING={VVV} TAGS="checkpoint='no'" "subcycling and prolongation test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
ActiveThorns = " | ||
CarpetX | ||
ErrorEstimator | ||
IOUtil | ||
TestSubcycling | ||
" | ||
|
||
Cactus::presync_mode = "mixed-error" | ||
|
||
CarpetX::poison_undefined_values = yes | ||
|
||
CarpetX::ncells_x = 32 | ||
CarpetX::ncells_y = 32 | ||
CarpetX::ncells_z = 32 | ||
|
||
CarpetX::periodic_x = yes | ||
CarpetX::periodic_y = yes | ||
CarpetX::periodic_z = yes | ||
|
||
Cactus::cctk_itlast = 4 | ||
|
||
CarpetX::use_subcycling_wip = yes | ||
|
||
ErrorEstimator::region_shape = "cube" | ||
ErrorEstimator::scale_by_resolution = "yes" | ||
CarpetX::regrid_error_threshold = 4. | ||
CarpetX::max_num_levels = 2 | ||
|
||
IO::out_dir = $parfile | ||
IO::out_every = 1 | ||
IO::parfile_write = no | ||
|
||
CarpetX::out_adios2_every = 0 | ||
CarpetX::out_silo_every = 0 | ||
CarpetX::out_openpmd_every = 0 | ||
|
||
CarpetX::verbose = no | ||
CarpetX::out_performance = no | ||
CarpetX::out_metadata = no | ||
CarpetX::out_tsv_vars = " | ||
TestSubcycling::iteration | ||
CarpetX::regrid_error | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Parameter definitions for thorn TestSubcycling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Schedule definitions for thorn TestSubcycling | ||
|
||
STORAGE: iteration | ||
|
||
schedule TestSubcycling_Init AT INITIAL | ||
{ | ||
LANG: C | ||
WRITES: iteration(everywhere) | ||
} "initialize test grid function" | ||
|
||
schedule TestSubcycling_Update AT EVOL | ||
{ | ||
LANG: C | ||
WRITES: iteration(interior) | ||
SYNC: iteration | ||
} "update test grid function" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Main make.code.defn file for thorn TestSubcycling | ||
|
||
# Source files in this directory | ||
SRCS = subcycling.cxx | ||
|
||
# Subdirectories containing source files | ||
SUBDIRS = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "cctk.h" | ||
#include "cctk_Arguments.h" | ||
#include "cctk_Parameters.h" | ||
#include "loop.hxx" | ||
|
||
extern "C" | ||
void TestSubcycling_Init(CCTK_ARGUMENTS) | ||
{ | ||
DECLARE_CCTK_PARAMETERS; | ||
DECLARE_CCTK_ARGUMENTSX_TestSubcycling_Init; | ||
|
||
CCTK_INFO("Initializing grid function"); | ||
grid.loop_all<0,0,0>(grid.nghostzones, [=](const Loop::PointDesc &pt) { | ||
CCTK_REAL canary = 100 + 10 * cctk_iteration + 1 * cctk_level; | ||
iteration(pt.I) = canary; | ||
}); | ||
|
||
} | ||
|
||
extern "C" | ||
void TestSubcycling_Update(CCTK_ARGUMENTS) | ||
{ | ||
DECLARE_CCTK_PARAMETERS; | ||
DECLARE_CCTK_ARGUMENTSX_TestSubcycling_Update; | ||
|
||
CCTK_VINFO("Updating grid function at iteration %d level %d", cctk_iteration, cctk_level); | ||
grid.loop_int<0,0,0>(grid.nghostzones, [=] CCTK_HOST(const Loop::PointDesc &pt) { | ||
CCTK_REAL canary = 100 + 10 * cctk_iteration + 1 * cctk_level; | ||
iteration(pt.I) = canary; | ||
}); | ||
|
||
} |