MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
#include <mpi.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include "utils.h"
#include "forcetree.h"
#include "treewalk.h"
#include "timestep.h"
#include "gravshort.h"
#include "walltime.h"
Go to the source code of this file.
Functions | |
double | FORCE_SOFTENING (int i, int type) |
void | gravshort_set_softenings (double MeanSeparation) |
void | set_gravshort_treepar (struct gravshort_tree_params tree_params) |
struct gravshort_tree_params | get_gravshort_treepar (void) |
void | set_gravshort_tree_params (ParameterSet *ps) |
int | force_treeev_shortrange (TreeWalkQueryGravShort *input, TreeWalkResultGravShort *output, LocalTreeWalk *lv) |
void | grav_short_tree (const ActiveParticles *act, PetaPM *pm, ForceTree *tree, double rho0, int NeutrinoTracer, int FastParticleType) |
static void | apply_accn_to_output (TreeWalkResultGravShort *output, const double dx[3], const double r2, const double h, const double mass, const double cellsize) |
static int | shall_we_discard_node (const double len, const double r2, const double center[3], const double inpos[3], const double BoxSize, const double rcut, const double rcut2) |
static int | shall_we_open_node (const double len, const double mass, const double r2, const double center[3], const double inpos[3], const double BoxSize, const double aold, const int TreeUseBH, const double BHOpeningAngle2) |
Variables | |
static struct gravshort_tree_params | TreeParams |
double | GravitySoftening |
|
static |
Definition at line 176 of file gravshort-tree.c.
References TreeWalkResultGravShort::Acc, GravShortPriv::cellsize, grav_apply_short_range_window(), and TreeWalkResultGravShort::Potential.
Referenced by force_treeev_shortrange().
double FORCE_SOFTENING | ( | int | i, |
int | type | ||
) |
Definition at line 36 of file gravshort-tree.c.
References gravshort_tree_params::AdaptiveSoftening, GravitySoftening, P, and TreeParams.
Referenced by blackhole_accretion_ngbiter(), density(), force_treeev_shortrange(), get_timestep_dloga(), grav_force(), grav_short_copy(), grav_short_pair_ngbiter(), and grav_short_postprocess().
int force_treeev_shortrange | ( | TreeWalkQueryGravShort * | input, |
TreeWalkResultGravShort * | output, | ||
LocalTreeWalk * | lv | ||
) |
In the TreePM algorithm, the tree is walked only locally around the target coordinate. Tree nodes that fall outside a box of half side-length Rcut= RCUT*ASMTH*MeshSize can be discarded. The short-range potential is modified by a complementary error function, multiplied with the Newtonian form. The resulting short-range suppression compared to the Newtonian force is tabulated, because looking up from this table is faster than recomputing the corresponding factor, despite the memory-access penalty (which reduces cache performance) incurred by the table.
Definition at line 267 of file gravshort-tree.c.
References gravshort_tree_params::AdaptiveSoftening, apply_accn_to_output(), TreeWalkQueryGravShort::base, ForceTree::BoxSize, GravShortPriv::cellsize, NODE::center, NODE::ChildType, NODE::cofm, DMAX, NODE::f, GravShortPriv::FastParticleType, FORCE_SOFTENING(), GRAV_GET_PRIV, GravitySoftening, NODE::hmax, NODE::len, NODE::mass, LocalTreeWalk::mode, NODE::mom, NEAREST, GravShortPriv::NeutrinoTracer, LocalTreeWalk::ngblist, LocalTreeWalk::Ninteractions, LocalTreeWalk::Nlist, LocalTreeWalk::Nnodesinlist, NodeChild::noccupied, NODE_NODE_TYPE, TreeWalkQueryBase::NodeList, NODELISTLENGTH, ForceTree::Nodes, TreeWalkQueryGravShort::OldAcc, P, PARTICLE_NODE_TYPE, TreeWalkQueryBase::Pos, PSEUDO_NODE_TYPE, NODE::s, shall_we_discard_node(), shall_we_open_node(), NODE::sibling, TreeWalkQueryGravShort::Soft, NodeChild::suns, NODE::TopLevel, TreeWalk::tree, TreeParams, GravShortPriv::TreeUseBH, treewalk_export_particle(), and LocalTreeWalk::tw.
Referenced by grav_short_tree().
struct gravshort_tree_params get_gravshort_treepar | ( | void | ) |
Definition at line 55 of file gravshort-tree.c.
References TreeParams.
Referenced by run(), and run_gravity_test().
void grav_short_tree | ( | const ActiveParticles * | act, |
PetaPM * | pm, | ||
ForceTree * | tree, | ||
double | rho0, | ||
int | NeutrinoTracer, | ||
int | FastParticleType | ||
) |
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. NeutrinoTracer = All.HybridNeutrinosOn && (atime <= All.HybridNuPartTime); rho0 = CP.Omega0 * 3 * CP.Hubble * CP.Hubble / (8 * M_PI * G)
Definition at line 105 of file gravshort-tree.c.
References ActiveParticles::ActiveParticle, PetaPM::Asmth, gravshort_tree_params::BHOpeningAngle, GravShortPriv::BHOpeningAngle, ForceTree::BoxSize, GravShortPriv::cbrtrho0, GravShortPriv::cellsize, endrun(), gravshort_tree_params::ErrTolForceAcc, GravShortPriv::ErrTolForceAcc, TreeWalk::ev_label, GravShortPriv::FastParticleType, TreeWalk::fill, force_treeev_shortrange(), GravShortPriv::G, PetaPM::G, grav_short_copy(), grav_short_postprocess(), grav_short_reduce(), TreeWalk::haswork, message(), ForceTree::moments_computed_flag, MPIU_Barrier, mymalloc_usedbytes, GravShortPriv::NeutrinoTracer, PetaPM::Nmesh, ActiveParticles::NumActiveParticle, TreeWalk::postprocess, TreeWalk::priv, TreeWalk::query_type_elsize, gravshort_tree_params::Rcut, GravShortPriv::Rcut, TreeWalk::reduce, TreeWalk::result_type_elsize, TreeWalk::timecommsumm1, TreeWalk::timecommsumm2, TreeWalk::timecomp1, TreeWalk::timecomp2, TreeWalk::timecomp3, TreeWalk::timewait1, TreeWalk::timewait2, TreeWalk::tree, TreeParams, gravshort_tree_params::TreeUseBH, GravShortPriv::TreeUseBH, treewalk_run(), TreeWalk::visit, walltime_add, WALLTIME_IGNORE, and walltime_measure.
Referenced by do_force_test(), run(), and run_gravity_test().
void gravshort_set_softenings | ( | double | MeanSeparation | ) |
Sets the (comoving) softening length, converting from units of the mean separation to comoving internal units.
Definition at line 47 of file gravshort-tree.c.
References gravshort_tree_params::FractionalGravitySoftening, GravitySoftening, message(), and TreeParams.
Referenced by do_force_test(), init(), and setup_density().
void set_gravshort_tree_params | ( | ParameterSet * | ps | ) |
Definition at line 67 of file gravshort-tree.c.
References gravshort_tree_params::AdaptiveSoftening, gravshort_tree_params::BHOpeningAngle, gravshort_tree_params::ErrTolForceAcc, gravshort_tree_params::FractionalGravitySoftening, param_get_double(), param_get_int(), gravshort_tree_params::Rcut, ThisTask, TreeParams, and gravshort_tree_params::TreeUseBH.
Referenced by read_parameter_file().
void set_gravshort_treepar | ( | struct gravshort_tree_params | tree_params | ) |
Definition at line 55 of file gravshort-tree.c.
Referenced by do_force_test(), run_gravity_test(), and setup_density().
|
static |
Definition at line 215 of file gravshort-tree.c.
References NEAREST.
Referenced by force_treeev_shortrange().
|
static |
Definition at line 237 of file gravshort-tree.c.
References NEAREST, and GravShortPriv::TreeUseBH.
Referenced by force_treeev_shortrange().
double GravitySoftening |
Definition at line 31 of file gravshort-tree.c.
Referenced by FORCE_SOFTENING(), force_treeev_shortrange(), and gravshort_set_softenings().
|
static |
Definition at line 1 of file gravshort-tree.c.
Referenced by FORCE_SOFTENING(), force_treeev_shortrange(), get_gravshort_treepar(), grav_short_tree(), gravshort_set_softenings(), and set_gravshort_tree_params().