aboutsummaryrefslogtreecommitdiff
path: root/src/SetupPGH.c
diff options
context:
space:
mode:
authorallen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364>2000-03-04 16:30:43 +0000
committerallen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364>2000-03-04 16:30:43 +0000
commit6dcbdff59a71b3619fdc135af6ba445506d412d2 (patch)
tree74564eb71b49176c16da3be3d745147d260487b9 /src/SetupPGH.c
parent264c9a81c81c68df922d46fe6a170b7741cd72ef (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
Diffstat (limited to 'src/SetupPGH.c')
-rw-r--r--src/SetupPGH.c31
1 files changed, 16 insertions, 15 deletions
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];
}
}