aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@20f44201-0f4f-0410-9130-e5fc2714a787>2013-08-21 17:34:35 +0000
committereschnett <eschnett@20f44201-0f4f-0410-9130-e5fc2714a787>2013-08-21 17:34:35 +0000
commit57b2ac8285205039c68899385f4216fbe0372bc4 (patch)
treec51bc28c895286f5c18be96eb2b29026ebf5ee0f
parent7a8419228fa87c1b858ba74a9f6b6cda6e121cd9 (diff)
Some code cleanupsHEADmaster
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@89 20f44201-0f4f-0410-9130-e5fc2714a787
-rw-r--r--src/rotatingsymmetry180.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c
index b0f1497..d0a593a 100644
--- a/src/rotatingsymmetry180.c
+++ b/src/rotatingsymmetry180.c
@@ -153,10 +153,9 @@ int BndRot180VI (cGH const * restrict const cctkGH,
} else if (ierr<0) {
char * groupname = CCTK_GroupName(gis[var]);
assert (groupname);
- CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ CCTK_VError(__LINE__, __FILE__, CCTK_THORNSTRING,
"Error in tensor type alias declaration for group \"%s\"",
groupname);
- free (groupname);
}
if (CCTK_EQUALS (tensortypealias, "scalar")) {
@@ -188,7 +187,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
case 3: break;
case 4: paritiess[var][1] = paritiess[var][2] = -1; break;
case 5: break;
- default: assert(0);
+ default: CCTK_BUILTIN_UNREACHABLE();
}
} else if (CCTK_EQUALS (tensortypealias, "uu")
|| CCTK_EQUALS (tensortypealias, "ud")
@@ -210,7 +209,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
case 3: break;
case 4: paritiess[var][1] = paritiess[var][2] = -1; break;
case 5: break;
- default: assert(0);
+ default: CCTK_BUILTIN_UNREACHABLE();
}
paritiess[var][index/6] *= -1;
} else if (CCTK_EQUALS (tensortypealias, "4uu_sym")
@@ -230,7 +229,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
case 3: break;
case 4: paritiess[var][1] = paritiess[var][2] = -1; break;
case 5: break;
- default: assert(0);
+ default: CCTK_BUILTIN_UNREACHABLE();
}
}
} else if (CCTK_EQUALS (tensortypealias, "weylscalars_real")) {
@@ -256,10 +255,9 @@ int BndRot180VI (cGH const * restrict const cctkGH,
} else {
char * groupname = CCTK_GroupName(gis[var]);
assert (groupname);
- CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ CCTK_VError(__LINE__, __FILE__, CCTK_THORNSTRING,
"Illegal tensor type alias for group \"%s\"",
groupname);
- free (groupname);
}
assert (abs(paritiess[var][0])==1 && abs(paritiess[var][1])==1
@@ -316,7 +314,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
} else if (fabs(dorigin[d] - 0.5) < 1.0e-6) {
avoid_origin[d] = 1;
} else {
- CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ CCTK_VError(__LINE__, __FILE__, CCTK_THORNSTRING,
"The coordinate origin in the %c-direction falls neither onto a grid point nor into the middle between two grid points.",
"xyz"[d]);
}
@@ -333,7 +331,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
if (global_bbox[2*dir]) {
if (2*iorigin[otherdir] + offset[otherdir] != cctk_gsh[otherdir]) {
- CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ CCTK_VError(__LINE__, __FILE__, CCTK_THORNSTRING,
"The coordinate origin in the %c-direction is not in the centre of the domain. The boundary condition cannot be applied.",
"xyz"[otherdir]);
}
@@ -341,7 +339,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
if (iorigin[dir] != data.nghostzones[dir]) {
assert (nvars > 0);
var = 0;
- CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ CCTK_VError(__LINE__, __FILE__, CCTK_THORNSTRING,
"The group \"%s\" has in the %c-direction %d symmetry points (grid points outside of the symmetry boundary). "
"This is not equal to the number of ghost zones, which is %d. "
"The number of symmetry points must be equal to the number of ghost zones.",
@@ -352,7 +350,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
if (data.gsh[dir] < 2*data.nghostzones[dir] + offset[dir]) {
assert (nvars > 0);
var = 0;
- CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ CCTK_VError(__LINE__, __FILE__, CCTK_THORNSTRING,
"The group \"%s\" has in the %c-direction only %d grid points. "
"This is not large enough for a 180 degree rotating symmetry boundary that is %d grid points wide. "
"The group needs to have at least %d grid points in that direction.",
@@ -396,7 +394,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
/* do nothing */
break;
default:
- assert (0);
+ CCTK_BUILTIN_UNREACHABLE();
} /* switch grouptype */
} /* if bbox */
} /* if poison_boundaries */
@@ -446,8 +444,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
if (CCTK_IsFunctionAliased("GetLocalComponents")) {
int const num_local_components = GetLocalComponents(cctkGH);
if (num_local_components > 1) {
- CCTK_WARN (CCTK_WARN_ABORT,
- "TAT/Slab can only be used if there is a single local component per MPI process");
+ CCTK_ERROR("TAT/Slab can only be used if there is a single local component per MPI process");
}
}
@@ -543,7 +540,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
assert (!ierr);
} else {
- CCTK_WARN (CCTK_WARN_ABORT, "internal error");
+ CCTK_BUILTIN_UNREACHABLE();
}
if (check_boundaries) {
@@ -603,10 +600,10 @@ int BndRot180VI (cGH const * restrict const cctkGH,
printf (" gsh=[%d,%d,%d]\n", cctk_gsh[0], cctk_gsh[1], cctk_gsh[2]);
printf (" bbox=[%d,%d,%d,%d,%d,%d]\n", cctk_bbox[0], cctk_bbox[1], cctk_bbox[2], cctk_bbox[3], cctk_bbox[4], cctk_bbox[5]);
if (poison_found) {
- CCTK_WARN (CCTK_WARN_ABORT, "Poison found in symmetry regions -- there is an error in this thorn");
+ CCTK_ERROR("Poison found in symmetry regions -- there is an error in this thorn");
}
if (nonfinite_found) {
- CCTK_WARN (CCTK_WARN_ALERT, "Non-finite number found in symmetry regions");
+ CCTK_WARN(CCTK_WARN_ALERT, "Non-finite number found in symmetry regions");
}
}
break;
@@ -615,7 +612,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
/* do nothing */
break;
default:
- assert (0);
+ CCTK_BUILTIN_UNREACHABLE();
} /* switch grouptype */
} /* if bbox */
} /* if check_boundaries */
@@ -679,7 +676,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
break;
}
default:
- assert (0);
+ CCTK_BUILTIN_UNREACHABLE();
} /* switch grouptype */
}
} /* for var */
@@ -719,9 +716,9 @@ void Rot180_ComputeLevelExtent (CCTK_ARGUMENTS)
int ierr;
CCTK_REAL local[6], global[6];
min_handle = CCTK_ReductionArrayHandle ("minimum");
- if (min_handle<0) CCTK_WARN (0, "Could not obtain reduction handle");
+ if (min_handle<0) CCTK_ERROR("Could not obtain reduction handle");
max_handle = CCTK_ReductionArrayHandle ("maximum");
- if (max_handle<0) CCTK_WARN (0, "Could not obtain reduction handle");
+ if (max_handle<0) CCTK_ERROR("Could not obtain reduction handle");
for (d=0; d<6; ++d) local[d] = cctkGH->cctk_bbox[d];
ierr = CCTK_ReduceLocArrayToArray1D
@@ -743,7 +740,7 @@ void Rot180_ComputeLevelExtent (CCTK_ARGUMENTS)
int ierr;
CCTK_INT local[12], global[12];
max_handle = CCTK_ReductionArrayHandle ("maximum");
- if (max_handle<0) CCTK_WARN (0, "Could not obtain reduction handle");
+ if (max_handle<0) CCTK_ERROR("Could not obtain reduction handle");
for (d=0; d<6; ++d) local[ d] = cctkGH->cctk_bbox[d];
for (d=0; d<3; ++d) local[6+d] = -cctkGH->cctk_lbnd[d];