From 044228adbc961a8fc3ac42582a4009e2bbf25b15 Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 17 Jun 2003 14:39:59 +0000 Subject: Patch by Erik Schnetter to initialize new elements in the cGH structure: GH->cctk_timefac, GH->cctk_levoff[], GH->cctk_levoffdenom[]. These changes require an update of the flesh also. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@410 b61c5cb5-eaca-4651-9a7a-d64986f99364 --- src/GHExtension.c | 83 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/src/GHExtension.c b/src/GHExtension.c index 65f15ea..fe0fff3 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -2,9 +2,9 @@ @file GHExtension.c @date Thu Feb 4 10:47:14 1999 @author Tom Goodale - @desc + @desc Pugh GH extension stuff. - @enddesc + @enddesc @version $Id$ @@*/ @@ -38,9 +38,9 @@ static int (* PUGHCallFunc)(void *function, cFunctionData *fdata, void *data) = @routine PUGH_SetupGH @date Wed Feb 3 23:10:19 1999 @author Tom Goodale - @desc + @desc Sets up a new PUGH GH extension structure. - @enddesc + @enddesc @calls PUGH_GFSize PUGH_GFGhostsize PUGH_GFPeriodic @@ -70,8 +70,8 @@ static int (* PUGHCallFunc)(void *function, cFunctionData *fdata, void *data) = pointer to new PUGH GH extension, or NULL in case of errors. @endreturndesc @@*/ -void *PUGH_SetupGH (tFleshConfig *config, - int convergence_level, +void *PUGH_SetupGH (tFleshConfig *config, + int convergence_level, cGH *GH) { int i, group, maxdim; @@ -97,7 +97,7 @@ void *PUGH_SetupGH (tFleshConfig *config, PUGH_GFGhostsize (maxdim, ghostsize); PUGH_GFPeriodic (maxdim, perme); - newGH = PUGH_SetupPGH (GH, maxdim, nsize, ghostsize, + newGH = PUGH_SetupPGH (GH, maxdim, nsize, ghostsize, CCTK_StaggerVars() ? PUGH_STAGGER : PUGH_NO_STAGGER, perme); if (!newGH) @@ -117,7 +117,7 @@ void *PUGH_SetupGH (tFleshConfig *config, /* Set the global size of the variables in the group */ size = CCTK_GroupSizesI (group); - if (size) + if (size) { for (i = 0; i < pgroup.dim; i++) { @@ -136,7 +136,7 @@ void *PUGH_SetupGH (tFleshConfig *config, /* Set the ghostzone size of the variables in the group */ size = CCTK_GroupGhostsizesI (group); - if (size) + if (size) { for (i = 0; i < pgroup.dim; i++) { @@ -152,8 +152,8 @@ void *PUGH_SetupGH (tFleshConfig *config, groupghostsize = NULL; } - PUGH_SetupGroup (newGH, groupsize, groupghostsize, pgroup.grouptype, - pgroup.vartype, pgroup.dim, pgroup.numvars, + PUGH_SetupGroup (newGH, groupsize, groupghostsize, pgroup.grouptype, + pgroup.vartype, pgroup.dim, pgroup.numvars, pgroup.stagtype, pgroup.numtimelevels,pgroup.vectorgroup); } @@ -168,9 +168,9 @@ void *PUGH_SetupGH (tFleshConfig *config, @routine PUGH_InitGHBasics @date Thu May 11 2000 @author Thomas Radke - @desc + @desc Initializes the basic fields of a cGH structure. - @enddesc + @enddesc @var GH @vdesc pointer to CCTK grid hierarchy @vtype cGH * @@ -198,10 +198,13 @@ static void PUGH_InitGHBasics (cGH *GH) GH->identity = mypGH->identity_string; GH->cctk_convlevel = 0; + GH->cctk_timefac = 1; for (dim = 0; dim < GH->cctk_dim; dim++) { GH->cctk_levfac[dim] = 1; + GH->cctk_levoff[dim] = 0; + GH->cctk_levoffdenom[dim] = 1; GH->cctk_nghostzones[dim] = GFExtras->nghostzones[dim]; GH->cctk_lsh[dim] = GFExtras->lnsize[dim]; GH->cctk_gsh[dim] = GFExtras->nsize[dim]; @@ -209,8 +212,8 @@ static void PUGH_InitGHBasics (cGH *GH) GH->cctk_bbox[2*dim+1] = GFExtras->bbox[2*dim+1]; GH->cctk_lbnd[dim] = GFExtras->lb[mypGH->myproc][dim]; GH->cctk_ubnd[dim] = GFExtras->ub[mypGH->myproc][dim]; - - for (stagger = 0; stagger < CCTK_NSTAGGER; stagger++) + + for (stagger = 0; stagger < CCTK_NSTAGGER; stagger++) { GH->cctk_lssh[CCTK_LSSH_IDX (stagger, dim)] = GH->cctk_lsh[dim]; if (GH->cctk_bbox[2*dim + 1] == 1 && stagger > 0) @@ -226,9 +229,9 @@ static void PUGH_InitGHBasics (cGH *GH) @routine PUGH_InitGHVariables @date Thu May 11 2000 @author Thomas Radke - @desc + @desc Initializes the variables of a cGH structure. - @enddesc + @enddesc @calls CCTK_GroupTypeFromVarI CCTK_NumTimeLevelsFromVarI @var GH @@ -253,9 +256,9 @@ static void PUGH_InitGHVariables (cGH *GH) for (level = 0; level < ntimelevels; level++) { switch (gtype) - { + { case CCTK_SCALAR: - GH->data[var][level] = mypGH->variables[var][level]; + GH->data[var][level] = mypGH->variables[var][level]; break; case CCTK_GF: case CCTK_ARRAY: @@ -273,9 +276,9 @@ static void PUGH_InitGHVariables (cGH *GH) @routine PUGH_InitGH @date Wed Feb 3 23:10:19 1999 @author Tom Goodale - @desc + @desc Initialization routine for a given GH structure. - @enddesc + @enddesc @calls CCTK_NumGroups CCTK_GroupName CCTK_EnableGroupStorage @@ -302,7 +305,7 @@ int PUGH_InitGH (cGH *GH) if (enable_all_storage) { for (i = 0; i < CCTK_NumGroups (); i++) - { + { CCTK_EnableGroupStorage (GH, CCTK_GroupName (i)); } } @@ -315,19 +318,19 @@ int PUGH_InitGH (cGH *GH) @routine PUGH_ScheduleTraverseGH @date Thu Jan 27 15:14:09 2000 @author Tom Goodale - @desc + @desc Fills out the cGH and then calls schedule traverse. - @enddesc - @calls - @history + @enddesc + @calls + @history @hdate Thu Jan 27 15:15:35 2000 @hauthor Tom Goodale - @hdesc Was originally PUGH_rfrTraverse - @hdate Thu May 11 2000 + @hdesc Was originally PUGH_rfrTraverse + @hdate Thu May 11 2000 @hauthor Thomas Radke @hdesc Splitted pGH setup into PUGH_InitGHBasics() and PUGH_InitGHVariables() - @endhistory + @endhistory @var GH @vdesc pointer to CCTK grid hierarchy @@ -345,7 +348,7 @@ int PUGH_InitGH (cGH *GH) return code of @seeroutine CCTK_ScheduleTraverse @endreturndesc @@*/ -int PUGH_ScheduleTraverseGH (cGH *GH, +int PUGH_ScheduleTraverseGH (cGH *GH, const char *where) { int retval; @@ -373,11 +376,11 @@ void PUGH_RegisterCallFunc (int (* func) (void *function, @routine PUGH_GFSize @date Wed Feb 3 23:10:19 1999 @author Tom Goodale - @desc + @desc Gets the size of a grid function of a given dimension. FIXME: This cannot be made static' because it is used by thorn BAM_Elliptic. - @enddesc + @enddesc @var dim @vdesc dimension of the grid function @vtype int @@ -395,7 +398,7 @@ void PUGH_RegisterCallFunc (int (* func) (void *function, DECLARE_CCTK_PARAMETERS - if (global_nsize > 0 || local_nsize > 0) + if (global_nsize > 0 || local_nsize > 0) { size = global_nsize > 0 ? global_nsize : -local_nsize; for (dir = 0; dir < dim; dir++) @@ -419,11 +422,11 @@ void PUGH_RegisterCallFunc (int (* func) (void *function, @routine PUGH_GFGhostsize @date Wed Feb 3 23:10:19 1999 @author Tom Goodale - @desc + @desc Gets the ghostsize of a grid function of a given dimension. FIXME: This cannot be made static' because it is used by thorn BAM_Elliptic. - @enddesc + @enddesc @var dim @vdesc dimension of the grid function @vtype int @@ -465,11 +468,11 @@ void PUGH_RegisterCallFunc (int (* func) (void *function, @routine PUGH_GFPeriodic @date Wed Feb 3 23:10:19 1999 @author Tom Goodale - @desc + @desc Gets the periodic BC of a grid function of a given dimension. FIXME: This cannot be made static' because it is used by thorn BAM_Elliptic. - @enddesc + @enddesc @var dim @vdesc dimension of the grid function @vtype int @@ -498,7 +501,7 @@ void PUGH_RegisterCallFunc (int (* func) (void *function, else { memset (perme, 0, dim * sizeof (int)); - } + } } @@ -506,9 +509,9 @@ void PUGH_RegisterCallFunc (int (* func) (void *function, @routine PUGH_PrintTimingInfo @date Wed Feb 3 23:10:19 1999 @author Tom Goodale - @desc + @desc Prints the info from PUGH communication timers to stdout. - @enddesc + @enddesc @var GH @vdesc pointer to CCTK grid hierarchy @vtype cGH * -- cgit v1.2.3