diff options
Diffstat (limited to 'src/Symmetry.c')
-rw-r--r-- | src/Symmetry.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/src/Symmetry.c b/src/Symmetry.c index c0a8132..386b578 100644 --- a/src/Symmetry.c +++ b/src/Symmetry.c @@ -14,7 +14,7 @@ @version $Id$ @@*/ -#include <assert.h> + #include <stdlib.h> #include "cctk.h" @@ -89,7 +89,8 @@ int CartSymGI (const cGH *GH, int gindex) if (numvars > 0 && first_vindex >= 0) { char * groupname = CCTK_GroupName (gindex); - assert (groupname); + if (!groupname) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error returned from function CCTK_GroupName"); CCTK_VWarn (3, __LINE__, __FILE__, CCTK_THORNSTRING, "You should not call the symmetry boundary condition routines for the group \"%s\" through the CartSym* routines any more. The symmetry boundary conditions are now applied automatically when a physical boundary condition is applied.", groupname); free (groupname); @@ -201,7 +202,8 @@ int CartSymVI (const cGH *GH, int vindex) if (gindex >= 0) { char * fullname = CCTK_FullName (vindex); - assert (fullname); + if (!fullname) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error returned from function CCTK_FullName"); CCTK_VWarn (3, __LINE__, __FILE__, CCTK_THORNSTRING, "You should not call the symmetry boundary condition routines for the variable \"%s\" through the CartSym* routines any more. The symmetry boundary conditions are now applied automatically when a physical boundary condition is applied.", fullname); free (fullname); @@ -695,33 +697,43 @@ void CartGrid3D_ApplyBC (CCTK_ARGUMENTS) int i; int ierr; - assert (cctkGH); + if (!cctkGH) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "cctkGH undeclared"); nvars = Boundary_SelectedGVs (cctkGH, 0, 0, 0, 0, 0, 0); - assert (nvars>=0); + if (nvars<0) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error returned from function Boundary_selectedGVs"); indices = malloc (nvars * sizeof *indices); - assert (nvars==0 || indices); + if(! (nvars==0 || indices)) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error in function CartGrid3D_ApplyBC"); faces = malloc (nvars * sizeof *faces); - assert (nvars==0 || faces); + if(! (nvars==0 || faces)) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error in function CartGrid3D_ApplyBC"); widths = malloc (nvars * sizeof *widths); - assert (nvars==0 || widths); + if(! (nvars==0 || widths)) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error in function CartGrid3D_ApplyBC"); tables = malloc (nvars * sizeof *tables); - assert (nvars==0 || tables); + if(! (nvars==0 || tables)) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error in function CartGrid3D_ApplyBC"); ierr = Boundary_SelectedGVs (cctkGH, nvars, indices, faces, widths, tables, 0); - assert (ierr == nvars); + if(! (ierr == nvars)) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error in function CartGrid3D_ApplyBC"); for (i=0; i<nvars; ++i) { vi = indices[i]; - assert (vi>=0 && vi<CCTK_NumVars()); + if(! (vi>=0 && vi<CCTK_NumVars())) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error in function CartGrid3D_ApplyBC"); gi = CCTK_GroupIndexFromVarI (vi); - assert (gi>=0); + if( (gi<0)) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error in function CartGrid3D_ApplyBC"); ierr = ApplySymmetry (cctkGH, gi, vi, 1); - assert (!ierr); + if(ierr) + CCTK_VWarn ( 0, __LINE__, __FILE__, "CartGrid3D", "error in function CartGrid3D_ApplyBC"); } free (indices); |