Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

timestep.c File Reference

routines for 'kicking' particles in momentum space and assigning new timesteps More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <mpi.h>
#include "allvars.h"
#include "proto.h"

Go to the source code of this file.

Functions

void advance_and_find_timesteps (void)
int get_timestep (int p, double *aphys, int flag)
void find_dt_displacement_constraint (double hfac)


Detailed Description

routines for 'kicking' particles in momentum space and assigning new timesteps

Definition in file timestep.c.


Function Documentation

void advance_and_find_timesteps void   ) 
 

This function advances the system in momentum space, i.e. it does apply the 'kick' operation after the forces have been computed. Additionally, it assigns new timesteps to particles. At start-up, a half-timestep is carried out, as well as at the end of the simulation. In between, the half-step kick that ends the previous timestep and the half-step kick for the new timestep are combined into one operation.

< adiabatic index of simulated gas

< adiabatic index of simulated gas

< The simulated timespan is mapped onto the integer interval [0,TIMESPAN], where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29

< The simulated timespan is mapped onto the integer interval [0,TIMESPAN], where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29

< The simulated timespan is mapped onto the integer interval [0,TIMESPAN], where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29

< The simulated timespan is mapped onto the integer interval [0,TIMESPAN], where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29

< adiabatic index of simulated gas

< adiabatic index of simulated gas

< The simulated timespan is mapped onto the integer interval [0,TIMESPAN], where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29

< The simulated timespan is mapped onto the integer interval [0,TIMESPAN], where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29

< The simulated timespan is mapped onto the integer interval [0,TIMESPAN], where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29

Definition at line 24 of file timestep.c.

References All, global_data_all_processes::ComovingIntegrationOn, global_data_all_processes::CPU_TimeLine, NODE::d, sph_particle_data::DtEntropy, sph_particle_data::Entropy, Extnodes, NODE::father, Father, find_dt_displacement_constraint(), Flag_FullStep, FLOAT, global_data_all_processes::G, GAMMA, GAMMA_MINUS1, get_gravkick_factor(), get_hydrokick_factor(), get_random_number(), get_timestep(), particle_data::GravAccel, particle_data::GravPM, global_data_all_processes::Hubble, sph_particle_data::HydroAccel, NODE::mass, particle_data::Mass, global_data_all_processes::MinEgySpec, Nodes, global_data_all_processes::NumForcesSinceLastDomainDecomp, global_data_all_processes::Omega0, global_data_all_processes::OmegaLambda, P, global_data_all_processes::PM_Ti_begstep, global_data_all_processes::PM_Ti_endstep, particle_data::Pos, pow(), second(), SphP, ThisTask, particle_data::Ti_begstep, global_data_all_processes::Ti_Current, particle_data::Ti_endstep, global_data_all_processes::Time, TIMEBASE, global_data_all_processes::Timebase_interval, timediff(), global_data_all_processes::TotNumPart, global_data_all_processes::TreeDomainUpdateFrequency, particle_data::Type, NODE::u, particle_data::Vel, sph_particle_data::VelPred, and extNODE::vs.

Referenced by run().

void find_dt_displacement_constraint double  hfac  ) 
 

This function computes an upper limit ('dt_displacement') to the global timestep of the system based on the rms velocities of particles. For cosmological simulations, the criterion used is that the rms displacement should be at most a fraction MaxRMSDisplacementFac of the mean particle separation. Note that the latter is estimated using the assigned particle masses, separately for each particle type. If comoving integration is not used, the function imposes no constraint on the timestep.

Parameters:
hfac  should be a^2*H(a)

Definition at line 559 of file timestep.c.

Referenced by advance_and_find_timesteps().

int get_timestep int  p,
double *  aphys,
int  flag
 

This function normally (for flag==0) returns the maximum allowed timestep of a particle, expressed in terms of the integer mapping that is used to represent the total simulated timespan. The physical acceleration is returned in `aphys'. The latter is used in conjunction with the PSEUDOSYMMETRIC integration option, which also makes of the second function of get_timestep. When it is called with a finite timestep for flag, it returns the physical acceleration that would lead to this timestep, assuming timestep criterion 0.

< adiabatic index of simulated gas

< The simulated timespan is mapped onto the integer interval [0,TIMESPAN], where TIMESPAN needs to be a power of 2. Note that (1<<28) corresponds to 2^29

Parameters:
p  particle index
aphys  acceleration (physical units)
flag  either 0 for normal operation, or finite timestep to get corresponding aphys

Definition at line 414 of file timestep.c.

References particle_data::GravAccel, particle_data::GravPM, sph_particle_data::HydroAccel, P, SphP, and particle_data::Type.

Referenced by advance_and_find_timesteps().


Generated on Sun May 22 17:33:30 2005 for GADGET-2 by  doxygen 1.3.9.1