aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@6a38eb6e-646e-4a02-a296-d141613ad6c4>2004-03-05 20:01:55 +0000
committerschnetter <schnetter@6a38eb6e-646e-4a02-a296-d141613ad6c4>2004-03-05 20:01:55 +0000
commit2d90dd67274a04d005f5f19d0f9c6d17643fcb3b (patch)
tree50f0cf92a3a0e88921ff935109613abc899bf0b1
parent9d10828a82cfe21a95a95936e59592a84a93b08c (diff)
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
-rw-r--r--src/Boundary.c45
1 files changed, 45 insertions, 0 deletions
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 *************************
********************************************************************/