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

gravtree.c File Reference

main driver routines for gravitational (short-range) force computation More...

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

Go to the source code of this file.

Functions

void gravity_tree (void)
void set_softenings (void)
int grav_tree_compare_key (const void *a, const void *b)


Detailed Description

main driver routines for gravitational (short-range) force computation

This file contains the code for the gravitational force computation by means of the tree algorithm. To this end, a tree force is computed for all active local particles, and particles are exported to other processors if needed, where they can receive additional force contributions. If the TreePM algorithm is enabled, the force computed will only be the short-range part.

Definition in file gravtree.c.


Function Documentation

int grav_tree_compare_key const void *  a,
const void *  b
 

This function is used as a comparison kernel in a sort routine. It is used to group particles in the communication buffer that are going to be sent to the same CPU.

Definition at line 511 of file gravtree.c.

Referenced by compute_potential(), gravity_forcetest(), and gravity_tree().

void gravity_tree void   ) 
 

This function computes the gravitational forces for all active particles. If needed, a new tree is constructed, otherwise the dynamically updated tree is used. Particles are only exported to other processors when really needed, thereby allowing a good use of the communication buffer.

Definition at line 27 of file gravtree.c.

References gravdata_in::Acc, All, global_data_all_processes::BunchSizeForce, global_data_all_processes::ComovingIntegrationOn, global_data_all_processes::CPU_CommSum, global_data_all_processes::CPU_Imbalance, global_data_all_processes::CPU_TreeConstruction, global_data_all_processes::CPU_TreeWalk, global_data_all_processes::ErrTolTheta, Exportflag, FdTimings, force_treebuild(), force_treeevaluate(), force_treeevaluate_shortrange(), global_data_all_processes::G, grav_tree_compare_key(), particle_data::GravAccel, particle_data::GravCost, GravDataGet, GravDataIn, GravDataIndexTable, GravDataOut, GravDataResult, particle_data::GravPM, sph_particle_data::Hsml, global_data_all_processes::Hubble, gravdata_index::Index, global_data_all_processes::MaxPart, gravdata_in::Ninteractions, NTask, global_data_all_processes::NumCurrentTiStep, NumForceUpdate, NumPart, gravdata_in::OldAcc, particle_data::OldAcc, global_data_all_processes::Omega0, global_data_all_processes::OmegaLambda, P, gravdata_in::Pos, particle_data::Pos, second(), set_softenings(), gravdata_index::SortIndex, SphP, TAG_GRAV_A, TAG_GRAV_B, gravdata_index::Task, ThisTask, global_data_all_processes::Ti_Current, particle_data::Ti_endstep, global_data_all_processes::Time, timediff(), global_data_all_processes::TimeStep, global_data_all_processes::TotNumOfForces, global_data_all_processes::TotNumPart, global_data_all_processes::TreeAllocFactor, TreeReconstructFlag, particle_data::Type, global_data_all_processes::TypeOfOpeningCriterion, gravdata_in::u, and gravdata_in::w.

Referenced by compute_accelerations().

void set_softenings void   ) 
 

This function sets the (comoving) softening length of all particle types in the table All.SofteningTable[...]. We check that the physical softening length is bounded by the Softening-MaxPhys values.

Definition at line 454 of file gravtree.c.

References All, global_data_all_processes::ComovingIntegrationOn, global_data_all_processes::ForceSoftening, global_data_all_processes::MinGasHsml, global_data_all_processes::MinGasHsmlFractional, global_data_all_processes::SofteningBndry, global_data_all_processes::SofteningBndryMaxPhys, global_data_all_processes::SofteningBulge, global_data_all_processes::SofteningBulgeMaxPhys, global_data_all_processes::SofteningDisk, global_data_all_processes::SofteningDiskMaxPhys, global_data_all_processes::SofteningGas, global_data_all_processes::SofteningGasMaxPhys, global_data_all_processes::SofteningHalo, global_data_all_processes::SofteningHaloMaxPhys, global_data_all_processes::SofteningStars, global_data_all_processes::SofteningStarsMaxPhys, global_data_all_processes::SofteningTable, and global_data_all_processes::Time.

Referenced by compute_potential(), gravity_forcetest(), gravity_tree(), and init().


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