aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src
diff options
context:
space:
mode:
authorIan Hinder <ian@vaio.(none)>2008-01-30 22:54:06 -0500
committerIan Hinder <ian@vaio.(none)>2008-01-30 22:54:06 -0500
commit55ffa7ddef55c755f3fe01c6573c4231ed9ae083 (patch)
treee1a65512394ef884ac5cf1fb12fd2435a01c98bb /Auxiliary/Cactus/KrancNumericalTools/GenericFD/src
parentaba96b4c39f8fd0de310d54a5617b8217cf9a40c (diff)
Erik's tidy-ups
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src')
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c44
1 files changed, 18 insertions, 26 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c
index c402b22..4e6a9d5 100644
--- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c
+++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c
@@ -44,8 +44,8 @@
#include "GenericFD.h"
-/* TODO: provide functions for differencing, use FD macros to
- evaluate == use macros to evaluate corresponding functions */
+/* TODO: provide functions for differencing, use FD macros to evaluate
+ corresponding functions */
CCTK_INT sgn(CCTK_REAL x)
{
@@ -201,14 +201,8 @@ void GenericFD_LoopOverBoundary(cGH *cctkGH, Kranc_Calculation calc)
here_is_physbnd = 0;
- /* Start by looping over the whole grid, minus the NON-PHYSICAL
- boundary points, which are set by synchronization. */
for (d = 0; d < 3; d++)
{
- bmin[d] = is_physbnd[d*2+0] ? 0 : imin[d];
- bmax[d] = is_physbnd[d*2+1] ? cctk_lsh[d] : imax[d];
-
- /* Now restrict to only the boundary points on the current face */
switch(dir[d])
{
case -1:
@@ -217,7 +211,8 @@ void GenericFD_LoopOverBoundary(cGH *cctkGH, Kranc_Calculation calc)
here_is_physbnd = here_is_physbnd || is_physbnd[2*d+0];
break;
case 0:
- /* do nothing */
+ bmin[d] = imin[d];
+ bmax[d] = imax[d];
break;
case +1:
bmin[d] = imax[d];
@@ -228,28 +223,25 @@ void GenericFD_LoopOverBoundary(cGH *cctkGH, Kranc_Calculation calc)
/* Choose a basis */
normal[d] = dir[d];
- tangentA[d] = dir[d]; // FIXME
- tangentB[d] = dir[d]; // FIXME
- }
-
- /* Ensure the normal vector is normalized */
- CCTK_REAL normal_norm = 0;
- for (int i = 0; i < 3; i++)
- {
- normal_norm += pow(normal[i],2);
+ tangentA[d] = dir[(d+1)%3];
+ tangentB[d] = dir[(d+2)%3];
}
- normal_norm = sqrt(normal_norm);
- if (fabs(normal_norm) > 1e-10)
+ if (here_is_physbnd)
{
- for (int i = 0; i < 3; i++)
+#if 0
+ CCTK_REAL normal_norm = 0.0;
+ for (d = 0; d < 3; d++)
{
- normal[i] /= normal_norm;
+ normal_norm += pow(normal[d], 2);
}
- }
-
- if (here_is_physbnd)
- {
+ normal_norm = sqrt(normal_norm);
+ for (d = 0; d < 3; d++)
+ {
+ normal[d] /= normal_norm;
+ }
+#endif
+
calc(cctkGH, old_dir, old_face, normal, tangentA, tangentB, bmin, bmax, 0, NULL);
}