aboutsummaryrefslogtreecommitdiff
path: root/src/RobinBoundary.c
diff options
context:
space:
mode:
authorrhaas <rhaas@6a38eb6e-646e-4a02-a296-d141613ad6c4>2013-12-23 02:28:21 +0000
committerrhaas <rhaas@6a38eb6e-646e-4a02-a296-d141613ad6c4>2013-12-23 02:28:21 +0000
commitc1bb3b4f29eee773e3f42a5076905e37670594f9 (patch)
tree13b7d58b4f92469e0a4f5fc336dc736bef5e39af /src/RobinBoundary.c
parent5f455f13379cc2998d18081375f24cf862330ad6 (diff)
abort if boundary width is very large, which is most likely an error
Currently if a user schedules the routine calling Boundary_RegisterGroupForBC in LEVEL mode (which is the correct mode), cctk_nghostzones is undefined and Carpet fills it with the deadbeef value (666). Passing 666 to Boundary_RegisterGroupForBC leads to silently incorrect results as it often prevents the BC from being applied at all (there is a check in many boundary routines that returns if the domain is too small, presumably to support 1 point wide 1d domains). This patch checks the boundary width requested and aborts if the width is larger than 100. This is the same threshold that the symmetry thorns already use to abort a run. This prevents a user error (seen it twice so far) and should not as far as I can tell affect any correct code (unless we ever actually encounter a boundary wider than 100 points in which case we are in trouble anyway). This patch resulted from ticket #1508 "abort if boundary widht is very wide (>100 points)" git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@321 6a38eb6e-646e-4a02-a296-d141613ad6c4
Diffstat (limited to 'src/RobinBoundary.c')
-rw-r--r--src/RobinBoundary.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/RobinBoundary.c b/src/RobinBoundary.c
index 46c08d5..3ca194d 100644
--- a/src/RobinBoundary.c
+++ b/src/RobinBoundary.c
@@ -914,6 +914,9 @@ static int ApplyBndRobin (const cGH *GH,
}
}
+ /* sanity check on width of boundary, */
+ BndSanityCheckWidths(GH, first_var, gdim, in_widths, "Robin");
+
/* Robin boundaries need the underlying grid coordinates */
sprintf (coord_system_name, "cart%dd", gdim);
if (CCTK_CoordSystemHandle (coord_system_name) < 0)