OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

USERD_set_time_set_and_step.H

Go to the documentation of this file.
00001 //======================================================================
00002 void USERD_set_time_set_and_step
00003 (
00004     int timeset_number,
00005     int time_step
00006 )
00007 {
00008 #ifdef ENSIGHTDEBUG
00009     Info << "Entering: USERD_set_time_set_and_step" << endl << flush;
00010 #endif
00011     // update the global pointers and variables
00012     // to the current time-step
00013 
00014     // at exit time_step < 0
00015     if (time_step >= 0)
00016     {
00017         Time& runTime = *runTimePtr;
00018         Current_time_step = time_step;
00019         // add 1, since the first timestep is 'constant'
00020 
00021         if (time_step == 0)
00022         {
00023             runTime.setTime
00024             (
00025                 timeDirs[Current_time_step],
00026                 Current_time_step
00027             );
00028         }
00029         else
00030         {
00031             runTime.setTime
00032             (
00033                 timeDirs[Current_time_step + 1],
00034                 Current_time_step + 1
00035             );
00036         }
00037 
00038         meshPtr->readUpdate();
00039 
00040         if (time_step == 0)
00041         {
00042             runTime.setTime
00043             (
00044                 timeDirs[Current_time_step + 1],
00045                 Current_time_step + 1
00046             );
00047         }
00048 
00049         if (Numparts_available > nPatches+1)
00050         {
00051             delete sprayPtr;
00052             sprayPtr = new Cloud<passiveParticle>(*meshPtr);
00053         }
00054     }
00055 }
00056 
00057 
Copyright © 2000-2009 OpenCFD Ltd