diff options
author | allen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-03-04 16:30:43 +0000 |
---|---|---|
committer | allen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-03-04 16:30:43 +0000 |
commit | 6dcbdff59a71b3619fdc135af6ba445506d412d2 (patch) | |
tree | 74564eb71b49176c16da3be3d745147d260487b9 | |
parent | 264c9a81c81c68df922d46fe6a170b7741cd72ef (diff) |
Adding periodic option back to PUGH. This is still to be tested.
Periodic boundary conditions are applied during a SyncGroup, at the
moment only for multiprocessors (single processor will be added to SyncGroup when multiprocessor is working properly).
The parameter is
driver::periodic = "yes"
When this is tested, periodic boundary conditions in different directions
will be added.
IOAscii isn't working properly with periodic boundary conditions, this
will be fixed soon. (You get two extra nonsense points on each line,
if the ghostzone size is 1).
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@168 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r-- | src/GHExtension.c | 6 | ||||
-rw-r--r-- | src/SetupPGH.c | 31 | ||||
-rw-r--r-- | src/include/pugh.h | 3 |
3 files changed, 21 insertions, 19 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c index 393deae..5810014 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -15,7 +15,6 @@ #include "cctk.h" #include "cctk_Schedule.h" -#include "cctk_Stagger.h" #include "cctk_Parameters.h" #include "pugh.h" @@ -69,7 +68,8 @@ void *pugh_SetupGH(tFleshConfig *config, dim, nsize, ghostsize, - CCTK_StaggerVars() ? PUGH_STAGGER : PUGH_NO_STAGGER); + CCTK_StaggerVars() ? PUGH_STAGGER : PUGH_NO_STAGGER, + periodic); if (!newGH) { CCTK_WARN(0,"Failed to allocate memory for a pGH"); @@ -245,7 +245,7 @@ int pugh_ScheduleTraverseGH(cGH *GH, for(level = 0; level < ntimelevels; level++) { switch(gtype) - { + { case CCTK_SCALAR : GH->data[var][level] = mypGH->variables[var][level]; break; diff --git a/src/SetupPGH.c b/src/SetupPGH.c index 12c8188..eb45522 100644 --- a/src/SetupPGH.c +++ b/src/SetupPGH.c @@ -49,7 +49,8 @@ pGH *PUGH_SetupPGH(void *callerid, int dim, int *nsize, int *nghostzones, - int staggertype) + int staggertype, + int periodic) { pGH *GH; int idim; @@ -94,7 +95,6 @@ pGH *PUGH_SetupPGH(void *callerid, /* Set up connectivity and extras for each dimension */ for (idim=1;idim<=dim;idim++) { - int periodic=0; int *nprocs; nprocs = (int *) malloc(idim*sizeof(int)); @@ -243,15 +243,14 @@ void pGH_SetupBasics(pGH *GH, /* set staggering flag */ GH->stagger = staggertype; - /* - if (Contains("bound","periodic")) { + if (periodic) + { GH->periodic = 1; - } else { + } + else + { GH->periodic = 0; } - */ - - GH->periodic = 0; /* Variable list */ GH->nvariables = 0; @@ -380,11 +379,11 @@ break; */ for (idir=0;idir<dim;idir++) { - GH->ownership[PUGH_VERTEXCTR][0][idir] = (GH->lb[GH->myproc][idir] == 0 ? - 0 : GH->nghostzones[idir]); - GH->ownership[PUGH_VERTEXCTR][1][idir]=(GH->ub[GH->myproc][idir] == GH->nsize[idir]-1 ? - GH->lnsize[idir] : GH->lnsize[idir] - - GH->nghostzones[idir]); + GH->ownership[PUGH_VERTEXCTR][0][idir] = + (GH->lb[GH->myproc][idir] == 0 ? 0 : GH->nghostzones[idir]); + GH->ownership[PUGH_VERTEXCTR][1][idir] = + (GH->ub[GH->myproc][idir] == GH->nsize[idir]-1 ? + GH->lnsize[idir] : GH->lnsize[idir] - GH->nghostzones[idir]); } /* correct for periodic identification : Tue Jun 17 08:40:15 CDT 1997 */ @@ -392,8 +391,10 @@ break; { for (idir=0;idir<dim;idir++) { - GH->ownership[PUGH_VERTEXCTR][0][idir] = GH->nghostzones[idir]; - GH->ownership[PUGH_VERTEXCTR][1][idir] = GH->lnsize[idir] - GH->nghostzones[idir]; + GH->ownership[PUGH_VERTEXCTR][0][idir] + = GH->nghostzones[idir]; + GH->ownership[PUGH_VERTEXCTR][1][idir] + = GH->lnsize[idir] - GH->nghostzones[idir]; } } diff --git a/src/include/pugh.h b/src/include/pugh.h index 26d27ae..6a41e02 100644 --- a/src/include/pugh.h +++ b/src/include/pugh.h @@ -108,7 +108,8 @@ pGH *PUGH_SetupPGH(void *callerid, int dim, int *nsize, int *nghostzones, - int staggertype); + int staggertype, + int periodic); int pugh_GFSize(int dim, int *nsize); |