SU2RMRIY2IVVZYKL7SRDLYYA4ZWE2XFKV7DSS6KTOOSUMSMHKWAQC
Cactus Code Thorn AHFinder
Author(s) : Erik Schnetter <schnetter@gmail.com>
Maintainer(s): Erik Schnetter <schnetter@gmail.com>
Licence : LGPL
--------------------------------------------------------------------------
1. Purpose
Find apparent horizons
# Interface definition for thorn AHFinder
IMPLEMENTS: AHFinder
INHERITS: ADMBase
void FUNCTION Interpolate(
CCTK_POINTER_TO_CONST IN cctkGH,
CCTK_INT IN npoints,
CCTK_REAL ARRAY IN coordsx,
CCTK_REAL ARRAY IN coordsy,
CCTK_REAL ARRAY IN coordsz,
CCTK_INT IN nvars,
CCTK_INT ARRAY IN varinds,
CCTK_INT ARRAY IN operations,
CCTK_POINTER IN resultptrs)
REQUIRES FUNCTION Interpolate
ActiveThorns = "
ADMBase
AHFinder
CarpetX
Coordinates
Formaline
IOUtil
ODESolvers
SystemTopology
TimerReport
"
$nlevels = 3
$ncells = 32
Cactus::cctk_show_schedule = no
Cactus::terminate = "time"
Cactus::cctk_final_time = 0 #TODO 1.0
CarpetX::verbose = no
CarpetX::xmin = -1.0
CarpetX::ymin = -1.0
CarpetX::zmin = -1.0
CarpetX::xmax = +1.0
CarpetX::ymax = +1.0
CarpetX::zmax = +1.0
CarpetX::ncells_x = $ncells
CarpetX::ncells_y = $ncells
CarpetX::ncells_z = $ncells
CarpetX::max_num_levels = $nlevels
CarpetX::regrid_every = 16
CarpetX::regrid_error_threshold = 5.0
CarpetX::prolongation_type = "ddf" # was "conservative"
CarpetX::do_reflux = no
CarpetX::do_restrict = no
CarpetX::restrict_during_sync = yes
CarpetX::dtfac = 0.25
IO::out_dir = $parfile
IO::out_every = 1 #TODO $ncells * 2 ** ($nlevels - 1) / 32
CarpetX::out_tsv = yes #TODO no
TimerReport::out_every = 0 #TODO $ncells * 2 ** ($nlevels - 1) / 32
TimerReport::out_filename = "TimerReport"
TimerReport::output_all_timers_together = yes
TimerReport::output_all_timers_readable = yes
TimerReport::n_top_timers = 50
# Parameter definitions for thorn AHFinder
# Schedule definitions for thorn AHFinder
SCHEDULE AHFinder_interpolate AT poststep
{
LANG: C
OPTIONS: global
READS: ADMBase::metric(everywhere)
READS: ADMBase::curv(everywhere)
} "Interpolate ADM variables"
#include <loop.hxx>
#include <cctk.h>
#include <cctk_Arguments_Checked.h>
#include <cctk_Parameters.h>
#include <vector>
namespace AHFinder {
using namespace std;
extern "C" void AHFinder_interpolate(CCTK_ARGUMENTS) {
DECLARE_CCTK_ARGUMENTS_AHFinder_interpolate;
DECLARE_CCTK_PARAMETERS;
constexpr int npoints = 4;
const vector<CCTK_REAL> coordsx{0.1, 0.2, 0.3, 0.1};
const vector<CCTK_REAL> coordsy{0.1, 0.2, 0.3, 0.2};
const vector<CCTK_REAL> coordsz{0.1, 0.2, 0.3, 0.3};
constexpr int nvars = 3;
const vector<CCTK_INT> varinds{
CCTK_VarIndex("Coordinates::coordx"),
CCTK_VarIndex("Coordinates::coordy"),
CCTK_VarIndex("Coordinates::coordz"),
};
const vector<CCTK_INT> operations{
0,
0,
0,
};
vector<vector<CCTK_REAL> > results(nvars);
vector<CCTK_REAL *> resultptrs(nvars);
for (int n = 0; n < nvars; ++n) {
results.at(n).resize(npoints);
resultptrs.at(n) = results.at(n).data();
}
Interpolate(cctkGH, npoints, coordsx.data(), coordsy.data(), coordsz.data(),
nvars, varinds.data(), operations.data(), resultptrs.data());
for (int v = 0; v < nvars; ++v)
for (int n = 0; n < npoints; ++n)
CCTK_VINFO("%d[%d]=%g", v, n, double(results.at(v).at(n)));
}
} // namespace AHFinder
# Main make.code.defn file for thorn AHFinder
# Source files in this directory
SRCS = interpolate.cxx
# Subdirectories containing source files
SUBDIRS =