MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
gravity.h
Go to the documentation of this file.
1 #ifndef LONGRANGE_H
2 #define LONGRANGE_H
3 
4 #include "forcetree.h"
5 #include "petapm.h"
6 #include "powerspectrum.h"
7 #include "timestep.h"
8 
10 {
11  double ErrTolForceAcc;
12  double BHOpeningAngle;
13  int TreeUseBH;
16  double Rcut;
17  /* Softening as a fraction of DM mean separation. */
19  /* if 1, enable adaptive gravitational softening for gas particles, which uses the Hsml as the ForceSoftening */
21 };
22 
26 };
27 
28 /* Fill the short-range gravity table*/
30 
32 void gravshort_set_softenings(double MeanDMSeparation);
33 
34 /* gravitational softening length
35  * (given in terms of an `equivalent' Plummer softening length) */
36 double FORCE_SOFTENING(int i, int type);
37 
38 /*Defined in gravpm.c*/
39 void gravpm_init_periodic(PetaPM * pm, double BoxSize, double Asmth, int Nmesh, double G);
40 
41 /* Apply the short-range window function, which includes the smoothing kernel.*/
42 int grav_apply_short_range_window(double r, double * fac, double * pot, const double cellsize);
43 
44 /* Set up the module*/
46 /* Helpers for the tests*/
47 void set_gravshort_treepar(struct gravshort_tree_params tree_params);
49 
50 /* Computes the gravitational force on the PM grid
51  * and saves the total matter power spectrum.
52  * Parameters: Cosmology, Time, UnitLength_in_cm and PowerOutputDir are used by the power spectrum output code.
53  * TimeIC and FastParticleType are used by the massive neutrino code. FastParticleType denotes possibly inactive particles.
54  * Note: tree is freed during this function*/
55 void gravpm_force(PetaPM * pm, ForceTree * tree, Cosmology * CP, double Time, double UnitLength_in_cm, const char * PowerOutputDir, double TimeIC, int FastParticleType);
56 
57 void grav_short_pair(const ActiveParticles * act, PetaPM * pm, ForceTree * tree, double Rcut, double rho0, int NeutrinoTracer, int FastParticleType);
58 void grav_short_tree(const ActiveParticles * act, PetaPM * pm, ForceTree * tree, double rho0, int NeutrinoTracer, int FastParticleType);
59 
60 /*Read the power spectrum, without changing the input value.*/
61 void measure_power_spectrum(PetaPM * pm, int64_t k2, int kpos[3], pfft_complex *value);
62 
63 /* Compute the power spectrum of the Fourier transformed grid in value.*/
64 void powerspectrum_add_mode(Power * PowerSpectrum, const int64_t k2, const int kpos[3], pfft_complex * const value, const double invwindow, double Nmesh);
65 
66 #endif
void gravshort_set_softenings(double MeanDMSeparation)
struct gravshort_tree_params get_gravshort_treepar(void)
void powerspectrum_add_mode(Power *PowerSpectrum, const int64_t k2, const int kpos[3], pfft_complex *const value, const double invwindow, double Nmesh)
Definition: gravpm.c:327
void gravshort_fill_ntab(const enum ShortRangeForceWindowType ShortRangeForceWindowType, const double Asmth)
Definition: gravity.c:23
void grav_short_pair(const ActiveParticles *act, PetaPM *pm, ForceTree *tree, double Rcut, double rho0, int NeutrinoTracer, int FastParticleType)
void set_gravshort_treepar(struct gravshort_tree_params tree_params)
double FORCE_SOFTENING(int i, int type)
void gravpm_force(PetaPM *pm, ForceTree *tree, Cosmology *CP, double Time, double UnitLength_in_cm, const char *PowerOutputDir, double TimeIC, int FastParticleType)
Definition: gravpm.c:62
int grav_apply_short_range_window(double r, double *fac, double *pot, const double cellsize)
Definition: gravity.c:55
void measure_power_spectrum(PetaPM *pm, int64_t k2, int kpos[3], pfft_complex *value)
Definition: gravpm.c:361
void grav_short_tree(const ActiveParticles *act, PetaPM *pm, ForceTree *tree, double rho0, int NeutrinoTracer, int FastParticleType)
void gravpm_init_periodic(PetaPM *pm, double BoxSize, double Asmth, int Nmesh, double G)
Definition: gravpm.c:53
ShortRangeForceWindowType
Definition: gravity.h:23
@ SHORTRANGE_FORCE_WINDOW_TYPE_ERFC
Definition: gravity.h:25
@ SHORTRANGE_FORCE_WINDOW_TYPE_EXACT
Definition: gravity.h:24
void set_gravshort_tree_params(ParameterSet *ps)
static Cosmology * CP
Definition: power.c:27
static double UnitLength_in_cm
Definition: power.c:26
Definition: petapm.h:62
double BHOpeningAngle
Definition: gravity.h:12
double ErrTolForceAcc
Definition: gravity.h:11
double FractionalGravitySoftening
Definition: gravity.h:18
static const double G
Definition: test_gravity.c:35