KLSS3N5JSIY3CIMXEKMYAOOBGBCEEDFPYFN5RVZIQLQLKFZ3YGUQC
Cactus Code Thorn HydroBase
Author(s) : Erik Schnetter <schnetter@gmail.com>
Maintainer(s): Erik Schnetter <schnetter@gmail.com>
Licence : LGPL
--------------------------------------------------------------------------
1. Purpose
Provide storage for the hydro variables
2. Definitions
The HydroBase variables correspond to the Valencia formulation.
HydroBase uses the following conventions:
M = M_sun
c = G = 1
We also assume the following constants of nature:
c = 299792458.0 m/s
G = 6.67428e-11 m^3/kg/s^2
mu0 = 4 pi 1.0e-7 N/A^2
eps0 = 1 / (mu0 c^2)
M_sun = 1.98892e+30 kg
This corresponds to the following units:
[M] = M_sun
[L] = [M] (G / c^2)
[T] = [L] / c
[B] = 1 / [L] / sqrt(eps0 G / c^2))
# Interface definition for thorn HydroBase
IMPLEMENTS: HydroBase
USES INCLUDE HEADER: loop.hxx
PUBLIC:
CCTK_REAL rho TYPE=gf TAGS='index={1 1 1}' "rest mass density rho"
CCTK_REAL vel TYPE=gf TAGS='index={1 1 1}' { velx vely velz } "velocity v^i"
CCTK_REAL eps TYPE=gf TAGS='index={1 1 1}' "specific internal energy epsilon"
CCTK_REAL press TYPE=gf TAGS='index={1 1 1}' "pressure p"
# Parameter definitions for thorn HydroBase
RESTRICTED:
KEYWORD initial_hydro "Initial conditions for hydro"
{
"vacuum" :: "vacuum (without atmosphere)"
} "vacuum"
# Schedule definitions for thorn HydroBase
SCHEDULE GROUP HydroBase_InitialData AT initial
{
} "Schedule group for calculating hydro initial data"
SCHEDULE GROUP HydroBase_PostInitial AT initial AFTER HydroBase_InitialData
{
} "Schedule group for modifying the hydro initial data, such as e.g. adding noise"
SCHEDULE GROUP HydroBase_InitialData AT postregrid
{
} "Schedule group for calculating hydro initial data"
SCHEDULE GROUP HydroBase_PostInitial AT postregrid AFTER HydroBase_InitialData
{
} "Schedule group for modifying the hydro initial data, such as e.g. adding noise"
SCHEDULE GROUP HydroBase_SetHydroVars AT postregrid
{
} "Set hydro variables in this group, or before this group"
SCHEDULE GROUP HydroBase_SetHydroVars AT poststep
{
} "Set hydro variables in this group, or before this group"
SCHEDULE GROUP HydroBase_SetHydroVars IN ODESolvers_PostStep
{
} "Set hydro variables in this group, or before this group"
if (CCTK_EQUALS(initial_hydro, "vacuum")) {
SCHEDULE HydroBase_initial_data IN HydroBase_InitialData
{
LANG: C
WRITES: rho(everywhere) vel(everywhere) eps(everywhere) press(everywhere)
} "Set up vacuum initial data"
}
#include <loop.hxx>
#include <cctk.h>
#include <cctk_Arguments_Checked.h>
#include <cctk_Parameters.h>
namespace HydroBase {
using namespace Loop;
extern "C" void HydroBase_initial_data(CCTK_ARGUMENTS) {
DECLARE_CCTK_ARGUMENTS_HydroBase_initial_data;
DECLARE_CCTK_PARAMETERS;
const GF3D<CCTK_REAL, 1, 1, 1> rho_(cctkGH, rho);
const GF3D<CCTK_REAL, 1, 1, 1> velx_(cctkGH, velx);
const GF3D<CCTK_REAL, 1, 1, 1> vely_(cctkGH, vely);
const GF3D<CCTK_REAL, 1, 1, 1> velz_(cctkGH, velz);
const GF3D<CCTK_REAL, 1, 1, 1> eps_(cctkGH, eps);
const GF3D<CCTK_REAL, 1, 1, 1> press_(cctkGH, press);
loop_all<1, 1, 1>(cctkGH, [&](const PointDesc &p) { rho_(p.I) = 0; });
loop_all<1, 1, 1>(cctkGH, [&](const PointDesc &p) { velx_(p.I) = 0; });
loop_all<1, 1, 1>(cctkGH, [&](const PointDesc &p) { vely_(p.I) = 0; });
loop_all<1, 1, 1>(cctkGH, [&](const PointDesc &p) { velz_(p.I) = 0; });
loop_all<1, 1, 1>(cctkGH, [&](const PointDesc &p) { eps_(p.I) = 0; });
loop_all<1, 1, 1>(cctkGH, [&](const PointDesc &p) { press_(p.I) = 0; });
}
} // namespace HydroBase
# Main make.code.defn file for thorn HydroBase
# Source files in this directory
SRCS = hydrobase.cxx
# Subdirectories containing source files
SUBDIRS =