diff options
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools')
-rw-r--r-- | Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c | 19 | ||||
-rw-r--r-- | Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c index ba83b89..9084f65 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c @@ -503,3 +503,22 @@ void GenericFD_PenaltyPrim2Char(cGH const * restrict const cctkGH, int const dir return; } + +void GenericFD_AssertGroupStorage(cGH const * restrict const cctkGH, const char *calc, + int ngroups, const char *group_names[ngroups]) +{ + for (int i = 0; i < ngroups; i++) + { + int result = CCTK_QueryGroupStorage(cctkGH, group_names[i]); + if (result == 0) + { + CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, + "Error in %s: Group \"%s\" does not have storage", calc, group_names[i]); + } + else if (result < 0) + { + CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING, + "Error in %s: Invalid group name \"%s\"", calc, group_names[i]); + } + } +} diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h index 7d8a13d..d9ead13 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h @@ -708,6 +708,9 @@ void GenericFD_GetBoundaryInfo(cGH const * restrict cctkGH, int * restrict is_physbnd, int * restrict is_ipbnd); +void GenericFD_AssertGroupStorage(cGH const * restrict const cctkGH, const char *calc, + int ngroups, const char *group_names[]); + #if 0 /* Finite differencing near boundaries */ |