GADGET-4
simparticles Class Reference

#include <simparticles.h>

Inherits intposconvert, and setcomm.

Public Types

typedef particle_data pdata
 

Public Member Functions

 simparticles (MPI_Comm comm)
 
void copy_particle (particle_data *Ptarget, particle_data *Psource)
 
int getTimeBinSynchronized (int bin)
 
MyFloat get_DtHsml (int i)
 
MyFloat get_Csnd (int i)
 
MyFloat get_OldAcc (int i)
 
double get_utherm_from_entropy (int i)
 
void set_entropy_from_utherm (double utherm, int i)
 
void fill_active_gravity_list_with_all_particles (void)
 
void allocate_memory (void)
 
void free_memory (void)
 
void reallocate_memory_maxpart (int maxpartNew)
 
void reallocate_memory_maxpartsph (int maxpartsphNew)
 
void dump_particles (void)
 
void print_particle_info (int i)
 Print information relative to a particle / cell to standard output. More...
 
void print_particle_info_from_ID (MyIDType ID)
 Print information relative to a particle / cell to standard output given its ID. *. More...
 
int get_active_index (int idx)
 
void reconstruct_timebins (void)
 
integertime find_next_sync_point (void)
 This function finds the next synchronization point of the system. (i.e. the earliest point of time any of the particles needs a force computation). More...
 
void mark_active_timebins (void)
 
void drift_all_particles (void)
 
int drift_particle (particle_data *P, sph_particle_data *SphP, integertime time1, bool ignore_light_cone=false)
 This function drifts a particle i to time1. More...
 
void make_list_of_active_particles (void)
 
integertime get_timestep_grav (int p)
 
integertime get_timestep_hydro (int p)
 
void timebins_get_bin_and_do_validity_checks (integertime ti_step, int *bin_new, int bin_old)
 
void assign_hydro_timesteps (void)
 
void timebin_cleanup_list_of_active_particles (void)
 
int test_if_grav_timestep_is_too_large (int p, int bin)
 
int get_timestep_bin (integertime ti_step)
 
- Public Member Functions inherited from intposconvert
void constrain_intpos (MyIntPosType *pos)
 
template<typename T >
void diff_intpos_to_pos (MyIntPosType *a, MyIntPosType *b, T *posdiff, offset_tuple off=0)
 
MyIntPosType nearest_image_intpos_to_intpos_X (const MyIntPosType a, const MyIntPosType b)
 
MyIntPosType nearest_image_intpos_to_intpos_Y (const MyIntPosType a, const MyIntPosType b)
 
MyIntPosType nearest_image_intpos_to_intpos_Z (const MyIntPosType a, const MyIntPosType b)
 
template<typename T >
void nearest_image_intpos_to_pos (const MyIntPosType *const a, const MyIntPosType *const b, T *posdiff)
 
void nearest_image_intpos_to_absolute_intdist (const MyIntPosType *a, const MyIntPosType *b, MyIntPosType *delta)
 
template<typename T >
MySignedIntPosType pos_to_signedintpos (T posdiff)
 
template<typename T >
void pos_to_signedintpos (T *posdiff, MySignedIntPosType *intpos)
 
template<typename T >
void signedintpos_to_pos (MySignedIntPosType *intpos, T *pos)
 
double signedintpos_to_distanceorigin (MySignedIntPosType *intpos)
 
template<typename T >
void intpos_to_pos (MyIntPosType *intpos, T *posdiff)
 
void intpos_to_intpos (MyIntPosType *intpos, MyIntPosType *xyz)
 
template<typename T >
constrain_pos (T pos)
 
template<typename T >
void pos_to_intpos (T *posdiff, MyIntPosType *intpos)
 
- Public Member Functions inherited from setcomm
 setcomm (MPI_Comm Comm)
 
 setcomm (const char *str)
 
void initcomm (MPI_Comm Comm)
 
void mpi_printf (const char *fmt,...)
 
void determine_compute_nodes (void)
 

Static Public Member Functions

static bool compare_IDs (const MyIDType &a, const MyIDType &b)
 

Public Attributes

int NumPart
 
