aboutsummaryrefslogtreecommitdiff
path: root/src/FlatBoundary.c
diff options
context:
space:
mode:
authorallen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4>2000-07-15 18:59:01 +0000
committerallen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4>2000-07-15 18:59:01 +0000
commitf248d9d88b79a4c7e4f66a89aca6222b70190e14 (patch)
tree199ffcd31362d0d1a080f93a78141f80cc230f07 /src/FlatBoundary.c
parent35e47f97ca82d39e84faa5568233ffeacc4389fc (diff)
Fixed bug in 1D scalar boundary condition
Apply boundary conditions to the right timelevels (!) Add fake symmetry structure so no longer need to compile Boundary with CartGrid3D. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@112 6a38eb6e-646e-4a02-a296-d141613ad6c4
Diffstat (limited to 'src/FlatBoundary.c')
-rw-r--r--src/FlatBoundary.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/FlatBoundary.c b/src/FlatBoundary.c
index 3b5b3f9..dab27f2 100644
--- a/src/FlatBoundary.c
+++ b/src/FlatBoundary.c
@@ -21,7 +21,7 @@
#include "cctk_Parameters.h"
#include "cctk_FortranString.h"
-#include "Boundary.h"
+#include "BoundarySymmetries.h"
#include "Symmetry.h"
@@ -245,6 +245,7 @@ int ApplyBndFlat(cGH *GH,
int idim;
int berr,ierr;
int *doBC, *dstag, *lssh;
+ int timelevel; /* timelevel that condition applied on */
SymmetryGHex *sGHex;
/* See if we have a symmetry array */
@@ -270,6 +271,11 @@ int ApplyBndFlat(cGH *GH,
gi = CCTK_GroupIndexFromVarI(first_var);
ierr = CCTK_GroupStaggerDirArrayGI(dstag, dim, gi);
+ /* get the current timelevel */
+ timelevel = CCTK_NumTimeLevelsFromVarI (first_var) - 1;
+ if (timelevel > 0)
+ timelevel--;
+
for (vi=first_var; vi<first_var+num_vars; vi++)
{
@@ -309,19 +315,19 @@ int ApplyBndFlat(cGH *GH,
doBC,
lssh,
stencil,
- GH->data[vi][0]); break;
+ GH->data[vi][timelevel]); break;
case 2: berr = BndApplyFlat2Di(GH,
dim,
doBC,
lssh,
stencil,
- GH->data[vi][0]); break;
+ GH->data[vi][timelevel]); break;
case 3: berr = BndApplyFlat3Di(GH,
dim,
doBC,
lssh,
stencil,
- GH->data[vi][0]); break;
+ GH->data[vi][timelevel]); break;
default : berr = -1; CCTK_WARN(1, "ApplyBndFlat: No BC for dim>3");
}
berr = (berr>-1) ? 0 : -1;