diff options
author | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2012-10-26 14:23:31 +0000 |
---|---|---|
committer | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2012-10-26 14:23:31 +0000 |
commit | e91cde0953119fa01d92174413643e889adbb98e (patch) | |
tree | 484912fa90f1a1e3262e03d154a9ffb938f3f14f /src/main | |
parent | 80f043ecb43335a3c1862b8a6ffde4332703f069 (diff) |
Use CCTKi_VarDataPtrI in CCTK_DECLARE_ARGUMENTS
Introduce new function CCTKi_VarDataPtrI which does not emit warnings.
Use it when defining CCTK_DECLARE_ARGUMENTS.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4898 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/GroupsOnGH.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/main/GroupsOnGH.c b/src/main/GroupsOnGH.c index 55a4f5da..d3b02935 100644 --- a/src/main/GroupsOnGH.c +++ b/src/main/GroupsOnGH.c @@ -21,6 +21,8 @@ #include "cctk_Misc.h" #include "cctk_WarnLevel.h" +#include "cctki_GroupsOnGH.h" + static const char *rcsid = "$Header$"; CCTK_FILEVERSION(main_GroupsOnGH_c); @@ -369,11 +371,52 @@ void CCTK_FCALL CCTK_FNAME(CCTK_VarDataPtrI) } /*@@ + @routine CCTKi_VarDataPtrI + @date 2012-10-26 + @author Erik Schnetter + @desc + Passes back a variable data pointer, given a variable index and timelevel. + This function does not output any warnings. + @enddesc + + @var GH + @vdesc Pointer to Grid Hierachy + @vtype const cGH * + @vio in + @endvar + + @var vindex + @vdesc Index of grid variable + @vtype int + @vio in + @endvar + + @var timelevel + @vdesc Index of timelevel on which data is required + @vtype int + @vio in + @endvar + + @returntype void * + @returndesc Pointer to the required data, should be cast to required type + @endreturndesc +@@*/ +void *CCTKi_VarDataPtrI(const cGH *GH, int timelevel, int vindex) +{ + int numtimelevels = CCTK_MaxTimeLevelsVI (vindex); + if (timelevel < 0 || timelevel >= numtimelevels) + { + return NULL; + } + return GH->data[vindex][timelevel]; +} + + /*@@ @routine CCTK_VarDataPtrB @date Tue 6th April 1999 @author Gabrielle Allen @desc - Passes back a variable data pointer, given either a variable index + Passes back a variable data pointer, given either a variable index or a full name and timelevel @enddesc |