diff options
author | knarf <knarf@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2009-09-29 14:40:35 +0000 |
---|---|---|
committer | knarf <knarf@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2009-09-29 14:40:35 +0000 |
commit | f67c660b384ba5c6c38dead85c7544fab05476ba (patch) | |
tree | 4368c6108b6f60095623602ebe3bd8d323b17be4 | |
parent | 1b3434a6f7668ec0e2aa1053c0da19f9adcafdb3 (diff) |
This patch checks the available timelevels for a variable before it
attempts a memcpy.
In the case of failure, this changes a segfault to an informative
message, which makes debugging this case much easier.
In case of success, it adds a test every time the static boundary
condition is called, for each variable.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@297 6a38eb6e-646e-4a02-a296-d141613ad6c4
-rw-r--r-- | src/StaticBoundary.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/StaticBoundary.c b/src/StaticBoundary.c index fdd11ac..3c0f840 100644 --- a/src/StaticBoundary.c +++ b/src/StaticBoundary.c @@ -1018,6 +1018,13 @@ static int ApplyBndStatic (const cGH *GH, var < first_var + num_vars; var++) { + if (CCTK_ActiveTimeLevelsVI(GH, var) < 2) + { + CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, + "Static Boundary condition needs at least two timelevels " + "active, but %s only has %d.", + CCTK_FullName(var), CCTK_ActiveTimeLevelsVI(GH, var)); + } /* Apply condition if: + boundary is an outer boundary + have enough grid points |