From 2d90dd67274a04d005f5f19d0f9c6d17643fcb3b Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 5 Mar 2004 20:01:55 +0000 Subject: Add a routine "Boundary_MakeSureThatTheSelectionIsEmpty" that is unused. It can be called for debugging, and is then very helpful. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@263 6a38eb6e-646e-4a02-a296-d141613ad6c4 --- src/Boundary.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/Boundary.c b/src/Boundary.c index 9eaaf05..efe8f51 100644 --- a/src/Boundary.c +++ b/src/Boundary.c @@ -1155,6 +1155,51 @@ void Boundary_ClearSelection(void) memset(selected_faces, 0, num_cctk_vars*sizeof(CCTK_INT)); } + /*@@ + @routine Boundary_MakeSureThatTheSelectionIsEmpty + @date Mon Jul 7 21:51:37 CET 2003 + @author Erik Schnetter + @desc + Abort if the selections is not empty. + This routine is currently unused, but is very + helpful for debugging. + @enddesc + @calls + @history + @endhistory +@@*/ + +void Boundary_MakeSureThatTheSelectionIsEmpty(void) +{ + struct BCDATA *current_bcdata; + struct BCVAR *current; + int is_empty; + + is_empty = 1; + for (current_bcdata = bcdata_list; current_bcdata; + current_bcdata = current_bcdata->next) + { + for (current = current_bcdata->var_list; current; + current = current->next) + { + char * fullname = CCTK_FullName (current->var); + if (is_empty) + { + is_empty = 0; + printf ("The following boundary conditions are currently selected for the following variables:\n"); + } + printf ("Boundary condition %s for variable %s\n", + current_bcdata->bc_name, fullname); + free (fullname); + } + } + + if (! is_empty) + { + CCTK_WARN (0, "Someone thinks that the boundary selection list should be empty at this point. Alas, it is not; I better abort."); + } +} + /******************************************************************** ********************* Local Routines ************************* ********************************************************************/ -- cgit v1.2.3