From f67c660b384ba5c6c38dead85c7544fab05476ba Mon Sep 17 00:00:00 2001 From: knarf Date: Tue, 29 Sep 2009 14:40:35 +0000 Subject: 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 --- src/StaticBoundary.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.2.3