From 06903d0f2e0b9ebe34efbeec1dda3aaaef6dd26d Mon Sep 17 00:00:00 2001 From: schnetter Date: Tue, 24 Nov 2009 21:52:23 +0000 Subject: 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_NS/trunk@2 f2ea251b-07d6-4a45-8f2c-a162b3fa7596 --- src/Bin_NS.cc | 158 ++++++++++++++++++++++++++++++++++++++++++++++++ src/check_parameters.cc | 20 ++++++ src/make.code.defn | 7 +++ 3 files changed, 185 insertions(+) create mode 100644 src/Bin_NS.cc create mode 100644 src/check_parameters.cc create mode 100644 src/make.code.defn (limited to 'src') diff --git a/src/Bin_NS.cc b/src/Bin_NS.cc new file mode 100644 index 0000000..4e2696f --- /dev/null +++ b/src/Bin_NS.cc @@ -0,0 +1,158 @@ +#include +#include +#include + +#include +#include +#include + +#include + +using namespace std; + + + +extern "C" +void ID_Bin_NS_initialise (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + DECLARE_CCTK_PARAMETERS; + + CCTK_INFO ("Setting up LORENE Bin_NS initial data"); + + // Meudon data are distributed in SI units (MKSA). Here are some + // conversion factors. + + // Defined constants + CCTK_REAL const c_light = 299792458.0; // speed of light [m/s] + + // Constants of nature (IAU, CODATA): + CCTK_REAL const G_grav = 6.67428e-11; // gravitational constant [m^3/kg/s^2] + CCTK_REAL const M_sun = 1.98892e+30; // solar mass [kg] + + // Cactus units in terms of SI units: + // (These are derived from M = M_sun, c = G = 1, and using 1/M_sun + // for the magnetic field) + CCTK_REAL const cactusM = M_sun; + CCTK_REAL const cactusL = cactusM * G_grav / pow(c_light,2); + CCTK_REAL const cactusT = cactusL / c_light; + + // Other quantities in terms of Cactus units + CCTK_REAL const coord_unit = cactusL / 1.0e+3; // from km + CCTK_REAL const rho_unit = cactusM / pow(cactusL,3); // from kg/m^3 + CCTK_REAL const ener_unit = pow(cactusL,2); // from c^2 + CCTK_REAL const vel_unit = cactusL / cactusT / c_light; // from c + + + + CCTK_INFO ("Setting up coordinates"); + + int const npoints = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2]; + + vector xx(npoints), yy(npoints), zz(npoints); + +#pragma omp parallel for + for (int i=0; i +#include +#include + + + +extern "C" +void ID_Bin_NS_check_parameters (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + DECLARE_CCTK_PARAMETERS; + + if (not CCTK_EQUALS (initial_data , "ID_Bin_NS") or + not CCTK_EQUALS (initial_lapse, "ID_Bin_NS") or + not CCTK_EQUALS (initial_shift, "ID_Bin_NS") or + not CCTK_EQUALS (initial_hydro, "ID_Bin_NS")) + { + CCTK_PARAMWARN ("The parameters ADMBase::initial_data, ADMBase::initial_lapse, ADMBase::initial_shift, and HydroBase::initial_hydro must all be set to the value \"ID_Bin_NS\""); + } +} diff --git a/src/make.code.defn b/src/make.code.defn new file mode 100644 index 0000000..bc238db --- /dev/null +++ b/src/make.code.defn @@ -0,0 +1,7 @@ +# Main make.code.defn file for thorn ID_Bin_NS + +# Source files in this directory +SRCS = Bin_NS.cc check_parameters.cc + +# Subdirectories containing source files +SUBDIRS = -- cgit v1.2.3