MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <math.h>
#include <mpi.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <gsl/gsl_rng.h>
#include <omp.h>
#include "stub.h"
#include <libgadget/utils/mymalloc.h>
#include <libgadget/utils/system.h>
#include <libgadget/utils/endrun.h>
#include <libgadget/partmanager.h>
#include <libgadget/walltime.h>
#include <libgadget/domain.h>
#include <libgadget/forcetree.h>
#include <libgadget/gravity.h>
#include <libgadget/petapm.h>
#include <libgadget/timestep.h>
#include <libgadget/physconst.h>
Go to the source code of this file.
Classes | |
struct | forcetree_testdata |
Functions | |
static void | grav_force (const int this, const int other, const double *offset, double *accns) |
void | check_accns (double *meanerr_tot, double *maxerr_tot, double *PairAccn, double meanacc) |
static void | find_means (double *meangrav, double *suppmean, double *suppaccns) |
static void | force_direct (double *accn) |
static int | check_against_force_direct (double ErrTolForceAcc) |
static void | do_force_test (int Nmesh, double Asmth, double ErrTolForceAcc, int direct) |
static void | test_force_flat (void **state) |
static void | test_force_close (void **state) |
void | do_random_test (gsl_rng *r, const int numpart) |
static void | test_force_random (void **state) |
static int | setup_tree (void **state) |
static int | teardown_tree (void **state) |
int | main (void) |
Variables | |
static struct ClockTable | CT |
static const double | G = 43.0071 |
void check_accns | ( | double * | meanerr_tot, |
double * | maxerr_tot, | ||
double * | PairAccn, | ||
double | meanacc | ||
) |
Definition at line 73 of file test_gravity.c.
References GravPM, MPI_INT64, part_manager_type::NumPart, P, and PartManager.
Referenced by check_against_force_direct().
|
static |
Definition at line 146 of file test_gravity.c.
References check_accns(), find_means(), force_direct(), message(), myfree, mymalloc, part_manager_type::NumPart, and PartManager.
Referenced by do_force_test().
|
static |
Definition at line 162 of file test_gravity.c.
References gravshort_tree_params::AdaptiveSoftening, gravshort_tree_params::BHOpeningAngle, part_manager_type::BoxSize, check_against_force_direct(), CM_PER_MPC, Cosmology::CMBTemperature, CP, domain_decompose_full(), domain_free(), gravshort_tree_params::ErrTolForceAcc, force_tree_free(), force_tree_rebuild(), gravshort_tree_params::FractionalGravitySoftening, G, get_unitsystem(), grav_short_tree(), gravpm_force(), gravpm_init_periodic(), gravshort_fill_ntab(), gravshort_set_softenings(), Cosmology::Hubble, Cosmology::HubbleParam, init_cosmology(), Cosmology::MNu, ActiveParticles::NumActiveParticle, part_manager_type::NumPart, Cosmology::Omega0, Cosmology::OmegaBaryon, Cosmology::OmegaCDM, Cosmology::OmegaLambda, P, PartManager, PEANO(), petapm_destroy(), gravshort_tree_params::Rcut, set_gravshort_treepar(), SHORTRANGE_FORCE_WINDOW_TYPE_EXACT, and gravshort_tree_params::TreeUseBH.
Referenced by do_random_test(), test_force_close(), and test_force_flat().
void do_random_test | ( | gsl_rng * | r, |
const int | numpart | ||
) |
Definition at line 291 of file test_gravity.c.
References part_manager_type::BoxSize, do_force_test(), part_manager_type::MaxPart, part_manager_type::NumPart, P, and PartManager.
Referenced by test_force_random().
|
static |
Definition at line 97 of file test_gravity.c.
References GravPM, MPI_INT64, part_manager_type::NumPart, P, and PartManager.
Referenced by check_against_force_direct().
|
static |
Definition at line 125 of file test_gravity.c.
References part_manager_type::BoxSize, grav_force(), part_manager_type::NumPart, and PartManager.
Referenced by check_against_force_direct().
|
static |
Definition at line 38 of file test_gravity.c.
References FORCE_SOFTENING(), G, and P.
Referenced by force_direct().
int main | ( | void | ) |
Definition at line 360 of file test_gravity.c.
References setup_tree(), teardown_tree(), test_force_close(), test_force_flat(), and test_force_random().
|
static |
Definition at line 330 of file test_gravity.c.
References part_manager_type::BoxSize, CT, DomainParams::DomainOverDecompositionFactor, DomainParams::DomainUseGlobalSorting, init_forcetree_params(), part_manager_type::NumPart, PartManager, petapm_module_init(), forcetree_testdata::r, set_domain_par(), DomainParams::SetAsideFactor, DomainParams::TopNodeAllocFactor, and walltime_init().
Referenced by main().
|
static |
Definition at line 353 of file test_gravity.c.
References forcetree_testdata::r.
Referenced by main().
|
static |
Definition at line 270 of file test_gravity.c.
References do_force_test(), part_manager_type::MaxPart, myfree, mymalloc, part_manager_type::NumPart, P, and PartManager.
Referenced by main().
|
static |
Definition at line 226 of file test_gravity.c.
References part_manager_type::BoxSize, do_force_test(), GravPM, part_manager_type::MaxPart, message(), MPI_INT64, myfree, mymalloc, part_manager_type::NumPart, P, and PartManager.
Referenced by main().
|
static |
Definition at line 316 of file test_gravity.c.
References do_random_test(), myfree, mymalloc, part_manager_type::NumPart, P, PartManager, and forcetree_testdata::r.
Referenced by main().
|
static |
Definition at line 1 of file test_gravity.c.
Referenced by setup_tree().
|
static |
Definition at line 35 of file test_gravity.c.
Referenced by check_omega(), do_force_test(), grav_force(), grav_short_postprocess(), gravpm_init_periodic(), and petapm_init().