aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@0994f19a-7e1f-4f5a-9787-1e7a3bb7f33f>2009-11-24 21:52:23 +0000
committerschnetter <schnetter@0994f19a-7e1f-4f5a-9787-1e7a3bb7f33f>2009-11-24 21:52:23 +0000
commit2d52ce734e4775c90f0ad3e85c819ecc0dea2738 (patch)
tree64d3208f0230dc5015110b818b449dc5dc5c647d
parentb1825e55f722264f9e54dfd783deca2addc76130 (diff)
Add three thorns ID_Bin_BH, ID_Bin_NS, and ID_Mag_NS that import
LORENE initial data. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/Meudon_Bin_BH/trunk@2 0994f19a-7e1f-4f5a-9787-1e7a3bb7f33f
-rw-r--r--README12
-rw-r--r--configuration.ccl3
-rw-r--r--doc/documentation.tex144
-rw-r--r--interface.ccl5
-rw-r--r--param.ccl27
-rw-r--r--schedule.ccl16
-rw-r--r--src/Bin_BH.cc116
-rw-r--r--src/check_parameters.cc19
-rw-r--r--src/make.code.defn7
9 files changed, 349 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..b5cbd50
--- /dev/null
+++ b/README
@@ -0,0 +1,12 @@
+Cactus Code Thorn ID_Bin_BH
+Author(s) : Erik Schnetter <schnetter@cct.lsu.edu>
+Maintainer(s): Erik Schnetter <schnetter@cct.lsu.edu>
+Licence : GPL
+--------------------------------------------------------------------------
+
+1. Purpose
+
+Import LORENE Bin_BH binary black hole initial data.
+
+This thorn is one of three closely related thorns ID_Bin_BH,
+ID_Bin_NS, and ID_Mag_NS which all import LORENE initial data.
diff --git a/configuration.ccl b/configuration.ccl
new file mode 100644
index 0000000..8d8558c
--- /dev/null
+++ b/configuration.ccl
@@ -0,0 +1,3 @@
+# Configuration definition for thorn ID_Bin_BH
+
+REQUIRES LORENE
diff --git a/doc/documentation.tex b/doc/documentation.tex
new file mode 100644
index 0000000..7d1f411
--- /dev/null
+++ b/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{Erik Schnetter \textless schnetter@cct.lsu.edu\textgreater}
+
+% The title of the document (not necessarily the name of the Thorn)
+\title{ID\_Bin\_BH}
+
+% the date your document was last changed, if your document is in CVS,
+% please use:
+% \date{$ $Date$ $}
+\date{November 24 2009}
+
+\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/interface.ccl b/interface.ccl
new file mode 100644
index 0000000..cb32a3c
--- /dev/null
+++ b/interface.ccl
@@ -0,0 +1,5 @@
+# Interface definition for thorn ID_Bin_BH
+
+IMPLEMENTS: ID_Bin_BH
+
+INHERITS: grid ADMBase
diff --git a/param.ccl b/param.ccl
new file mode 100644
index 0000000..1125d91
--- /dev/null
+++ b/param.ccl
@@ -0,0 +1,27 @@
+# Parameter definitions for thorn ID_Bin_BH
+
+SHARES: ADMBase
+
+EXTENDS KEYWORD initial_data
+{
+ "ID_Bin_BH" :: ""
+}
+
+EXTENDS KEYWORD initial_lapse
+{
+ "ID_Bin_BH" :: ""
+}
+
+EXTENDS KEYWORD initial_shift
+{
+ "ID_Bin_BH" :: ""
+}
+
+
+
+PRIVATE:
+
+STRING filename "Input file name"
+{
+ "" :: ""
+} ""
diff --git a/schedule.ccl b/schedule.ccl
new file mode 100644
index 0000000..6b147e5
--- /dev/null
+++ b/schedule.ccl
@@ -0,0 +1,16 @@
+# Schedule definitions for thorn ID_Bin_BH
+
+if (CCTK_EQUALS (initial_data, "ID_Bin_BH") ||
+ CCTK_EQUALS (initial_lapse, "ID_Bin_BH") ||
+ CCTK_EQUALS (initial_shift, "ID_Bin_BH"))
+{
+ SCHEDULE ID_Bin_BH_check_parameters AT paramcheck
+ {
+ LANG: C
+ } "Check parameters"
+
+ SCHEDULE ID_Bin_BH_initialise IN ADMBase_Initial
+ {
+ LANG: C
+ } "Set up binary black hole initial data"
+}
diff --git a/src/Bin_BH.cc b/src/Bin_BH.cc
new file mode 100644
index 0000000..693cdbc
--- /dev/null
+++ b/src/Bin_BH.cc
@@ -0,0 +1,116 @@
+#include <cassert>
+#include <cstdio>
+#include <vector>
+
+#include <cctk.h>
+#include <cctk_Arguments.h>
+#include <cctk_Parameters.h>
+
+#include <bin_bh.h>
+
+using namespace std;
+
+
+
+extern "C"
+void ID_Bin_BH_initialise (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INFO ("Setting up LORENE Bin_BH initial data");
+
+
+
+ CCTK_INFO ("Setting up coordinates");
+
+ int const npoints = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2];
+
+ vector<double> xx(npoints), yy(npoints), zz(npoints);
+
+#pragma omp parallel for
+ for (int i=0; i<npoints; ++i) {
+ xx[i] = x[i];
+ yy[i] = y[i];
+ zz[i] = z[i];
+ }
+
+
+
+ CCTK_VInfo (CCTK_THORNSTRING, "Reading from file \"%s\"", filename);
+
+ Bin_BH bin_bh (npoints, &xx[0], &yy[0], &zz[0], 1, filename);
+
+ CCTK_VInfo (CCTK_THORNSTRING, "Omega [1/a]: %g", bin_bh.omega);
+ CCTK_VInfo (CCTK_THORNSTRING, "dist [a]: %g", bin_bh.dist);
+ CCTK_VInfo (CCTK_THORNSTRING, "radius1 [a]: %g", 1.0);
+ CCTK_VInfo (CCTK_THORNSTRING, "radius2 [a]: %g", bin_bh.radius2);
+ assert (bin_bh.np == npoints);
+
+
+
+ CCTK_INFO ("Filling in Cactus grid points");
+
+#pragma omp parallel for
+ for (int i=0; i<npoints; ++i) {
+
+ alp[i] = bin_bh.nnn[i];
+
+ betax[i] = bin_bh.beta_x[i];
+ betay[i] = bin_bh.beta_y[i];
+ betaz[i] = bin_bh.beta_z[i];
+
+ CCTK_REAL g[3][3];
+ g[0][0] = bin_bh.g_xx[i];
+ g[0][1] = bin_bh.g_xy[i];
+ g[0][2] = bin_bh.g_xz[i];
+ g[1][1] = bin_bh.g_yy[i];
+ g[1][2] = bin_bh.g_yz[i];
+ g[2][2] = bin_bh.g_zz[i];
+ g[1][0] = g[0][1];
+ g[2][0] = g[0][2];
+ g[2][1] = g[1][2];
+
+ CCTK_REAL ku[3][3];
+ ku[0][0] = bin_bh.k_xx[i];
+ ku[0][1] = bin_bh.k_xy[i];
+ ku[0][2] = bin_bh.k_xz[i];
+ ku[1][1] = bin_bh.k_yy[i];
+ ku[1][2] = bin_bh.k_yz[i];
+ ku[2][2] = bin_bh.k_zz[i];
+ ku[1][0] = ku[0][1];
+ ku[2][0] = ku[0][2];
+ ku[2][1] = ku[1][2];
+
+ CCTK_REAL k[3][3];
+ for (int a=0; a<3; ++a) {
+ for (int b=0; b<3; ++b) {
+ k[a][b] = 0.0;
+ for (int c=0; c<3; ++c) {
+ for (int d=0; d<3; ++d) {
+ k[a][b] += g[a][c] * g[b][d] * ku[c][d];
+ }
+ }
+ }
+ }
+
+ gxx[i] = g[0][0];
+ gxy[i] = g[0][1];
+ gxz[i] = g[0][2];
+ gyy[i] = g[1][1];
+ gyz[i] = g[1][2];
+ gzz[i] = g[2][2];
+
+ kxx[i] = k[0][0];
+ kxy[i] = k[0][1];
+ kxz[i] = k[0][2];
+ kyy[i] = k[1][1];
+ kyz[i] = k[1][2];
+ kzz[i] = k[2][2];
+
+ } // for i
+
+
+
+ CCTK_INFO ("Done.");
+}
diff --git a/src/check_parameters.cc b/src/check_parameters.cc
new file mode 100644
index 0000000..1709d8d
--- /dev/null
+++ b/src/check_parameters.cc
@@ -0,0 +1,19 @@
+#include <cctk.h>
+#include <cctk_Arguments.h>
+#include <cctk_Parameters.h>
+
+
+
+extern "C"
+void ID_Bin_BH_check_parameters (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ if (not CCTK_EQUALS (initial_data , "ID_Bin_BH") or
+ not CCTK_EQUALS (initial_lapse, "ID_Bin_BH") or
+ not CCTK_EQUALS (initial_shift, "ID_Bin_BH"))
+ {
+ CCTK_PARAMWARN ("The parameters ADMBase::initial_data, ADMBase::initial_lapse, and ADMBase::initial_shift must all be set to the value \"ID_Bin_BH\"");
+ }
+}
diff --git a/src/make.code.defn b/src/make.code.defn
new file mode 100644
index 0000000..f52b6c8
--- /dev/null
+++ b/src/make.code.defn
@@ -0,0 +1,7 @@
+# Main make.code.defn file for thorn ID_Bin_BH
+
+# Source files in this directory
+SRCS = Bin_BH.cc check_parameters.cc
+
+# Subdirectories containing source files
+SUBDIRS =