int NumGas
 
int MaxPart
 
int MaxPartSph
 
long long TotNumPart
 
long long TotNumGas
 
particle_dataP
 
sph_particle_dataSphP
 
unsigned short int MarkerValue
 
subfind_dataPS
 
int TimeBinSynchronized [TIMEBINS]
 
TimeBinData TimeBinsHydro
 
TimeBinData TimeBinsGravity
 
int nsource
 
int * indexlist
 
- Public Attributes inherited from intposconvert
MyReal FacIntToCoord
 
MyReal FacCoordToInt
 
MyReal RegionLen
 
MyReal RegionCorner [3]
 
MyReal RegionCenter [3]
 
- Public Attributes inherited from setcomm
MPI_Comm Communicator
 
int NTask
 
int ThisTask
 
int PTask
 
int ThisNode
 
int NumNodes = 0
 
int TasksInThisNode
 
int RankInThisNode
 
int MinTasksPerNode
 
int MaxTasksPerNode
 
long long MemoryOnNode
 
long long SharedMemoryOnNode
 

Detailed Description

Definition at line 35 of file simparticles.h.

Member Typedef Documentation

◆ pdata

Definition at line 49 of file simparticles.h.

Constructor & Destructor Documentation

◆ simparticles()

simparticles ( MPI_Comm  comm)
inline

Definition at line 38 of file simparticles.h.

Member Function Documentation

◆ allocate_memory()

void allocate_memory ( void  )
inline

Definition at line 273 of file simparticles.h.

◆ assign_hydro_timesteps()

void assign_hydro_timesteps ( void  )

Definition at line 56 of file timestep.cc.

◆ compare_IDs()

static bool compare_IDs ( const MyIDType a,
const MyIDType b 
)
inlinestatic

Definition at line 72 of file simparticles.h.

◆ copy_particle()

void copy_particle ( particle_data Ptarget,
particle_data Psource 
)
inline

Definition at line 65 of file simparticles.h.

◆ drift_all_particles()

void drift_all_particles ( void  )

Definition at line 274 of file predict.cc.

◆ drift_particle()

int drift_particle ( particle_data P,
sph_particle_data SphP,
integertime  time1,
bool  ignore_light_cone = false 
)

This function drifts a particle i to time1.

Parameters
time_previouscurrent time
time1time to which particles get drifted

Definition at line 313 of file predict.cc.

◆ dump_particles()

void dump_particles ( void  )
inline

This function dumps some of the basic particle data to a file. In case the tree construction fails, this is called just before the run terminates with an error message. Examination of the generated file may then give clues to what caused the problem.

Definition at line 321 of file simparticles.h.

◆ fill_active_gravity_list_with_all_particles()

void fill_active_gravity_list_with_all_particles ( void  )
inline

Definition at line 260 of file simparticles.h.

◆ find_next_sync_point()

integertime find_next_sync_point ( void  )

This function finds the next synchronization point of the system. (i.e. the earliest point of time any of the particles needs a force computation).

This function drifts all particles, including inactive particles to the next sync point. This is done by drift_particles(). Afterwards the linked list of active particles is updated to the new sync point by make_list_of_active_particles(). Particles become active/inactive here.

Definition at line 120 of file predict.cc.

◆ free_memory()

void free_memory ( void  )
inline

Definition at line 283 of file simparticles.h.

◆ get_active_index()

int get_active_index ( int  idx)
inline

Definition at line 382 of file simparticles.h.

◆ get_Csnd()

MyFloat get_Csnd ( int  i)
inline

Definition at line 233 of file simparticles.h.

◆ get_DtHsml()

MyFloat get_DtHsml ( int  i)
inline

Definition at line 231 of file simparticles.h.

◆ get_OldAcc()

MyFloat get_OldAcc ( int  i)
inline

Definition at line 235 of file simparticles.h.

◆ get_timestep_bin()

int get_timestep_bin ( integertime  ti_step)

Definition at line 420 of file timestep.cc.

◆ get_timestep_grav()

integertime get_timestep_grav ( int  p)

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.

Parameters
pparticle index

Definition at line 177 of file timestep.cc.

