aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364>2004-06-10 15:53:40 +0000
committertradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364>2004-06-10 15:53:40 +0000
commit1a48e6db2432c1b86f836f2b8695ccff09ad6a90 (patch)
tree75677b8934ca79999c6d38bd74f0f1ff5d032708
parent58f0716f87960c507a9cefbe901c1f584ddd7cb2 (diff)
Initialize new current timelevel after timelevel rotation according to
PUGH::intitialize_memory. This closes PR CactusPUGH/1312: "PUGH should initialise memory also after time level cycling". git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@444 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r--src/Evolve.c65
1 files changed, 20 insertions, 45 deletions
diff --git a/src/Evolve.c b/src/Evolve.c
index 765b47d..d0cd633 100644
--- a/src/Evolve.c
+++ b/src/Evolve.c
@@ -53,8 +53,8 @@ CCTK_FILEVERSION(CactusPUGH_PUGH_Evolve_c);
/* Local function prototypes. */
static int DoneMainLoop (const cGH *GH, CCTK_REAL cctk_time, int iteration);
-static int StepGH(cGH *GH);
-static void RotateTimeLevelsGH(cGH *cgh);
+static void StepGH(cGH *GH);
+static void RotateTimeLevelsGH(const cGH *GH);
/*@@
@@ -64,8 +64,6 @@ static void RotateTimeLevelsGH(cGH *cgh);
@desc
PUGH's evolution routine.
@enddesc
- @calls
- @calledby
@history
@hdate Tue Mar 28 22:42:47 2000 @hauthor Ed Evans
@hdesc Copied from CactusDefaultEvolve and added rotation
@@ -74,7 +72,6 @@ static void RotateTimeLevelsGH(cGH *cgh);
@hdate Fri May 12 2000 @hauthor Thomas Radke
@hdesc Moved evolution loop termination check into DoneMainLoop()
@endhistory
-
@@*/
int PUGH_Evolve(tFleshConfig *config)
{
@@ -86,35 +83,25 @@ int PUGH_Evolve(tFleshConfig *config)
/*** a Traverse with CCTK_ANALYSIS ***/
ForallConvLevels(iteration, convergence_level)
{
- CCTK_Traverse(config->GH[convergence_level], "CCTK_ANALYSIS");
- CCTK_OutputGH(config->GH[convergence_level]);
+ CCTK_Traverse(config->GH[convergence_level], "CCTK_ANALYSIS");
+ CCTK_OutputGH(config->GH[convergence_level]);
}
EndForallConvLevels;
while (! DoneMainLoop (config->GH[0],config->GH[0]->cctk_time, iteration))
{
-
ForallConvLevels(iteration, convergence_level)
{
-
RotateTimeLevelsGH(config->GH[convergence_level]);
- /*
- CCTK_InfoOutput(config->GH[convergence_level], convergence_level);
- */
}
EndForallConvLevels;
iteration = CCTK_SetMainLoopIndex(++iteration);
/* Step each convergence level */
-
ForallConvLevels(iteration, convergence_level)
{
-
StepGH(config->GH[convergence_level]);
- /*
- CCTK_InfoOutput(config->GH[convergence_level], convergence_level);
- */
}
EndForallConvLevels;
@@ -132,8 +119,8 @@ int PUGH_Evolve(tFleshConfig *config)
/*** a Traverse with CCTK_ANALYSIS ***/
ForallConvLevels(iteration, convergence_level)
{
- CCTK_Traverse(config->GH[convergence_level], "CCTK_ANALYSIS");
- CCTK_OutputGH(config->GH[convergence_level]);
+ CCTK_Traverse(config->GH[convergence_level], "CCTK_ANALYSIS");
+ CCTK_OutputGH(config->GH[convergence_level]);
}
EndForallConvLevels;
@@ -284,10 +271,8 @@ static int DoneMainLoop (const cGH *GH, CCTK_REAL simulation_time,int iteration)
routines for each schedule point.
@enddesc
@calls CCTK_Traverse
- @calledby main
@@*/
-
-static int StepGH(cGH *GH)
+static void StepGH(cGH *GH)
{
/* Advance GH->iteration BEFORE evolving */
@@ -297,8 +282,6 @@ static int StepGH(cGH *GH)
CCTK_Traverse(GH, "CCTK_PRESTEP");
CCTK_Traverse(GH, "CCTK_EVOL");
CCTK_Traverse(GH, "CCTK_POSTSTEP");
-
- return 0;
}
@@ -309,41 +292,33 @@ static int StepGH(cGH *GH)
@desc
Rotates the time levels
@enddesc
- @calls
- @calledby
- @history
-
- @endhistory
-
@@*/
-static void RotateTimeLevelsGH(cGH *cgh)
+static void RotateTimeLevelsGH(const cGH *GH)
{
- int var;
- int numtimelevels;
- int i;
- void *temp;
+ int i, var, numtimelevels;
+ pGA *GA;
pGH *pughGH;
+ DECLARE_CCTK_PARAMETERS
+
- pughGH = PUGH_pGH(cgh);
+ pughGH = PUGH_pGH(GH);
for(var = 0; var < pughGH->nvariables; var++)
{
/* Only Rotate the number of timelevels actually enabled. */
numtimelevels = PUGH_NumTimeLevels(pughGH,var);
-
- if(numtimelevels>1)
+ if(numtimelevels > 1)
{
- temp=pughGH->variables[var][numtimelevels-1];
+ GA = pughGH->variables[var][numtimelevels-1];
- for(i = numtimelevels-1; i>0; i--)
+ for(i = numtimelevels-1; i; i--)
{
- pughGH->variables[var][i]=pughGH->variables[var][i-1];
+ pughGH->variables[var][i] = pughGH->variables[var][i-1];
}
- pughGH->variables[var][0]=temp;
+ pughGH->variables[var][0] = GA;
+ PUGH_InitializeMemory (initialize_memory, GA->vtype,
+ GA->extras->npoints * GA->varsize, GA->data);
}
}
-
- return;
}
-