From 4b548cef6528ff0527c697e930cbef6261209d7a Mon Sep 17 00:00:00 2001 From: Roland Haas Date: Fri, 7 Sep 2012 23:17:05 -0400 Subject: Carpet: add aliased routines to obtain map, timelevel --- Carpet/Carpet/interface.ccl | 21 +++++++++++++++++++++ Carpet/Carpet/src/helpers.cc | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/Carpet/Carpet/interface.ccl b/Carpet/Carpet/interface.ccl index 1a1f118f2..d2f7f5643 100644 --- a/Carpet/Carpet/interface.ccl +++ b/Carpet/Carpet/interface.ccl @@ -282,6 +282,27 @@ PROVIDES FUNCTION GetLocalComponents \ WITH Carpet_GetLocalComponents \ LANGUAGE C +CCTK_INT FUNCTION \ + GetMap \ + (CCTK_POINTER_TO_CONST IN cctkGH) +PROVIDES FUNCTION GetMap \ + WITH Carpet_GetMap \ + LANGUAGE C + +CCTK_INT FUNCTION \ + GetMaps \ + (CCTK_POINTER_TO_CONST IN cctkGH) +PROVIDES FUNCTION GetMaps \ + WITH Carpet_GetMaps \ + LANGUAGE C + +CCTK_INT FUNCTION \ + GetTimeLevel \ + (CCTK_POINTER_TO_CONST IN cctkGH) +PROVIDES FUNCTION GetTimeLevel \ + WITH Carpet_GetTimeLevel \ + LANGUAGE C + # Get pointer to grid variable for a specific map and refinement level diff --git a/Carpet/Carpet/src/helpers.cc b/Carpet/Carpet/src/helpers.cc index f2f07f12e..52e943d0e 100644 --- a/Carpet/Carpet/src/helpers.cc +++ b/Carpet/Carpet/src/helpers.cc @@ -66,6 +66,27 @@ namespace Carpet { return vhh.AT(map)->local_components(reflevel); } + // Get current map level + extern "C" + CCTK_INT Carpet_GetMap (CCTK_POINTER_TO_CONST const cctkGH) + { + return map; + } + + // Get number of maps + extern "C" + CCTK_INT Carpet_GetMaps (CCTK_POINTER_TO_CONST const cctkGH) + { + return maps; + } + + // Get current map level + extern "C" + CCTK_INT Carpet_GetTimeLevel (CCTK_POINTER_TO_CONST const cctkGH) + { + return timelevel; + } + // Enable or disable prolongating -- cgit v1.2.3