◆ get_timestep_hydro()

integertime get_timestep_hydro ( int  p)
Parameters
pparticle index

Definition at line 274 of file timestep.cc.

◆ get_utherm_from_entropy()

double get_utherm_from_entropy ( int  i)
inline

Definition at line 238 of file simparticles.h.

◆ getTimeBinSynchronized()

int getTimeBinSynchronized ( int  bin)
inline

Definition at line 214 of file simparticles.h.

◆ make_list_of_active_particles()

void make_list_of_active_particles ( void  )

Definition at line 410 of file predict.cc.

◆ mark_active_timebins()

void mark_active_timebins ( void  )

Definition at line 155 of file predict.cc.

◆ print_particle_info()

void print_particle_info ( int  i)
inline

Print information relative to a particle / cell to standard output.

Parameters
iparticle / cell index

Definition at line 343 of file simparticles.h.

◆ print_particle_info_from_ID()

void print_particle_info_from_ID ( MyIDType  ID)
inline

Print information relative to a particle / cell to standard output given its ID. *.

  • Parameters
    IDparticle / cell ID

Definition at line 374 of file simparticles.h.

◆ reallocate_memory_maxpart()

void reallocate_memory_maxpart ( int  maxpartNew)
inline

Definition at line 292 of file simparticles.h.

◆ reallocate_memory_maxpartsph()

void reallocate_memory_maxpartsph ( int  maxpartsphNew)
inline

Definition at line 304 of file simparticles.h.

◆ reconstruct_timebins()

void reconstruct_timebins ( void  )

Definition at line 43 of file predict.cc.

◆ set_entropy_from_utherm()

void set_entropy_from_utherm ( double  utherm,
int  i 
)
inline

Definition at line 249 of file simparticles.h.

◆ test_if_grav_timestep_is_too_large()

int test_if_grav_timestep_is_too_large ( int  p,
int  bin 
)

Definition at line 158 of file timestep.cc.

◆ timebin_cleanup_list_of_active_particles()

void timebin_cleanup_list_of_active_particles ( void  )

Definition at line 637 of file timestep.cc.

◆ timebins_get_bin_and_do_validity_checks()

void timebins_get_bin_and_do_validity_checks ( integertime  ti_step,
int *  bin_new,
int  bin_old 
)

Definition at line 494 of file timestep.cc.

Member Data Documentation

◆ indexlist

int* indexlist

Definition at line 208 of file simparticles.h.

◆ MarkerValue

unsigned short int MarkerValue

Definition at line 61 of file simparticles.h.

◆ MaxPart

int MaxPart

This gives the maxmimum number of particles that can be stored on one processor.

Definition at line 43 of file simparticles.h.

◆ MaxPartSph

int MaxPartSph

This gives the maxmimum number of SPH particles that can be stored on one processor.

Definition at line 44 of file simparticles.h.

◆ nsource

int nsource

Definition at line 207 of file simparticles.h.

◆ NumGas

int NumGas

number of gas particles on the LOCAL processor

Definition at line 41 of file simparticles.h.

◆ NumPart

int NumPart

number of particles on the LOCAL processor

Definition at line 40 of file simparticles.h.

◆ P

This structure holds all the information that is stored for each particle of the simulation. holds particle data on local processor

Definition at line 54 of file simparticles.h.

◆ PS

Definition at line 63 of file simparticles.h.

◆ SphP

holds SPH particle data on local processor

Definition at line 59 of file simparticles.h.

◆ TimeBinsGravity

TimeBinData TimeBinsGravity

Definition at line 205 of file simparticles.h.

◆ TimeBinsHydro

TimeBinData TimeBinsHydro

Definition at line 204 of file simparticles.h.

◆ TimeBinSynchronized

int TimeBinSynchronized[TIMEBINS]

Definition at line 203 of file simparticles.h.

◆ TotNumGas

long long TotNumGas

total gas particle number (global value)

Definition at line 47 of file simparticles.h.

◆ TotNumPart

long long TotNumPart

total particle numbers (global value)

Definition at line 46 of file simparticles.h.


The documentation for this class was generated from the following files: