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

init.c File Reference

Code for initialisation of a simulation from initial conditions. More...

#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.


void init (void)
void check_omega (void)
void setup_smoothinglengths (void)

Detailed Description

Code for initialisation of a simulation from initial conditions.

Definition in file init.c.

Function Documentation

void check_omega void   ) 

This routine computes the mass content of the box and compares it to the specified value of Omega-matter. If discrepant, the run is terminated.

Definition at line 160 of file init.c.

References All, P, and ThisTask.

Referenced by init().

void init void   ) 

This function reads the initial conditions, and allocates storage for the tree. Various variables of the particle data are initialised and An intial domain decomposition is performed. If SPH particles are present, the inial SPH smoothing lengths are determined.

< 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

< defines maximum length of neighbour list

< adiabatic index of simulated gas

< adiabatic index of simulated gas

Definition at line 20 of file init.c.

References All, check_omega(), global_data_all_processes::ComovingIntegrationOn, sph_particle_data::Density, domain_Decomposition(), sph_particle_data::DtEntropy, endrun(), sph_particle_data::Entropy, io_header::flag_entropy_instead_u, Flag_FullStep, force_treeallocate(), GAMMA_MINUS1, particle_data::GravAccel, particle_data::GravCost, particle_data::GravPM, header, sph_particle_data::Hsml, sph_particle_data::HydroAccel, global_data_all_processes::ICFormat, global_data_all_processes::InitCondFile, MAX_NGB, global_data_all_processes::MaxPart, ngb_treeallocate(), ngb_treebuild(), global_data_all_processes::NumCurrentTiStep, global_data_all_processes::NumForcesSinceLastDomainDecomp, particle_data::OldAcc, P, global_data_all_processes::PeriodicBoundariesOn, global_data_all_processes::PM_Ti_begstep, global_data_all_processes::PM_Ti_endstep, particle_data::Potential, pow(), read_ic(), RestartFlag, seed_glass(), set_softenings(), setup_smoothinglengths(), global_data_all_processes::SnapshotFileCount, SphP, ThisTask, particle_data::Ti_begstep, global_data_all_processes::Ti_Current, particle_data::Ti_endstep, global_data_all_processes::Time, global_data_all_processes::Timebase_interval, global_data_all_processes::TimeBegin, global_data_all_processes::TimeBetStatistics, global_data_all_processes::TimeLastStatistics, global_data_all_processes::TimeMax, global_data_all_processes::TotNumOfForces, global_data_all_processes::TotNumPart, global_data_all_processes::TreeAllocFactor, global_data_all_processes::TreeDomainUpdateFrequency, TreeReconstructFlag, particle_data::Vel, and sph_particle_data::VelPred.

Referenced by begrun().

void setup_smoothinglengths void   ) 

This function is used to find an initial smoothing length for each SPH particle. It guarantees that the number of neighbours will be between desired_ngb-MAXDEV and desired_ngb+MAXDEV. For simplicity, a first guess of the smoothing length is provided to the function density(), which will then iterate if needed to find the right smoothing length.

Definition at line 197 of file init.c.

References All, NODE::d, global_data_all_processes::DesNumNgb, Father, NODE::father, sph_particle_data::Hsml, NODE::len, particle_data::Mass, NODE::mass, Nodes, P, pow(), RestartFlag, SphP, and NODE::u.

Referenced by init().

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